Live data from Hacker News

Syntax Highlighting Off

robertmelton.com

91–100 of 110 posts

Re: Syntax Highlighting Off

#91

I went the other direction, I programmed for decades without syntax highlighting because back in 1989 I thought ANSI color directory listings were for MS-DOS weenies, so I used a monochrome terminal for everything. I finally became a software developer and adopted syntax highlighting and haven't looked back. Catching unterminated strings and mismatched do..end blocks in ruby saves an incredible amount of time where y…

I tried it with and without recently, I found that for languages I'm familiar with having it on or off made no difference however having flag errors on off did. For languages I don't use much I found having it on more helpful, could I work without it of course, I grew up with computers that didn't have syntax highlighting but I'd miss it. One side result of the experiment was that I turned down the number of colours…

The only synhi I've ever not actively hated was the elvis defaults on a slackware install ten years ago, which basically bolded/italiced/faded text but didn't change the colour.

Re: Syntax Highlighting Off

#92

I went the other direction, I programmed for decades without syntax highlighting because back in 1989 I thought ANSI color directory listings were for MS-DOS weenies, so I used a monochrome terminal for everything. I finally became a software developer and adopted syntax highlighting and haven't looked back. Catching unterminated strings and mismatched do..end blocks in ruby saves an incredible amount of time where y…

Typical mind fallacy.

I've tried both and am vastly more productive with it off. Other people haved tried both and are vastly more productive with it on.

I do often encourage people to try whichever one they're not currently using for a month as an experiment to see if they want to switch - calling people hipsters for performing an experiment to try and make themselves a better programmer strikes me as rather depressing.

Re: Syntax Highlighting Off

#93

I went the other direction, I programmed for decades without syntax highlighting because back in 1989 I thought ANSI color directory listings were for MS-DOS weenies, so I used a monochrome terminal for everything. I finally became a software developer and adopted syntax highlighting and haven't looked back. Catching unterminated strings and mismatched do..end blocks in ruby saves an incredible amount of time where y…

you're talking about a different aspect though. he says that you're more productive if you're writing a lot of code at one time.

you're saying that its easier to catch minor syntax errors with syntax highlighting.

this could, technically, be combined. i.e. writing code without syntax highlighting and enabling it for a quick glance to catch these errors that get obvious with the highlighting.

Re: Syntax Highlighting Off

#94

Earlier quoted context omitted.

>Even basic principles of clean code are often neglected or never taught, in large part due to the lack of professional experience in academic circles. There's a lack of experience in professional circles too. One of the questions I always ask during programming interviews (on either side) is "is your code clean? if so, why?". Invariably the answer is a variant along the lines of "if it passes the linter it's clean",…

Perhaps you should use a less ambiguous term than "clean". They're giving you a correct answer, so perhaps you should ask the correct question? "Is your code readable", perhaps? "Are you proud of your code?". Something like that. No-one's going to admit their code isn't clean, regardless of how they interpret that term.

I think 'clean' can only be evaluated in context.

For instance, whenever I write code for public distribution I try to use the same layout principles and code style rules that are popular within my target audience.

Additionally, I try to present concepts in a way that will either be idiomatic to the target audience or at the very least not judged as unusual.

To give a silly hypothetical example. If I were writing code to be delivered to a company that never uses list comprehensions within Python, I'd write everything as an explicit for-in-loop.

This is less of a problem in certain languages where there's explicit global style guides and a tendency to conservatism (Python). Other communities where that's not the case, like Smalltalk, Lisp, and now Elixir, one can see varying control statements and code inheritance methodologies practiced by different groups simply because of how easy it is to implement, and that doing so isn't shunned.

Re: Syntax Highlighting Off

#95

Earlier quoted context omitted.

>Even basic principles of clean code are often neglected or never taught, in large part due to the lack of professional experience in academic circles. There's a lack of experience in professional circles too. One of the questions I always ask during programming interviews (on either side) is "is your code clean? if so, why?". Invariably the answer is a variant along the lines of "if it passes the linter it's clean",…

Perhaps you should use a less ambiguous term than "clean". They're giving you a correct answer, so perhaps you should ask the correct question? "Is your code readable", perhaps? "Are you proud of your code?". Something like that. No-one's going to admit their code isn't clean, regardless of how they interpret that term.

>They're giving you a correct answer

Is spaghetti code clean if it lints successfully?

Re: Syntax Highlighting Off

#96

Earlier quoted context omitted.

>Even basic principles of clean code are often neglected or never taught, in large part due to the lack of professional experience in academic circles. There's a lack of experience in professional circles too. One of the questions I always ask during programming interviews (on either side) is "is your code clean? if so, why?". Invariably the answer is a variant along the lines of "if it passes the linter it's clean",…

Perhaps you should use a less ambiguous term than "clean". They're giving you a correct answer, so perhaps you should ask the correct question? "Is your code readable", perhaps? "Are you proud of your code?". Something like that. No-one's going to admit their code isn't clean, regardless of how they interpret that term.

It's A correct answer but not THE correct answer. The best answer would be clean code is just beautiful and that's why I strive for it.

Re: Syntax Highlighting Off

#97
Thanks. I use Jetbrains IDE's for coding where my colorschemes have a similar setup. Code, Comments, Strings, are different, and that's about it. Never got around to doing this in Vim which I still use for many tasks (who doesn't?). So this is much appreciated.

Re: Syntax Highlighting Off

#98
I'm on exactly the opposite end of the spectrum (and no one else seems to be supporting the full opposite position, so I may as well). I use use emacs with rainbow-identifiers-mode[1] enabled, which gives every variable a different color. I can't say for certain that it makes me more productive. I just turned enabled it on a lark when I installed spacemacs. But it's fun, and looking at code without it on seems somehow boring now. I'm definitely more comfortable with it on than with it off.

http://i.imgur.com/Q8D9dXz.png

1: https://github.com/Fanael/rainbow-identifiers

Re: Syntax Highlighting Off

#99
Nice experiment and I encourage any developer to tune up their tools so they are happy.

My experience is the opposite: I use syntax hilighting on Emacs, TextMate, and the JetBrains IDEs. When I SSH to a server and use Emacs to edit code, I find it jarring if syntax hilighting is not set up for whatever programming language I am editing. I can't read and understand the code as fast.

Re: Syntax Highlighting Off

#100
post #32

This post misses, for me, the greatest benefit of programming without syntax highlighting enabled. I went through a period of doing it for 5 years or so and the biggest effect was ultimately on how I wrote code, not how I read it. Without syntax highlighting I gradually became more focused on the legibility of what I was writing, because none of the visual cues were there when I read stuff back. Function length, modu…

I'm glad you had a positive experience, but I'd like to point out that thinking about legibility, whitespace, naming etc should be done regardless of highlighting. I don't blame you, IMO it's one of the major issues with computer science education. Even basic principles of clean code are often neglected or never taught, in large part due to the lack of professional experience in academic circles. This leaves aspiring…

This reminds me of one of my favourite peeves when reading code written by maths people:

Every variable is one or two characters long, the code barely indented, and absolutely no spaces anywhere in the code.

Given that a lot of mathematics involves computer programming these days, I find it remarkable that basic programming principles does not seem to be taught at all.

My point here is that this is not just a problem in computer science education. It seems as though every field that touches on programming fails spectacularly in this regard.

Post reply on HN