DEV Community

Discussion on: Explicit is better than tricks

Collapse
 
mistval profile image
Randall

I pretty much agree with this, but what is and isn't a trick is largely a matter of perception, and may change with time. Specifically, I remember learning !! to convert something to a boolean, and I didn't regard it as a trick. To me, it was just the way you convert something to a boolean. It's what I and the people around me did. I don't think I even knew about Boolean() then.

I think the perception that it's a fancy trick is one that has grown and become more common over time. Now I too regard it as one, and use Boolean() instead.

Collapse
 
therealnrf profile image
therealnrf

That is exactly what we wish to rectify.

Collapse
 
jonrandy profile image
Jon Randy 🎖️ • Edited

Very bad idea. Will only drag down the quality of developers over time.

Teach people all about the language, don't blindly preach dogma and opinions. Show them the ins and outs of it, how it works, and different ways of doing the same things. Don't patronise them and treat them like children unable to make decisions about which way to do it is best for them or their project.

Readability is purely subjective, and marking parts of the language as 'off limits' or 'bad practice' inhibits knowledge, and potentially the performance of software.

It's this kind of thinking that has progressively dragged down and overcomplicated software over the past decade or more, particularly in web development.