[ / / / / / / / / / ] [ dir / hrvatska / htg / imouto / newbrit / qq / rel / rwby / wai ]

/tech/ - Technology


Comment *
* = required field[▶ Show post options & limits]
Confused? See the FAQ.
Show oekaki applet
(replaces files and can be used instead)
Password (For file and post deletion.)

Allowed file types:jpg, jpeg, gif, png, webm, mp4, pdf
Max filesize is 12 MB.
Max image dimensions are 10000 x 10000.
You may upload 3 per post.

File: a607b0564cc9ec3⋯.png (188.35 KB, 1440x786, 240:131, semantic-highlight.png)




>Denoting strings by both single and double quotes in the same line

absolutely disgusting.



This is why the "le quotes don't matter" meme needs to die


Too much colour kills the point of highlighting.


Semantic highlighting is a good idea, but a serious fucking nightmare to implement in most editors. Let me know when there's a good language-agnostic plugin in Vim for it.




There is one for the C-family in Nvim for starters. It's even asynchronous, so it won't block your editor.



That's not semantic, that's just highlighting every word with its own color. Try again when your editor can highlight dead code, data tainted by untrusted input, etc.



What's the point? That's the sort of thing that's betters suited for a linter.


Color is nice to gray out comment blocks and fucking useless otherwise. Imagine reading a text where all subjects and objects are bold. Is this useful? No.



Who Needs Color Or Punctuation Or Bold When U Can Emphasize Important Words With Capital Letters Like All Of Mine



Source code is not meant to be read like a novel. Syntax highlighting is like color-coding mechanical parts. I guess all those electrical engineers who have color-coded cables and resistors are idiots as well.



Yeah they are. Imagine all the money that could be saved if all cables and parts were grey.



You are missing the point. When do you actually use color while trying to understand a piece of code? Disable that shit, get used to it for an hour, then try to work on something and see if you actually lost anything.


File: dc48e17bcf49b9b⋯.jpg (123.52 KB, 505x490, 101:98, dc48e17bcf49b9bf247cf93ea0….jpg)


stop being retarded

source code is not a book. when you read code you generally jump over large sections of code until you find something that you want to focus on. skimming code is far easier with syntax highlighting.



Do it instead of running your mouth.


It's a novel idea and I all for the editor understanding the semantics of the language you're writing, but most implementations end up being rainbow fruit salad which is worse than no highlighting at all.





hard to reach conclusion given no credible example material


who gives a shit




>concatenating strings with HTML in them




but anon how do you get the variables into the html otherwise?



Template interpolation.


One of many reasons to use JSLint.


Syntax highlighting is stupid. I don't do that many more mistakes without it.

Just learn to read and touch type.





The HTML is the one output file in that screenshot that is using templates, pajeet.



Looks ok-ish.. then again, I'm colorblind.


More than semantic highlighting what editors need is semantic indentation

It doesn't matter if you use tabs or spaces, when you are inside a block the editor should indent, when you are outside it should not, going back one ore more levels of indentation, based on the surrounding code

It's much, much easier to spot silly mistakes that can cost countless hours of debugging, because you closed a brace too late or too early, or you missed a keyword: you just check the indentation level

That is also good to keep a uniform indentation style, like what Python does

Currently I've seen only Emacs do it, are there any other editors?



I think most editors that are at least somewhat intelligent do that. Vim does it, and it's something I'd expect from IDEs. Some compilers warn about misleading indentation.

Emacs also lets you re-indent the selection with C-M-\, in case you didn't know.


File: 59761692c64be91⋯.png (283.91 KB, 1097x916, 1097:916, XsHHz.png)

I think that scope highlighting is the most useful coloring scheme when using a language like Javascript (or another LISP) that has a lot of nested functions.



>(or another LISP)


[Return][Go to top][Catalog][Post a Reply]
Delete Post [ ]
[ / / / / / / / / / ] [ dir / hrvatska / htg / imouto / newbrit / qq / rel / rwby / wai ]