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

/tech/ - Technology

Catalog

Name
Email
Subject
Comment *
File
* = required field[▶ Show post options & limits]
Confused? See the FAQ.
Flag
Oekaki
Show oekaki applet
(replaces files and can be used instead)
Options
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)

 No.727491

 No.727505

>>727491

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

absolutely disgusting.


 No.727545

>>727505

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


 No.727550

Too much colour kills the point of highlighting.


 No.727553

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.


 No.727580


 No.727605

>>727553

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


 No.727606


 No.727608

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.


 No.727634

>>727608

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


 No.727648

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.


 No.727660

>>727648

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


 No.727681

>>727648

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.


 No.727682

>>727681

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


 No.727693

>>727681

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.


 No.727700

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

>>727693

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.


 No.727702

>>727700

Do it instead of running your mouth.


 No.727709

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.


 No.727731

>medium

>js

>html

hard to reach conclusion given no credible example material

>>727505

who gives a shit


 No.727732

>>727731

also

>concatenating strings with HTML in them

ISHIGGGYDDGTHUYGHTGUHTUHDGT


 No.727821

>>727732

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


 No.727929

>>727821

Template interpolation.

>>727505

One of many reasons to use JSLint.


 No.728021

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

Just learn to read and touch type.


 No.728022

ANTISEMITIC SYNTAX HIGHLIGHTING IS NOT KOSHER


 No.728029

>>727732

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


 No.728043

>>727491

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


 No.728050

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?


 No.728052

>>728050

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.


 No.728344

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.


 No.728441

>>728344

>(or another LISP)

stop




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