This post has been de-listed
It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.
A question of Style.
Specifically formatting If/Then/Else clauses and enclosed blocks of code.
No, I'm not trying to start a formatting war!
I am honestly curious as to what others are doing and more importantly WHY! You might even get me to change my style if your argument is good enough.
Ignoring that there are probably better ways to do the following, it's only an example to use for formatting...
The attached images of three blocks of code do exactly the same thing. If one follows the strict rules laid down by many, the third option is the preferred choice, but I find it hard to read and confusing. I find both options A and B are easier to read.
I call option A the ELSEIF version, option B - Nested If's, and option C... a mess!
I know that both VBA and PHP actually have an ELSEIF statement, but it's not really needed as ELSE IF does pretty much the same thing.
(Sorry for the images, but Reddits Code formatting SUCKS!)
What is your choice, or would you do it a different way?
Don't forget to say WHY!
Subreddit
Post Details
- Posted
- 4 years ago
- Reddit URL
- View post on reddit.com
- External URL
- reddit.com/r/pascal/comm...