Re:On the Impact of Programming Languages on Code Quality
by stcredzero on Wednesday June 05, 2019 @02:09PM
(#20107394)
PHP? C?
[ Parent
| on HN ]
Re:On the Impact of Programming Languages on Code Quality
by robbrit on Wednesday June 05, 2019 @02:31PM
(#20107674)
Always remember to turn on warnings in PHP. I remember the joys of tracking down a mistyped variable name that PHP just instantiated and gave a null value to, which was then implicitly converted to empty string when the variable was used.
Re:On the Impact of Programming Languages on Code Quality
by besulzbach on Wednesday June 05, 2019 @03:04PM
(#20108005)
I agree that JS is not substantially "worse" than some other languages.
Despite these three languages giving far too much freedom to the programmers (which some might even like), high-quality code can be written in all three of them, as long as intelligent and strict coding guidelines are thoroughly followed.
Re:On the Impact of Programming Languages on Code Quality
by JamesBarney on Wednesday June 05, 2019 @03:19PM
(#20108141)
I always think of languages as a solution space, and some points in the space possessing bugs while others don't. A perfect language(impossible) would make it so you could write any correct version of a program in the language but not any incorrect version. And language constraints like static typing have the disadvantage that you're preventing a bunch of correct possible solutions while closing off incorrect solutions. Ideally closing off many more incorrect solutions than correct ones increasing your chance of landing in a correction solution.
And of course lots of out of band(non-language) processes and tools that influence this like unit testing/code reviews/strict coding guidelines. But it's always nicer when it's prevented at the language level as opposed to out of band.
Re:On the Impact of Programming Languages on Code Quality
by JamesBarney on Wednesday June 05, 2019 @02:41PM
(#20107783)
Last time I worked with those languages was in college 10 years ago so I didn't know portion of shooting myself in the foot was my fault versus the language.