Enough with the "Oh look, you don't need that code that takes 3 seconds to write" already!
87 plus ones
Shared publicly•View activity
View 36 previous comments
- In situations like these, I prefer to default to a scenario where I don't have to think about syntax since there are so many other things that need to be thought about. Is the statement done? Semi-colon. Am I starting an if block? Open curly braces. That's it. I don't have to think "Well, do I need a semi-colon here? Maybe. Let's not add one and see how it goes.
Even if it only takes a fraction of a second, when reading the code, you still have to decipher whether a line is continuing or is over and the next one is beginning. The semi-colon (or whatever statement ending character your language has) tells you its done. No fuss, no muss.
Same with quotes in HTML: Sure, you don't always need them. But you sometimes do. Why make anyone (including yourself) worry about whether you need them or not? Just put them in and forget about it!Apr 17, 2012
- Thank you! As a guy who made the leap from VB to C# and js, I appreciate your righteous rant and hope the powers that be hear you!Apr 17, 2012
- What about the case of two classnames then? omitting quotes around attributes assumes there will never be a space in the value - something you can not assume. I agree that soft line breaks at 80 are old-school but I also don't see the value of lining up tables like that when the content of the cells is unknown. This example tried to prove it is fine to not use closing tags for the brevity of being able to see all the content once again assuming the content is of a certain format. That is one big assumption as the content is the first thing to change. My point is once again that not using the agreed syntax of html4 strict brings you almost nothing and confuses people.Apr 18, 2012
- Great post, thank you.Apr 18, 2012
- I think the best argument is the classic quote from SICP:
"Programs must be written for people to read, and only incidentally for machines to execute."
- Abelson and Sussman
http://www.softwarequotes.com/showquotes.aspx?id=549&name=Abelson%20and%20SussmanApr 18, 2012