openmic.social is an uncensored community. You may encounter strong language, controversial opinions, and mature or NSFW material. You must be 18+ to browse. Illegal content is prohibited and removed on sight — please report it. By continuing, you accept that you may see content you personally disagree with.
Code semantic should be separate from code presentation.
In other words, tabs vs spaces is a stupid argument.
We’ve learned that separating semantics and presentation is good for the code we write but we’ve never bothered to apply it to languages. Everyone on the team should be able to apply their own formatting preferences without affecting the underlying file.
Python is the only langauage where this matters. You can write pretty much every other langauage in one long string if you want (fhats what the compiler does to it). But that makes it really hard to read
python is one of the few popular languages where presentation is semantic but I’m talking about separating semantics from presentation. you should be able to radically change how you see the code without actually changing the file.
I should be able to apply a personal style to the code and view it with small indentations, or large indentations, with line widths of 80char or 120char, function args within parentheses or not. I should even be able to localize it into another natural language, or even view and edit it as a flow chart instead of text, all without actually changing the underlying file that contains the semantics.
Yes i have. Several. Its kind of a right of passage after a certain point. They evaluate your desired commands by interpreting the symbols you use and the order you put them in. So yes if you put your symbols in different orders they will be interpreted differently. The way the text is displayed to users is a representation of how it is stored. If you want to have different viewing standards for the same code youre going to have to ALSO code for those different views. Or you force it and tell everyone that YOUR way is the ONLY way and you code your IDE as such.
For pretty much every language BUT python you can “view” it however you want. So long as youre willing to code your display to do as much.
Code semantic should be separate from code presentation.
In other words, tabs vs spaces is a stupid argument.
We’ve learned that separating semantics and presentation is good for the code we write but we’ve never bothered to apply it to languages. Everyone on the team should be able to apply their own formatting preferences without affecting the underlying file.
Python is the only langauage where this matters. You can write pretty much every other langauage in one long string if you want (fhats what the compiler does to it). But that makes it really hard to read
Thats not what I’m talking about.
python is one of the few popular languages where presentation is semantic but I’m talking about separating semantics from presentation. you should be able to radically change how you see the code without actually changing the file.
I should be able to apply a personal style to the code and view it with small indentations, or large indentations, with line widths of 80char or 120char, function args within parentheses or not. I should even be able to localize it into another natural language, or even view and edit it as a flow chart instead of text, all without actually changing the underlying file that contains the semantics.
Youve never written a compiler have you
Have you?
Is your argument that compilers need to change their output based on the way that text gets displayed to users? That’s a pretty wild claim to make.
Yes i have. Several. Its kind of a right of passage after a certain point. They evaluate your desired commands by interpreting the symbols you use and the order you put them in. So yes if you put your symbols in different orders they will be interpreted differently. The way the text is displayed to users is a representation of how it is stored. If you want to have different viewing standards for the same code youre going to have to ALSO code for those different views. Or you force it and tell everyone that YOUR way is the ONLY way and you code your IDE as such.
For pretty much every language BUT python you can “view” it however you want. So long as youre willing to code your display to do as much.