When a deck or a landing, outside or inside the house, is 30" or higher above grade or the floor, there should be a guardrail. And, to provide safety benefits for children and adults, it has to meet certain requirements. First, and pretty basic, it needs to be secure -- not wobbly. If a 200 pound person leans on it, heavily so, it may give a bit but not collapse or appear to be prone to catastrophic failure.
The rail, also pretty basic, must be a minimum of 36" high. That helps keep a kid from climbing over the rail or an adult from falling over. I have seen rails so low, 20" range, that they were tripping hazards for adults. If you started to fall, I think you would probably be more prone to going right over the rail based on where the rail hit your knees or legs.
The next requirement is more subtle, and it has changed some over the years. Today's safety guidelines state that a rail must have spindles that are spaced close enough together that a 4" sphere cannot pass between them. So that is spacing of something like 3-7/8" max. That keeps a kid from going between the spindles. The rail below has wide spindles.
And, in addition to wide spindles, they got creative at this rail. When people get creative with guardrails, they often end up making mistakes. They breach the safety requirements. This overall guardrail was high enough. However, as a design element, they made the lower section of the rail, from the deck up, 29" high. Then they got cute, built in a six inch gap, and added the rest of the rail. That top gap, like the gap between the spindles below, does not meet rudimentary safety requirements. And, one other thing, the gap from the bottom of the rail down to the deck surface is too wide as well.
For the record, and I think it is odd, general building codes do not require vertical spindles. A person can meet design requirements of most municipalities by installing either vertical or horizontal blocking. Yeah, I know, kids can climb the horizontal bars like a ladder, but don't complain to me, I did not write the rules. That is another excellent example showing that codes are not always based on common sense.
Once again, everybody say at the same time: "Codes are minimum requirements." Read that as the worst way in which you can still LEGALLY build a house. Anyone who believes that codes are the end all/be all of building, has not been around building or inspecting very long. Codes are a good starting point in many circumstances!
Check out "This Day In History" -- music and vintage television from the 1950's through the 1980's. I enjoy writing these articles because they take me back to my days in radio broadcasting. Click on Elvis' gold record, below, to revisit those golden hits of yesteryear.