6 ms·
My favorite quote from the article: "Shrink your important code." and he explains why: "There was a paper recently that noted that all of the various code qua
by aycangulez 15y ago
My favorite quote from the article: "Shrink your important code."
and he explains why:
"There was a paper recently that noted that all of the various code quality metrics correlated at least as strongly with code size as error rate, making code size alone give essentially the same error predicting ability. Shrink your important code."
- reinhardt 15y agoThe problem is that errors of omissions (code that should be there but isn't) are almost by definition harder to spot than errors of existing code, both for human and static code analyzers.
- hello_moto 15y agoFair observation. But I'd like to know if the paper done research against static languages like C/C++/Java/C# or with dynamic languages as well... Because I have a few people on my back that keep screaming that dynamic languages produce fewer lines of code and jumped into conclusion that "therefore it is better in terms of quality" while the code that these group of people produce seems to be similar to that of Perl => less code, unreadable (requires you to re-read intensively) if you go away for a few days and come back to work on it. Lots of meta-programming and prefer shortcuts over readability. Less bugs? hell no...
- regularfry 15y agoIt's a fairly well-publicised result that the rate of errors introduced is proportional to lines of code, independent of language. Having said that, my googlefu is failing me and I can't find the a cite for it. I'm pretty sure it's mentioned in Code Complete - anyone with a copy handy to help me out?
- hello_moto 15y agoBut do they compare the exact system built using 2 different programming languages from a different programming paradigms? i.e.: Java vs Ruby or Java vs LISP At some point in time, the complexity of the system and the available tools/libraries provided more parameters to the formula of bug-rate calculation that may throw off the result of the paper. Consider this: a fellow worker had to write something that utilizes eBay's API. There is an existing eBay Gems available and he used that first. He stopped after a few hours due to bugs and undocumented stuff. His other options? SOAP/WSDL. Now based on what we know, Java has better SOAP support than Ruby. We're not saying that Ruby can't do it, but we questioned the comfortability/usability of using SOAP and Ruby. Essentially, one must read the WSDL (treat the WSDL as the documentation) to figure out the data type in Ruby. Even then, what happened if the WSDL has been updated by eBay at some point in the future? more further WSDL-proof-read. Not so in Java, with the help of IDE and compiler, you can easily navigate WSDL objects and detect breaks if WSDL has changed (vial wsdl code-gen). At this point, it seems that using Java is a better option as opposed to Ruby. This is where such research tend to be questionable: "when all things stay the same..."
- deleted 15y ago[deleted]