3 ms·
It's not all backwards comparability. I'm willing to bet that some (a large part?) is just sloppy software development. SQL Server (2017?) breaks if you update
by cerved 3y ago
It's not all backwards comparability. I'm willing to bet that some (a large part?) is just sloppy software development.
SQL Server (2017?) breaks if you update it on a UTF-8 Windows because it runs a TSQL that doesn't work with that code page. That script is a mess. Some of it is indented using tabs, some space. Trailing whitespace. Yuck
- nikanj 3y agoMy hot take: Code quality is not measured by formatting issues, but by error resilience and number of actual bugs. Much of modern linting and commit hooking is dedicated to checking whitespace placement, variable naming and function lengths but the well-formatted newly rewritten code is still buggy as hell - it just looks pretty
- cerved 3y agoI've often found that people that don't care about white-space also don't care that much about other aspects of code quality The inverse may not have the same correlation, since it can be automated.
- edejong 3y agoFormatting doesn’t remove bugs, but it’ll help you detect them. Linted code helps you scan the code faster and provides valuable pattern recognition, allowing us to detect common mistakes. There have been numerous bugs caused by incorrect code formatting, most notably an SSL security bug from 2014: https://dwheeler.com/essays/apple-goto-fail.html https://dwheeler.com/essays/apple-goto-fail.html Another reason for formatting is the “minimal diff” paradigm. If a formatting rule would not be followed, in the next commit hitting this code, the format would also be affected, causing a larger diff than necessary. There are other reasons for simple format linting, but the reasons above are the most profound. Lastly, formatting is part of a range of static code analysis tools. Generally, formatting inconsistencies are the easiest to detect and resolve, as opposed to more sophisticated tools.
- lpapez 3y agoTrue, but personally for me at least it is easier to find bugs in neatly formatted consistent code than something written in multitude of styles. It is kind of like "pattern matching" on the error patterns.