Re:Ask HN: How to learn best practices when you have no one ...
by danite on Tuesday March 19, 2019 @01:18AM
(#19428266)
Please don't use autistic or OCD as slurs.
Re:Ask HN: How to learn best practices when you have no one ...
by throwawaythekey on Wednesday March 20, 2019 @01:40AM
(#19439324)
Is it being used a slur? It's a fundamental characteristic of those types of people.
Re:Ask HN: How to learn best practices when you have no one ...
by seniorsassycat on Monday March 18, 2019 @06:47PM
(#19426128)
'idiomatic' vs 'best practices'?
Re:Ask HN: How to learn best practices when you have no one ...
by mikekchar on Monday March 18, 2019 @09:03PM
(#19427093)
Thanks for that! "Idiomatic" is such a better word for describing what you actually want. "Best practices" implies that we know for sure that the practice will result in a better outcome. This is almost never true because programming is a very situational activity requiring a lot of judgement calls. If you turn off your brain and apply "best practices", the result is almost always horrific.
However, "idomatic" means writing in a way that other people are likely to be able to understand. That's a great goal! Often it's worth it to write code that isn't quite as good for the situation if it is more idiomatic. It's a judgement call still, but it's still important to know what is and isn't idiomatic so that you can make that judgement call.
Re:Ask HN: How to learn best practices when you have no one ...
by Gibbon1 on Monday March 18, 2019 @07:18PM
(#19426337)
My inner Northcote Parkinson sort of triggers on 'best practices'. Best tends to imply that all the other ways to skin the cat are 'bad.' Which is likely objectively untrue.
Idiomatic is more neutral and means basically just do it the way everyone else tends to. The real advantage to that is you generally avoid pitfalls and annoying other coders.
Re:Ask HN: How to learn best practices when you have no one ...
by colechristensen on Monday March 18, 2019 @07:21PM
(#19426350)
They can mean very similar things so that the question could be:
How to learn idioms when you have no one to teach you?
Re:Ask HN: How to learn best practices when you have no one ...
by spydum on Monday March 18, 2019 @08:42PM
(#19426952)
To which I think we land on the recommendation: seek good examples and mimic them. Trouble is finding them.
Just learn how to write idiomatic code in whatever language / framework you are using. At least the approaches are good enough. And other OCD/Autistic programmers won't lose their shit when they see it.
Do try to write code in an active AKA explicit way. Whne you read the code it should be obvious what it's trying to do. Code where the right thing 'just happens' is never clever it's just bad.
Do remember the process you use for a tiny team is different than google or facebook or a web dev sweatshop.