Forum comments in chronological order

Disclaimer: I am not responsible for what people (other than myself) write in the forums. Please report any abuse, such as insults, slander, spam and illegal material, and I will take appropriate actions. Don't feed the trolls.

Jag tar inget ansvar för det som skrivs i forumet, förutom mina egna inlägg. Vänligen rapportera alla inlägg som bryter mot reglerna, så ska jag se vad jag kan göra. Som regelbrott räknas till exempel förolämpningar, förtal, spam och olagligt material. Mata inte trålarna.

Oct 2007

A case against syntax highlighting

Anonymous
Mon 15-Oct-2007 17:45
Hi,

Just read your article ... and no, I am not fully convinced.
Consider intending the code. Going by your argument, is it not just about presentation rather than semantics of code. If you read the code carefully (and have enough time on hand) you can make sense of even the most ugly-intended code.

But still, like intending is a useful tool in hand, so is highlighting. And just like different styles of intending you have the right to have your own style of syntax coloring (or lack of it).

Cheers,
Arun
triad
Linus Walleij
Wed 17-Oct-2007 21:48
I can't remember a single time I was helped by syntax highlighting, perhaps as you state it is a bit comfortable to color out comments, but that's it.

But hey, if only semantics matter we could also do away with indentation and that actually (IMHO) serves some kind of purpose as a perception aid. I also perceive being cognition-wise assisted by EMACS features that blink the line of opening "{" when typing terminating "}" in the edit buffer.

The visual studio/visual assist/eclipse guys will say auto-completion helps a lot in object-oriented development. I dunno. I once saw it as a way of trying to deal with unnecessary hierarchies introduced by too much OOP.

Paraforce

triad
Linus Walleij
Wed 17-Oct-2007 21:55
As with many decisions on inclusion/non-inclusion at remix.kwed.org this puzzles me. The song totally rocks, and feature the same kind of whirling, twisting movements and modulation that make the two original pieces so endlessly enjoyable.

Grumpily stated if they prefer easy listening they can just go for Klaus Wunderlich or Roland Cedermark immediately and not pass by the infinite design space of enjoyment that the SID is.

But well it's their decision and the song sits nicely on this page, too.

The SID septet

triad
Linus Walleij
Wed 17-Oct-2007 22:05
As I mentioned once, an interesting concept would be to make a player program with all the tunes and set-up to run one as master and 6 as slaves, then a long, daisy-chained serial cable with 7 DIN jacks (these are open collector so should work OK) and bring all of this to a retro copyparty and PERFORM on 7 C64's! LCP (Little Computer People) or Floppy (HBG) are suitable settings. I had a vision of sound echoing out from all over the room accompanied by the usual copyparty sound environment, chips bags, people talking, videos (pr0n or zombie) running in the background, other SIDs.... The record the shebang as it happens in stereo. I think it'd make one hell of a live recording!

PS the word enter system kills me, it is impossible to see if some letters like S are lower-case or upper-case!
lft
Linus Åkesson
Wed 24-Oct-2007 17:25
An excellent idea! Remind me if we're going to a c64 party together sometime.

triad wrote:

PS the word enter system kills me, it is impossible to see if some letters like S are lower-case or upper-case!

Oops. That was supposed to be a case-insensitive check, but there was a bug. I fixed it. Thanks for reporting it!

A case against syntax highlighting

Anonymous
Thu 25-Oct-2007 09:38
I don't blame you for hating the colors that you've shown here. They're a hideous rainbow of confusion.

Maybe you wouldn't be arguing against syntax highlighting if you'd just try a simpler color scheme. An advanced editor like Visual Studio will actually help you understand what you're looking at...for instance take this random piece of code:

x = Thinger.Convert(y);

Is Thinger a class with a static Convert function? Or is it a property member of the class that this code lives in? With Visual Studio you will know because if it's a class it'll be Aqua colored and if it's a property that returns a class object, it'll just be black (by the default color scheme).

Well, with a name like Linus on a guy from Sweden, I wouldn't be surprised if you are a *nix guy who hasn't used Visual Studio much though.
Anonymous
Thu 25-Oct-2007 09:43
This argument is specious and it is absurd beyond all reckoning. Coloring every word of a paragraph in natural language is in no way similar to syntax coloring in a programming language.

I just cannot believe that anyone could take this argument seriously.
Anonymous
Thu 25-Oct-2007 13:21
I think the idea of syntax highlighting is to clarify the syntax so that the brain can more easily ignore it. Basically, it takes the job of recognizing the structure of the source you're looking it, out of your hands, letting you focus purely on the semantics of the code.

English prose, where the syntax forms an integral part of the reading experience, is completely uncomparable with code, which needs a rigid syntax primarily to help the compiler, not the programmer.
Anonymous
Thu 25-Oct-2007 14:13
Wait a minute, is this linkbait? Syntax highlighting? With compilers, debuggers, code generators, visual editors, and so many other tools that are constantly abused or relied on as a crutch, you complain about syntax highlighting?

And how do you prove your point? By creating a feeble straw man. We don't color our prose just as we don't start our programs with "once upon a time." The only thing in common in those two snippets is that they can be stored as a stream of ASCII characters. They serve complete different purposes and should never be conflated.

While I agree that some editors go overboard, I don't think you should throw the baby with the bathwater. Being able to step back and see the outline of your piece of code before you dive in again is extremely valuable once you grow beyond the hobbyist project.
lft
Linus Åkesson
Thu 25-Oct-2007 15:43
Thank you for all the feedback! Some of your arguments are really good, e.g. the one about indentation. I'll have to think about that.

Many of you complain about my comparison with prose. However, I don't use that as an argument in the text. I even write "Unlike novels..." in the section about semantics. I added the Alice in Wonderland quote as an amusing illustration. Perhaps some of you were just skimming through the article, rather than trying to understand it... =)

I believe that some things should not be made as simple as possible, because when a task is too simple, people do it without thinking. Developing software is complex and error-prone, so people need to be thinking when doing it. And yeah, I realize that these opinions are controversial to some.
Anonymous
Thu 25-Oct-2007 16:54
Having programmed since the middle eighties when there was not syntax coloring. I would call foul, maybe you have a horrible color scheme but color syntax helps you when coding to actually write code that will compile vs. code that won't.

Maybe you only use intellisense for picking types in which case maybe you can get rid of highlighting, but since I type faster than intellisense 90% of the time, I like the color changing to a "type" color when I am done. It also makes finding un-escaped quotes in strings easier.

Want a story where syntax helped? OK. I used to work with the worlds worst speller, he spelled dEfault dAfault which in c/c++ is fine it just becomes a tag named "dafault:" and compiles merrily along. The misspelling is hard to spot reading through code, when at least for myself, I automatically correct misspellings when I read, but with syntax coloring it is VERY obvious. Note: He did not use coloring and I did. He spent days on the bug and had no clue. I spent 10 minutes.

Feel free to not use syntax highlighting, but if you work for me and I find a bug that would never have been had you colored your code, don't be mad when I say I told you so.
Anonymous
Thu 25-Oct-2007 17:21
This is idiotic. If syntax highlighting helps you, use it. If it doesn't, don't. But don't try to make a creaky argument for a personal preference, treating as objective something that is entirely subjective.
Anonymous
Thu 25-Oct-2007 19:40

lft wrote:

I believe that some things should not be made as simple as possible, because when a task is too simple, people do it without thinking. Developing software is complex and error-prone, so people need to be thinking when doing it. And yeah, I realize that these opinions are controversial to some.
Bad behavior -- like smoking, shoplifting, or checking in code without unit tests -- should be made hard. Everything else should be made as simple as possible. Your own article confirms this. You don't dislike syntax highlighting because it makes it too easy for you to code, instead, you dislike it because you find your editor's fruit salad syntax highlighting distracting enough that it makes it _harder_.

I will give you another example I dislike wizards myself, not because they make my life too easy, but because they lead to a false sense of security and frequently mangle my own code. They make my life harder pretending to make it easier.

lft wrote:

Many of you complain about my comparison with prose. However, I don't use that as an argument in the text. I even write "Unlike novels..." in the section about semantics. I added the Alice in Wonderland quote as an amusing illustration. Perhaps some of you were just skimming through the article, rather than trying to understand it... =)
Pictures are supposed to reinforce the ideas in your text. When you take one to argue an opposing view, you are misusing a powerful tool to "trip" your readers. Does it mean that images should be abolished or that they should be used in a more congruent way?
lft
Linus Åkesson
Fri 26-Oct-2007 15:53
Bad behavior -- like smoking, shoplifting, or checking in code without unit tests -- should be made hard. Everything else should be made as simple as possible. Your own article confirms this.

Exactly. And making changes in code that one doesn't fully understand is bad, dangerous behaviour.

You don't dislike syntax highlighting because it makes it too easy for you to code, instead, you dislike it because you find your editor's fruit salad syntax highlighting distracting enough that it makes it _harder_.

But my point is that syntax highlighting makes it easier for us to dive in and fix the code before we understand it, because it encourages us to skim through the code on a superficial level. The syntax highlighting distracts us from seeing the forest by making it easier to see the trees.
Anonymous
Tue 30-Oct-2007 14:52
First, sorry for my bad English.

First, and most important. If you color some program in random colors, like you did with your Alice In Wonderland text, it REALLY will be hard to read.

Computer program is not intended to be read sequentially, instead it contains several layers of semantics, tokens grouped into higher order structures. For example, thanks to syntax highlighting, when you are searching for an identifier, you can skip comments, string constants and operators. In computer program SAME english
word can have different meaning in different places and therefore will confuse you and will slow down your work. Syntax highlighting can show you, for example, that you are using library subroutine name as variable. And, in C, this can be a serious problem. In fact, ability of Visual Assist to distinguish between macros, variables and functions makes this seriously outdated language much more bearable and allows for using more powerful and dangerous features ( especially preprocessor :) ) without fear of shooting youself in the foot.