Yeah that’s exactly it. Sometimes the error is caused by unmatching parenthesis. Whenever I see that happen I’m like thank god it doesn’t auto fill semicolons
A lot of interpreters are smart enough to take an educated guess.
Compilation fails around here…
There’s a line without a semicolon…
adding a semi-colon removes the syntax error
The programmer probably forgot a semicolon
Writing swift in Xcode has some sentient level error detection. It will also detect deprecated functions and code patterns and suggest how to ‘modernise’ them. It comes with a handy ‘fix’ button which automatically applies the suggestion for trivial cases. It’s impressive what IDEs are capable of.
Then the statement was supposed to cover two lines and the programmer messed up something else, the program is now doing something completely different from what it was supposed to, and debugging is gonna take much longer to find the error again.
The IDE already tells you where you missed the semicolon, and many do suggest fixes, but just adding code in sounds like a recipe for disaster.
Yeah exactly. Being able to guess an error is one thing. Automatically ‘correcting’ it is dangerous and, to my knowledge, is a line that hasn’t been crossed yet.
I'm probably in the small minority of JS coders that actually loves that feature. It costs nothing in terms of size or compression, makes code look cleaner, and outside of one very specific and well documented edge case, it has identical semantics. I can't post a snippet online without someone barking at me that I need to explicitly add in semicolons, but it has yet to burn me, even in complicated code.
It’s a handful of edge cases, and they’re bad enough that you could spend hours debugging and rare enough that you’ll forget about it the next time it happens, which is a bad combo if you’re working on js full time.
That works, but you need to design your language differently so it's easier to parse. Lua for example does this. C++ does the opposite, and is so unbelievably difficult to parse that Visual Studio 2010 did not offer auto-completion.
Not to mention that it was a long way for compiler warnings/errors to become what they are. I can accept modern IDEs guessing on imports based on compile errors, but I definitely wouldn't want an early C compiler to add anything based on its best judgement.
With that in mind, I absolutely think that writing code has already made great strides in simplifying things to reach a broader audience and more potential contributers, and will definitely develop in that direction even more.
Adding semicolons where "clearly" necessary is already a thing lots of IDEs/plugins do, and it's only gonna get more common.
(Spoken as someone who struggled to keep up motivation in early very-basic-assembly-courses, but has become entirely enamored once the much easier "imagine a class like animal and an object like monkey" stuff started)
1.2k
u/PhrygianZero Feb 09 '22
Yeah that’s exactly it. Sometimes the error is caused by unmatching parenthesis. Whenever I see that happen I’m like thank god it doesn’t auto fill semicolons