3 ms·
I agree with most of the post but this line confused me. > The compiler would say “Missing semicolon on line 427.” To which I’d reply “If you know what is miss
by nromiun 6y ago
I agree with most of the post but this line confused me.
> The compiler would say “Missing semicolon on line 427.” To which I’d reply “If you know what is missing, and you know where it is missing, why not add it back yourself? You useless piece of crap!”
How can you add a feature like this without any extra complexity?
It sounds great in theory but in practice most code depend on another piece of code. Most of the time blindly changing one line can introduce more bugs.
- jpindar 6y agoIts bad enough when tools change whitespace without my knowledge (unless this is an option I enabled), I sure don't want them changing anything else.
- catlifeonmars 6y agoWhy is this bad? As someone who has spent a lot of time writing code with auto formatting turned on, I’m genuinely curious which parts of your workflow break when the whitespace changes out from under you.
- xondono 6y agoMost of the pain from this comes from python repos with multiple developers (on different OS) pushing code. Using indentation for control flow was a bad decision, even if most modern IDEs now have good solutions for it.
- mook 6y agoI tried Atom for ten minutes and then gave up on it because it made undesirable whitespace changes by default. Doing code formatting is fine; doing code formatting on lines from a checkout that I didn't change is bad. Yes, the file should be reformatted. But let me know before doing it, so I can make a formatting-only commit so it's easier to review when I put up the PR.
- jpindar 6y agoWhen I'm working on new code, sure, I'll enable it, but other times when working on existing code I just want to make the minimum changes necessary. For example if I'm explaining to someone why their code doesn't work when I try it and what little change would help, sending them their code with dozens of irrelevant changes in addition to the relevant one isn't going to help my case.
- berkes 6y agoI really like how Rust does this. "Expected a colon here, found a <" (ascii-art pointer to the place) "did you forget to close a bracket here?" (ascii-art pointer to 12 lines above that, where, indeed you forgot to close a bracket. It does this for semi-colons (they are not always required), closing brackets (maybe you are nesting something horrendously deep?) etceteras. The idea, basically is "I see this is wrong. But I'm not the one to decide how to fix it for you, but here's a suggestion". I love Rust for this.
- fludlight 6y agoPerl also did this in the late 90s. "Possible runaway quote on line 123"
- shoo 6y agoI remember being baffled for an hour or two after accidentally putting a trailing opening { in a c++ file and then getting thousands of compilation errors all through the standard library headers my application included.
- klyrs 6y agoI don't mind missing semicolons. In c++ paren/bracket mismatches are the bane of my existence. Specifically, if you open a paten in a header file and forget to close it, gcc will dump reams of errors and warnings, even on fairly small projects. Usually the problem is the first error, but for a dangling paren, that one's a red herring, you want the last error. It says you have an unclosed curly-brace in the top-level file. This appears to be due to a confluence of footguns: 1. Files are allowed to have different numbers of open & closed brackets. So who knows where the real error is? For all the compiler knows, you left that paren open deliberately in one file and forgot to include the paren-closing file? 2. C++ syntax generally lets you put anything anywhere -- the compiler doesn't seem to mind that I'm defining a new class literally inside the parentheses of a function call? Is that actually legal? Who knows. But I'm still a little confused... after opening that paren I almost immediately use too many closing braces -- why isn't that spotted immediately?
- spacedcowboy 6y agoThe Vax C compiler used to do this, and mostly got it right. It was a complete nightmare trying to port code that compiled and ran perfectly well on the dept microvax when we all transitioned to Ultrix and Linux. As a result of those months of pain, even thirty years later I’m a huge fan of strongly typed languages, compiling with -Wall and -Werror, and have a zero-warning policy. If you’ve never gone through it, you wouldn’t understand...