3 ms·
I want color, to read code, I can't give up on syntax highlighting
by Kuinox 5y ago
I want color, to read code, I can't give up on syntax highlighting
- emteycz 5y agoI found out that text styling (bold, underline, italic, and different fonts) are more than enough.
- ectopod 5y agoI've seen this in a few software books. It works very well.
- alpaca128 5y agoI've been wondering for a while whether syntax highlighting had a role in certain code style changes. Like the one where open curly brackets were placed at the start of a new line but nowadays are just appended to the end. Without syntax highlighting the older style seems to make more sense as it makes scope delimiters more visible without using colors.
- emteycz 5y agoIMHO it's just preference - at least the last 15 years - but now propagated as a sort of common default/standard with the advent of auto code formatting tools. C# still does what you say (and practically always did - but the Mono people formatted it differently) while Java and JavaScript do the other. Before Prettier, I formatted JS code like C# - I thought it's nicer. Now I use the other because that's what Prettier does and it's usefulness greatly outweighs my preference.
- int_19h 5y agoPutting braces on the same line is the K&R style, which predates Allman style with braces on separate lines. (The original K&R style had the opening brace on a separate line for functions, but I believe this is due to the original syntax for declaring argument types - if you declare them on separate lines, like variables, a distinct { clearly ends the argument block and starts the function body.)
- mannschott 5y agoBack in the day™ Think’s Pascal used bold, italics and underlining to do syntax highlighting because the Mac’s screen was black-and-white. It would be a compromise: you can’t encode as much information into the text’s appearance without access to color, but it could be sufficient depending on your requirements.
- jagger27 5y agoI’m thinking of old Visual Studio syntax highlighting where it primarily uses green and blue. Maybe pick one of those like E-ink panels can already do.
- int_19h 5y agoEven further back in the day, the Algol-60 reference language used bold and/or underlining for keywords - handy when all you have is a typewriter: http://www.softwarepreservation.org/projects/ALGOL/report/Algol60_report_CACM_1960_June.pdf http://www.softwarepreservation.org/projects/ALGOL/report/Al... http://www.algol60.org/reports/algol60_rr.pdf http://www.algol60.org/reports/algol60_rr.pdf (Although technically this was actually syntax, not just syntax highlighting, since that's how the reference language distinguished between keywords and identically spelled identifiers.)
- jagger27 5y agoThat’s a good point. I think one or two colours mixed with font weights and italics could get us pretty far. Response time is a pretty critical metric for me when it comes to coding. I don’t want to have to wait a couple hundred milliseconds to scroll or switch files, so I’m not convinced coding is a great fit for the existing tech. Code isn’t read top to bottom like a novel. That said, hell yes I want less eye strain when coding. I’m sure we can all relate to that.
- chrismorgan 5y agoA few years back, I started a new theme that I call “bland”. I kept it at just pure black on pure white, keywords bold, comments italic for a week. After that, I agreed that some colour was useful, so I made strings red, numbers blue and comments green. All nice and high contrast. Since then I’ve added a little more from time to time, e.g. lifetimes in Rust are italic red, and attributes and macros in Rust code were orange for a few months but are now just italic black (though I still use orange for macro_rules $variables), but I’ve kept it all deliberately minimal and ultra-high contrast. I use the same styling (except for the background colour) on my website. I made a bland-dark somewhere along the way that I very occasionally use, also used on my website. I should probably try something radically different again in another different direction soon. There are generally somewhat better options available for semantic highlighting now than there were five or ten years ago.