Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

True, but I haven't experienced that for general syntax highlighting. I do read the code through cat or in other contexts often enough that I haven't lost the ability to read code at normal speed without syntax highlighting. Do you have an example?


i wasn't talking about the ability to read code, even though that was my initial argument for rejecting colors. what i mean is that without colors i might take more effort to write/format code so that it is more readable, instead of relying on syntax highlighting:

with colors this is perfectly readable, because if, for and return appear in red, and other keywords in blue. so they stand out, making the structure more visible than without colors.

    mixed reduce(function fun, array arr, mixed|void zero) {
      if(sizeof(arr))
        zero = arr[0];
      for(int i=1; i<sizeof(arr); i++)
        zero = ([function(mixed,mixed:mixed)]fun)(zero, arr[i]);
      return zero; }
without colors i might prefer to write something like this. using braces around each block, and line breaks, to make each part stand out.

    mixed reduce(function fun, array arr, mixed|void zero)
    {
      if(sizeof(arr))
      {  
        zero = arr[0];
      }

      for(int i=1; i<sizeof(arr); i++)
      {
        zero = ([function(mixed,mixed:mixed)]fun)(zero, arr[i]);
      }

      return zero;
    }
without colors clearly the second is easier to read.

github uses a different color scheme but maybe you can get the idea:

https://github.com/pikelang/Pike/blob/fe4b7ef78cc26316e62e79...


I see. I'm typically quite pedantic and start reformatting code manually as soon as a single space is off.

I've never seen that language. Looks C like (e.g. sizeof), but seams to have a harder type system.


For me it would be like this:

    mixed reduce(function fun, array arr, mixed|void zero) {
      if(sizeof(arr))
        zero = arr[0];

      for(int i=1; i<sizeof(arr); i++)
        zero = ([function(mixed,mixed:mixed)]fun)(zero, arr[i]);

      return zero; 
  }
I only want to isolate blocks (around 10 lines at most) then I can dive in if necessary. I'm using minimal syntax highlighting in Emacs, but I can do fine without.


sure, probably for me too. i was just trying to demonstrate my point which is that the very compact example becomes a lot more readable with syntax highlighting and therefore it potentially encourages to make code less readable for those who don't use syntax highlighting.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: