Hacker Newsnew | past | comments | ask | show | jobs | submit | tester457's commentslogin

> Syntax highlighting is juvenile. When I was a child, I was taught arithmetic using colored rods (http://en.wikipedia.org/wiki/Cuisenaire_rods). I grew up and today I use monochromatic numerals.

https://groups.google.com/g/golang-nuts/c/hJHCAaiL0so/m/kG3B...


That must be why traffic lights and electrical wires and transit maps are all black and white...

That’s an interesting point.

The reason traffic lights are colored is because they are showing distinct states of the same thing and the color is the means of differentiating.

Same for transit maps: different routes are colored to distinguish them from other routes, which is especially useful if they overlap.

But that’s not what syntax highlighting does.

The equivalent of your examples would be to not highlight the syntax at all, but only use color coding to distinguish variables.

The equivalent of how syntax highlighting currently works for your examples would be if the light fixture was one color, and the light pole was another, but then all the actual lights were the same color.

I actually think highlighting only the variables with distinct colors could be extremely valuable. Would certainly help avoid mistakes with nested i/j loop counters.

Edit to add: come to think of it, it would have been even more valuable in Go, until recently anyway. The variable color coding would expose the common loop variable instance bugs, because a programmer would be instantly puzzled by the unexpected coloring.


That does exist, it's called semantic highlighting.

In any case, my analogy was not perfect, but neither was Russ's! The point is it's totally normal and not "childish" to use colours to help distinguish things. Traffic lights do not technically need colours (you can use the position of the lights - I assume that's what badly colourblind people do). Nor do transit maps technically need colours - you could just label the lines, or use patterns.

https://www.flickr.com/photos/gywst/1407078279

It's completely absurd to say that colours are childish because they can help children.


Your comment makes me think of LabVIEW - if you're not familiar with it, it uses a visual programming language ("G") in which data flows down wires. The color of the wire indicates the wire's data type (blue for ints, orange for floats, green for bools, pink for strings) and the width of the wire indicates the dimensionality of the data (thin line = scalar, thick line = 1D array, double-thick = 2D array). The color is more than decorative or even assistive - it's essential to understanding the program.

I still wonder why every open-source visual programming language is either a toy for teaching or straight up awful, often not implementing but even loops, when LabVIEW has been doing it right for decades.

Despite its huge size and it installing several services that constantly run in the background, it's still one of my favorite "languages" of all time. It's the only one I've ever seen people going from never having programmed before to making simple but meaningful contributions in within a single day.


> The reason traffic lights are colored is because they are showing distinct states of the same thing and the color is the means of differentiating

I wonder if traffic lights were invented today, would it be just one light changing colour?


As a red-green colourblind person I hope not!

There are a bunch of identical things on my screen called lines. They contain a bunch of mostly identical things called tokens. Syntax highlighting uses different colors to identify the different purposes of all of these tokens blasted onto my screen.

Wow, that thread is a piece of work

> Gofmt was written to reduce the number of pointless discussions about code formatting. It succeeded admirably. I'm sad to say it had no effect whatsoever on the number of pointless discussions about syntax highlighting, or as I prefer to call it, spitzensparken blinkelichtzen.

> When I was a child, I used to speak like a child, think like a child, reason like a child; when I became a man, I did away with childish things.

I sincerely hope Rob Pike was being sarcastic/ironic, because otherwise, he sounds insufferable



he is insufferable. it's his thing lol.

> because otherwise, he sounds insufferable

Oh come on, I like syntax highlights, but this is not "insufferable". It's just opinions expressed strongly, with probably some tounge-in-cheek


He sounds insufferable because he's calling syntax highlighting childish. Not simply politely saying it's not his thing. It's like he can't understand why anyone else would use it, or isn't bothering to. Maybe there's more nuance to what he said, but it's not obvious from the quote.

"I prefer to code in black and white only"

"Everyone who uses syntax highlighting is a child"

I mean, maybe he was genuinely trying to make a joke, but I'm well past the point of assuming random strangers are joking when they're being offensively dumb.


I want to downvote this for being one of the stupidest things I've read this week but you're just quoting it so I guess I'll just seethe silently.

never discount the possibility of so called brilliant people having dumb AF takes.

this is hilarious

There's a powerlessness to using Android.

It's difficult to just do things. Even windows feels more "free." Phone OSes are built like prisons.

Ideally Android would let you drop into a real shell, without having to deal with android sandboxing.

Regardless, I use termux and tasker to get my automations done.


Probably because carriers don't want a bunch of poorly secured devices on their networks.


They don't seem to put much effort in proactively blocking residential VPNs though?


Can't you get USB modems and cram a SIM inside? Are carrier networks really more scary than the internet at large?


If that was the reason then Windows laptops with WWAN wouldn't exist.


Counter-evidence: the Google Play Store, which is a wretched hive of scum and villainy.

And also malware.


Counter-evidence: Repos such as AUR

That blast radius coupled with (non-Android) Linux's atrocious security is a far worse option


>Repos such as AUR

AUR isn't a traditional repository but more functions like a paste bin for package build scripts you have to go out of your way to enable and use at your own risk. It is not how actual Linux repositories work which are way more safe than google or even apple app store.


> way more safe than google or even apple app store.

Probably because of how people submit directly to the commercial app stores and the app store staff are expected to accept them as long as no malware or other problems are detected. Such problems are generally explicitly listed on Terms of Service and app submitters may be able to dispute rejections. Meaning problems generally need to be concrete and justifiable. Also, because of the sheer number, problems are likely scanned for, rather than each app being personally considered by a developer.

FOSS distro package repo maintainers generally don't have any such pressures. They get their absolute pick of what to include from the wild, only taking as much as they're able to handle.

Also, distro repo maintainers handle the building from the source code themselves, while app store apps are closed source to the app stores. Their ability to inspect apps is very limited.


You can root it if you really want (and if the bootloader is unlocked)


What are the main things you can do in a real shell versus termux for instance?

It's a pretty big sandbox in my experience.


If something bothers me with my phone's UI or if I want to change the behavior of some system service, I can do e.g. "apt source phosh", patch it and then "apt build-dep .", "dpkg-buildpackage -b" and "apt install" it right on the phone. I can even send the patch for upstreaming from there.

How easy it is to do an equivalent thing on Android?


UI-wise, termux can run Xorg and you can modify the interface you use there. You're right about services. Can't run systemd, but they can just run the service programs in the background (e.g. they can call sshd directly). Regarding modifying programs, maybe not that convenient directly on termux, but if it's rooted, you may be able to run docker and modify them in a debian environment.

The neat thing about non-Android phones with respect to what you mention is that you can do those things just like how you would on any other computer, without having to worry about Android workarounds that may one day stop working via an update.


"interface you use there" - yes, with a strong accent on "there". Sure, you can even run a x86 emulator in a browser and run anything you want there as long as it's performant enough, but that's a very different thing to actually controlling the OS you run - and even if you do happen to be in some control, modifying anything in Android without reflashing the entire thing is still a massive PITA. And of course you're not gonna pass the attestations once you assert the control anymore, so why not just ditch Android completely at that point?


Last month another vulnerability was found.

https://news.ycombinator.com/item?id=48776527


On the topic of xargs replacements, I love gnu parallel.

The --dry-run flag of parallel made me confident to do more batch processing than I ever did with xargs.

Parallel has an option for almost everything, it's almost too much.

But I have shopped around for alternatives. The creator Ole Tange maintains a painstakingly long article of the alternatives and their differences. [0]

The gnu parallel book and reading materials [1] are excellent too.

[0] https://www.gnu.org/software/parallel/parallel_alternatives....

[1] https://www.gnu.org/software/parallel/#Tutorial


I have used echo as a sort of poor mans equivalent for a safe check of a pipeline, removing the echo when I felt the rest of the pipeline was working correctly.

  shell stuff | xargs -n 1 -I % echo real command and % args
I have also been known to write scripts where instead of executing the critical parts it prints them. Then a dry run is

  script
and the real run is

  script | sh


Shouldn't you use echo instead of cat?


yes echo, total brain fart there. corrected.


Love that idea, thanks for sharing


Oh man, parallel is awful. I have to rant about this because I literally tried it again today morning.

Every single damn time I try parallel and decide to give it another chance, something ends up not working or causing a problem. I can never get it to just do what I want and get out of the way.

Today I foolishly thought maybe I was the one who was holding it wrong every single time in the past, so I copy pasted another command that was supposed to work, and thought surely this would be straightforward. Boy was I wrong. I got some manifesto about academic citations and plagiarism, which confused the hell out of me. After I wasted time trying to figure out how to turn off that nonsense, the app just hung there trying to figure out how long its command line can be? Literally doing nothing? What the hell? I killed it but then my terminal didn't close because every time I did this apparently some perl command was spawned in the background blocked on nothing. Why the hell was perl even relevant? Nothing I wrote used Perl. Just run the darn commands I asked in parallel, is that so hard?


> the app just hung there trying to figure out how long its command line can be?

That's common on linux. Many tools read from stdin if a file path isn't given: cat, xargs, base64, cksum, etc.

The citation thing is a little silly, I'll give you that one.


> That's common on linux. Many tools read from stdin if a file path isn't given: cat, xargs, base64, cksum, etc.

No. I did pipe to stdin. It's not my first time using Linux...

Here's a command line I ran right now, and the output I see:

  $ echo "http://www.example.com" | parallel -k -j 8 curl -s "{}"
  Academic tradition requires you to cite works you base your article on.
  [...more nonsense...]
  To silence this citation notice: run 'parallel --citation' once.
  
  parallel: Warning: Finding the maximal command line length. This may take up to 1 minute.
So I wait a few seconds... until I get fed up and look at my process list, and I see perl is just... seemingly sitting there, doing seemingly absolutely nothing. I'm not going to waste a whole minute of my life waiting for this; I see no reason competently written software should take that long just to accomplish such a simple task where nothing is remotely close to reaching any limits.

So I Ctrl+C. And then the parent perl process gets killed, but the child apparently keeps running.

I press Ctrl+D to exit the terminal, and then:

  $ # (Ctrl+D pressed)
  logout
...it just sits there waiting. Ctrl+C and Ctrl+\ do nothing. I have to kill the lingering perl process manually.

xargs Just Works without any of this nonsense, yet somehow I'm the one holding GNU parallel wrong?


> parallel: Warning: Finding the maximal command line length. This may take up to 1 minute.

> So I wait a few seconds [snip]

This warning is only ever printed if running in Cygwin, not Linux or macOS or elsewhere. Cygwin is notoriously slow.

    # This is slow on Cygwin, so give Cygwin users a warning
    if($^O eq "cygwin" or $^O eq "msys") {
    ::warning("Finding the maximal command line length. ".
          "This may take up to 1 minute.")
    }
Also note that it only figures this out first time, after which it’s cached on disk.


This is on MSYS2, yes, and that excuses absolutely nothing, because this shouldn't be happening in the first place for speed to be even relevant. At the risk of repeating myself thrice: the messages are confusing, the Ctrl+C handling is just utterly broken, the citation message adds to the confusion while being frankly obnoxious, and all of the delays and outputs are unnecessary in the first place as proven by literally every other program that doesn't make me wait a minute before I can use it the first time, including xargs. If Microsoft's own Windows tools did this, everybody would bash them (no pun intended) till the end of time. But since it's GNU Parallel and not Microsoft Parallel, it's Windows's fault for being slow and also my fault for having the audacity to expect better, apparently.


> the messages are confusing > while being frankly obnoxious

Try reading some time. It's pretty great.

> the Ctrl+C handling is just utterly broken

That's your terminal, not parallel.

> and all of the delays

Your terminal is adding the delay, not parallel. parallel is just warning you about your broken terminal. You're shooting the messenger here.


I'm not new to command line tools, but I somehow managed to delete ~10k pictures while trying to use parallel to resize them.

I forget the details but it was some kind of surprisingly weird foot-gun behavior.

Luckily I had a backup, but it really has made me scared to try using parallel again.


>Why the hell was perl even relevant? Nothing I wrote used Perl.

parallel is written in perl.


> Today I foolishly thought maybe I was the one who was holding it wrong […]

Apparently goes on to describe being confused about parallel reading from the standard input?



Are you using the wrong parallel? Moreutils unfortunately ships a (IMO much worse) parallel


This is pretty funny. You almost had me until the Perl part. Not going to get baited this time!


Every time I’ve used Gnu Parallel on a new system it required accepting a Eula, which is annoying. I stick to xargs -P99 these days and am happier.

Utility software which has non-essential different first-run behavior is hostile to users.


I love GNU Parallel too. I love how it's free software and how I can patch out the obnoxious citation notice.


isn't parallel that tool that dumps some kind of begging message into your output each time you invoke it?


Do you really equate a one time request to cite something if you use it in an academic paper with begging? I know they say that users of open source software are entitled, but this seems rather extreme.


No? You can tell it to stop printing the citation notice.


That sounds a lot more like "yes, but..." than "no"


Parallel is ok but rush is nicer and much faster.

https://github.com/shenwei356/rush


The rush project page on Github itself says it is only "slightly" faster.


Modesty, I suppose. The larger your machine is, the more obviously faster it is.


I wish Kdenlive had an api so that I could improve the QOL for myself.


It is open source so you still can but I concede that's probably easier with plugins.


I rather see the prompt they used to make that article, than the article itself. It overstayed it's welcome to say nothing.


This website has a tool just for this. Here's how it went

https://tropes.fyi/aidr/fc7ff499


Charm's tui library is fantastic. This combined with ruby's ease of use will make writing cli apps more fun!


> Your performance and review history is stored in an SQLite database in the same directory as the cards.

Do you use Syncthing or something else to sync your performance history between devices?


Yes.


I like mani. It's a cli that lets you run any command on all of your projects or a tagged subset of them.

  $ mani exec --all --output table --parallel 'find . -type f | wc -l'
  
   Project            | Output
  --------------------+--------
   example            | 31016
   pinto              | 14444
   dashgrid           | 16527
   template-generator | 42
The custom commands you define also have shell completions. It's like a just command runner, but for all of your projects.

https://github.com/alajmo/mani


How are we so blind to these beginner hurdles?

Few people are able to see through the eyes of a beginner, when they are a master.

The 4th one is a pain to teach. Every other file and directory has spaces... so I encourage liberal use of the TAB key for beginners.


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

Search: