I added a fourth, a variant on the third. It is really surprising me how many people are preferring the second - I would have though the first would be picked most since I learned that that was better from these very forums.
Not sure how the first would be better unless your talking about style wise, which probably is true because I see more people use that style then any other.
I'm still quite new compared to most but the only advantage I see from the first one is it minimizes the risk of forgetting to make it a compound/block statement when you add more statements to it. Which is kind of trivial and a easy fix, but I am sure it happens.
;p true don't use getters and setter kids, and stay off drugs. Anyways ya it was just for example. Though I do see a large amount of people use them even though they defeat the purpose of encapsulation and OOP in general. Though I can't blame them because I still use them sometimes when the project is just something trivial that I am doing.
By the way, ¿what do you use to maintain that alignment?
I just manually space it - I haven't found an IDE that knows how to align it properly and I don't feel like writing a script for it myself because it's a rare task. The other issue is that it would be difficult for an IDE or script to align the related parts so things visually line up rather than just identifiers and syntax elements lining up.
Also, thanks for pointing out that typo (which was made obvious by the alignment, lol)