Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
![](/static/devrant/img/pipeless-devrant-banner-white.png)
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
iiii92352yBecause most of the times it's impossible to tell whether you've missed a semicolon or added a line break in the wrong place.
You don't want it to start "fixing" such issues by altering your code, because that will lead to obscure bugs. -
@iiii obscure bugs like javascript - which has "just asume what might have been the intention and do whatever, lol screw error messages" as main paradigma.
-
The error message was just a suggestion. It's not 100 percent certain that you are missing semicolon. If IDEs start making assumption and start adding punctuations everywhere by themselves, soon everything will crash and be gone.
-
arekxv10562yWhen a compiler parses code it uses the rules which say this must go together with this or this with this, etc.
Problem is that some items have multiple different things which can be at one place like detecting an expression in a statement, there is no way for a compiler to know whether you actually wanted to continue the expression spanning multiple lines or to end it with a semicolon so it just says what it expects at the place and lets you figure it out. :) -
wowotek58282yimagine all the time you used to fully cook an egg, then suddenly this AI-Equipped SmartStove™ fix your all-you-wanted-all-day-is-a-perfectly-half-cooked-egg.
-
it doesn't know.
it just assumes a mistake at the first moment the code stops making sense to it.
it's just the nature of how it makes sense of the code that it's often right, even though it's basically by accident, and only in the most trivial cases.
also, python and semicolons? wat? -
@SuspiciousBug I'm pretty sure they mean colons (or maybe the whole thing is made up). Missing colon is the missing semicolon of python.
-
@Oktokolo I'm a person of cultural, I don't use semicolons in Python but use 4 spaces instead of a tab.
-
@TestInProd423: Everyone uses four spaces for indentation. Any deviation from that would be a sure sign of insanity.
-
@Oktokolo Lots of people use tabs for accessibility. Much like the color of text, the typeface and the font size are up to the environment and eventually the developer, so should be the representation of blocks. It's crucial that standards are set and followed on the scale of a codebase as to whether indentation should be with spaces or tabs, but beyond that tabs allow devs with small screens or bad eyesight to set indentation to two spaces and save screen real estate.
-
@Oktokolo any person with a brain uses tabs for indentation because that's their semantic meaning, and set their visual width in their IDE to equivalent to 4 spaces if they want it like that.
sorry, but using spaces to indent code is the same as using spaces to center text in word processors. -
iiii92352y@Midnight-shcode and then there's GitHub which displays tabs as 8 spaces. No, thank you
-
@Midnight-shcode I actually use 4 spaces in most of my existing projects because I felt it was more popular and I wanted to comply. I only really thought about the accessibility argument a few months ago.
@Oktokolo You're making the same assumption just at a different level. I use a laptop and I need 20pt font size so my column width is 74 characters. -
@lbfalvy cool, at least you started thinking about it :)
but i personally am not even that concerned with the accessibility part =D. as i said, what irks me personally the most is programmers - people whose job it is to use symbols in their correct semantic meaning - ignoring the proper semantic usage in such an elementary case as indentation. -
@lbfalvy: I used 80 columns as hard limit for 20 years until i finally decided to adopt the ultra-wide 120 columns standard as a compromise because everyone else insited on having no limit whatsoever... I still use 80 columns as soft limit for most code.
80 as a soft limit actually is nice when resolving merge conflicts or doing a line-by-line cherrypick.
The column soft and hard limits are always a compromise. 72 to 80 are the traditional limits from the previous century where we had to use low-resolution CRTs. 120 still yields plenty of old fart comments. But it is at least possible to coerce other devs into accepting it. -
@lbfalvy: Of course not - it is either tabs or spaces for indentation. Can't compromise and have both.
And spaces have won the war. Tabs are obsolete now - together with carriage returns, form feeds, the bel and other control characters from the teletype era. Only survivor is the monospaced font - because it actually is easier on the eye for texts with high accuracy requirements (like code). -
@Oktokolo None of the other characters you listed have a function, Tab does and that function is currently fulfilled by a device less appropriate. Among the problems arising from this is the need to make compromises with line widths.
-
@iiii Yes, but the rules can be laxer because the narrowest screens can be set to 1-space tab width.
The 8 year old is learning Python, and after a dealing with a syntax bug she asks: "If the computer knows I'm missing a semicolon here, why won't it add it itself?"
I don't know. I really don't know.
rant