News for hackers. Stuff that matters.
Re:Flow vs. Typescript by huuu on Monday June 06, 2016 @12:53AM (#11844741)
But programming with comments is bad practice.

Maybe in this case it doesn't matter very much but there are a lot of ways comments can get lost or messed up.

Re:Flow vs. Typescript by sgift on Monday June 06, 2016 @12:57AM (#11844750)
That's a very common position, but my experience shows me if the comments are not in line with the code that is usually a very good hint that the code will be buggy. It probably has been changed in such a hurry that the comment was forgotten, which doesn't bode well for the code quality.
Re:Flow vs. Typescript by eksemplar on Monday June 06, 2016 @02:04AM (#11844941)
You're not wrong, but comments are bad practice because they allow you to write code you have to explain in a comment. In my opinion comment-less code works really well with SOLID because it forces your developers to code clean and decoupled.

I've yet to be in a "oh this bit needs a comment" moments where the code couldn't be improved significantly to make it both better and more understandable.

Re:Flow vs. Typescript by underwater on Monday June 06, 2016 @02:17AM (#11844978)
Counterpoint for me: V8 source code. It's well written, and easy to follow when you know what you're looking at. But some comments would greatly improve the discoverability for new contributors.
Re:Flow vs. Typescript by pjmlp on Monday June 06, 2016 @03:47AM (#11845239)
Unfortunately code quality tends to be on the bottom of customer happy list.

I also had the "pleasure" to work in a few projects where it wasn't even on the list, beyond a few powerpoint presentations.

Re:Flow vs. Typescript by seanwilson on Monday June 06, 2016 @07:38AM (#11845968)
> That's a very common position, but my experience shows me if the comments are not in line with the code that is usually a very good hint that the code will be buggy.

An example might help but to me bad code is code that repeats itself which includes comments. To me, comments should only be used for high level explanations (e.g. architecture, algorithms, public API) and when the purpose of code is non obvious (e.g. weird bug workarounds, optimisations). The vast majority of comments can be removed by rolling their contents into better function and variable names.

Re:Flow vs. Typescript by huuu on Monday June 06, 2016 @01:04AM (#11844772)
IDEs can also mess with comments because they don't parse it as code. A simple extra linebreak added and your code breaks.
Re:Flow vs. Typescript by PDoyle on Monday June 06, 2016 @08:22AM (#11846214)
Not true when the comments are mechanically checked for correctness.