Hacker News new | ask | show | jobs
by tel 4037 days ago
The problem is that without a linter there's no punishment for missing semicolons.

So really the argument should be that everyone should use a linter.

3 comments

Agreed. I spend most of my time writing non-semicolon languages like Ruby, Haskell, Scala, Elixir, Clojure, and Python. As a result, I never developed the semi-colon reflex that a lot of Algol-family language users built up. I constantly forget semi-colons even after all these years, and my own inability to remember annoys me.

I used to skip semicolons in JavaScript because I could never remember to include them. Using a linter with Emacs made it a non-issue; I get a warning in my editor immediately when I miss one.

PS: I'm really enjoying Rust, so maybe this will be the language that finally forces me to pick up the semi-colon habit.

I thought about that regarding semicolons, optional braces, newline placement, consistent placing of whitespace in general; then I decided having the machine tell me where I need to do more work is all very well and good, but what I really want is a program that will do the work for me instead. So I wrote one: https://www.npmjs.com/package/jsclean
Oh, there's plenty of punishment. Avoiding the punishment in the difficult part. And you can do that the easy way or the hard way.
Well, sure, but it's probabilistic and delayed punishment. This makes learning habits and ensuring them difficult.