Live data from Hacker News

Best Practices Exist For A Reason

tomdale.net

81–90 of 105 posts

Re: Best Practices Exist For A Reason

#81

The main problem with appealing to "best practices" is this: One man's best practice is another man's anti-pattern. Between semicolon-free folks and JavaScript traditionalists, who gets to play the role of the expert? If Node.js is popular, does that mean that Isaac's comma-first style is "correct"? ( https://gist.github.com/357981 ) In the absence of a quantitative engineering method with which to evaluate either ap…

"Between semicolon-free folks and JavaScript traditionalists, who gets to play the role of the expert? If Node.js is popular, does that mean that Isaac's comma-first style is "correct"? ( https://gist.github.com/357981) No. Isaac doesn't define what style node.js is written in. And in an interview when he took on the lead developer role on he affirmed that he would abide by their current coding preference, which wasn…

It's surprising that we haven't managed to create languages/editors which can break code down into atoms which can be presented however the developer working on said code likes. E.g. if a segment of code was tokenized properly and the editor could manipulate those tokens, coding style issues would become a thing of the past.

Re: Best Practices Exist For A Reason

#82
Having too many semicolons will never ever cause you a problem. Having too few almost certainly will. Why is this an argument? Don't we have enough bugs to deal with? just use the semicolons, or get out of my way.

Most arguments about style are almost certainly pointless, but if you are faced with a choice between two styles, one of which may cause a problem sometimes if you don't know what you are doing, and the other style, which will never ever cause you a problem, it seems the choice is kind of obvious, no? Particularly since the guy doesn't really make a case for what his objection to semicolons actually is to begin with. He doesn't like the look of them?

Re: Best Practices Exist For A Reason

#83

The main problem with appealing to "best practices" is this: One man's best practice is another man's anti-pattern. Between semicolon-free folks and JavaScript traditionalists, who gets to play the role of the expert? If Node.js is popular, does that mean that Isaac's comma-first style is "correct"? ( https://gist.github.com/357981 ) In the absence of a quantitative engineering method with which to evaluate either ap…

"In the absence of a quantitative engineering method with which to evaluate either approach, isn't it a purely personal and political choice?" No. Here's one idea: perhaps everyone's opinion is not equal on every subject. Perhaps by looking at the opinions of respected accomplished people who have garnered the respect of other respected accomplished people you can being to see who's opinion should get more weight. Th…

"If a huge number of other smart and experienced people have been convinced by one of them ... well I'd go with that guy"

This will answer the question, "who is best at arguing their point". It does not reliably answer, "whose point is correct?"

Re: Best Practices Exist For A Reason

#84
post #81

Earlier quoted context omitted.

"Between semicolon-free folks and JavaScript traditionalists, who gets to play the role of the expert? If Node.js is popular, does that mean that Isaac's comma-first style is "correct"? ( https://gist.github.com/357981) No. Isaac doesn't define what style node.js is written in. And in an interview when he took on the lead developer role on he affirmed that he would abide by their current coding preference, which wasn…

It's surprising that we haven't managed to create languages/editors which can break code down into atoms which can be presented however the developer working on said code likes. E.g. if a segment of code was tokenized properly and the editor could manipulate those tokens, coding style issues would become a thing of the past.

If you can express your style in a way a code-formatting tool can apply, then you can use checkout and commit hooks in your vcs to apply the formatting. Code in the repo gets a team-standard formatting, and code in your working copy gets your personal formatting. You just have to make sure the whole team uses the commit hook, at least. (Or in most systems you can apply that hook on your central/official repo.)

The only problem with this approach is the diffs between the repo and your working copy.

Re: Best Practices Exist For A Reason

#85
post #48

The real question is why anyone takes obviously wrong artifacts in JavaScript like omitting semicolons and flagrantly wrongly designed this binding seriously. This isn't an issue of best practices or personal preferences, it's aspects of a ubiquitous language that are simply and unequivocally broken.

This just begs the question: they're broken, because they're broken? And anybody who thinks the features neat is wrong? The reason people talk about omitting semi-colons in JavaScript is because they don't think that feature is unusable--they clearly think it's better than adding semi-colons everywhere! When reasonable people disagree like that, the situation is rarely simple and clear-cut. Now, perhaps you could rea…

It has always been a mystery to me that reasonable people somehow think it is better to omit the semicolons where you can instead of just being 100% consistent by using them to terminate every statement. I have always thought that computers, programming, logic were always all about favouring consistency and simplicity. My mind boggles that otherwise talented people do not see the value in using simpler rules when they work and avoiding exploiting complex things that seem to offer somewhere between little and no extra value.

I guess I just don't get it because it has always seemed precisely a simple and clear-cut thing to me but somehow it is not.

Re: Best Practices Exist For A Reason

#86
post #48

The real question is why anyone takes obviously wrong artifacts in JavaScript like omitting semicolons and flagrantly wrongly designed this binding seriously. This isn't an issue of best practices or personal preferences, it's aspects of a ubiquitous language that are simply and unequivocally broken.

This just begs the question: they're broken, because they're broken? And anybody who thinks the features neat is wrong? The reason people talk about omitting semi-colons in JavaScript is because they don't think that feature is unusable--they clearly think it's better than adding semi-colons everywhere! When reasonable people disagree like that, the situation is rarely simple and clear-cut. Now, perhaps you could rea…

Yes, they're wrong, because they make certain classes of errors impossible to catch automatically, and place that much heavier a burden on me to use the tool. You can do what you like in private, but forcing me to waste my mental energy because it makes you feel good about yourself to be able to manage lots of complicated trivia? Should I be accepting if you wanted me to use a hammer with a spike on the side of the handle?

Re: Best Practices Exist For A Reason

#87

Earlier quoted context omitted.

"In the absence of a quantitative engineering method with which to evaluate either approach, isn't it a purely personal and political choice?" No. Here's one idea: perhaps everyone's opinion is not equal on every subject. Perhaps by looking at the opinions of respected accomplished people who have garnered the respect of other respected accomplished people you can being to see who's opinion should get more weight. Th…

"If a huge number of other smart and experienced people have been convinced by one of them ... well I'd go with that guy" This will answer the question, "who is best at arguing their point". It does not reliably answer, "whose point is correct?"

And yet, somehow we've created science and a pretty large civilization by being able to argue points rationally and logically and not always being convinced solely by rhetoric. So my counterpoint to your "it does not reliably answer..." is the fact that we are having this argument on the fucking internet.

That's why this system relies on convincing smart, educated people and not just people in general. The need for intellectual discourse to avoid this exact problem and what that looks like is taught as part of being educated.

Re: Best Practices Exist For A Reason

#88
post #79

Earlier quoted context omitted.

"In the absence of a quantitative engineering method with which to evaluate either approach, isn't it a purely personal and political choice?" No. Here's one idea: perhaps everyone's opinion is not equal on every subject. Perhaps by looking at the opinions of respected accomplished people who have garnered the respect of other respected accomplished people you can being to see who's opinion should get more weight. Th…

>And in the vast majority of cases, when you ask that question about a specific problem: One of those men is wrong. Even if they're both smart. But how to tell? If a huge number of other smart and experienced people have been convinced by one of them ... well I'd go with that guy. You won't be right all the time but it's the best system we've come up with so far for things that don't conform to double blind placebo c…

I agree, but you're looking at this at a lower level of abstraction than I was. As you go from case to case you need some kind of methodology or general principles or best practices to guide you, you don't start from "I think therefore I am" for every problem.

Re: Best Practices Exist For A Reason

#89

Earlier quoted context omitted.

"You can think about the effect of coding style instead of letting the experts think for you." Right, because what could those experts possibly have to teach you? Fuck that intellectual crap, brogrammers are here to crank out some code yo! Just because those dinosaurs have spent "thousands of hours" studying and trying out different programming styles and concepts means I should listen to them? This is the internet a…

You completely and utterly missed the point, in addition to just being needlessly rude. The point of your parent was "don't let the experts think for you", not "screw the experts" - that's a very important distinction. You should form your own opinions, not just uncritically adopt the opinion of some expert. It's unquestionable that expert knowledge and experience is important - but nothing beats forming your own (ho…

Who said "let the experts think for you"? No one. You were arguing against "give the experts' opinions more weight than others, often a lot more"

"You should form your own opinions, not just uncritically adopt the opinion of some expert."

False dichotomy again, there is a lot of ground between "uncritically adopt the opinion of some expert" and "forming your own opinion and hoping it's informed".

You should find that middle ground, it's where all the smart people are.

I didn't miss the point at all, I just completely disagree with you. I don't think it was needlessly rude either, it was sarcastic. And I feel no need to treat people who are promoting anti-intellectualism with kid gloves.

Re: Best Practices Exist For A Reason

#90
post #3

First, Isaac Schlueter isn't advocating against best practices with ASI. He's advocating for an alternate best practice that you disagree with. In that very article he suggests an alternate place to put the necessary semicolons. Second, the CouchDB thing isn't because of a lack of best practices, it's because the wrong best practices were misapplied. And in the end, its use of best practices prevented it from severel…

you can't have alternative best practices... the BEST in best practices kind of makes that clear.

best practices and most practical practices are not always the same though.

Post reply on HN