Opening and closing braces


Hi all. It seems that many people are getting stuck because their braces are imbalanced. I have been programming in different languages for years, and though I'm just a user here like all of you, I thought I'd share a tip I learned a long time ago that I don't see mentioned in many tutorials:

Whenever I type an opening brace, I immediately type its corresponding closing brace on the next line, like this:

if(condition1 === condition2){

I then use the arrow key once and hit Enter to add a blank line:

if(condition1 === condition2){


...and now when I add code in the blank area, it naturally falls within the proper brace structure.

Hope this is helpful for everyone. It's really frustrating to be stuck for hours and find out that all you needed was a closing brace somewhere!



Yes, this is one of the most commonly made mistakes in programming. I also use the method(the one that you described) so I can make sure that all my opening brackets have closing ones. If you don't use a method like this one, it makes it very difficult to submit your code, and then it says "Syntax Error" and you have to find out what opening brackets don't have closing ones and..... it's just a really big pain. Thanks so much for sharing this method with everyone so they don't have to go the long way........ :grinning: