top | item 15152523

“this code very fast” pull request to remove whitespace from linux kernel

83 points| namanyayg | 8 years ago |github.com | reply

55 comments

order
[+] SwellJoe|8 years ago|reply
This is kinda awesome only because lots of people can't tell if it's a joke or not. I'm reasonably confident it is, but the fact that a lot of people can't tell makes it pretty funny. And, the account that posted it is seemingly new enough to programming to maybe have no idea that it's ridiculous. So, it may even be sincere, which is less funny, but still caused me to think about it for a minute.

Also, I admire the handful of people who commented with a sincere explanation about why it's wrong. I don't have that much patience, but I'm happy that people who do exist.

[+] crispinb|8 years ago|reply
I can't tell whether or not it's a joke.

What I can clearly see is the whole reason I left working in tech: the field is stuffed full of deeply unpleasant and unkind people.

[+] lomnakkus|8 years ago|reply
It's quite funny, but I think (hope) that it's a satirical poke at JS minification...?

(... which, admittedly, would be quite strange now that I think about it. I didn't check, but I assume that there was no variable renaming in the "added line". Hmm... Regardless, I had a good laugh, so it's all good.)

[+] whipoodle|8 years ago|reply
The diff itself is pretty funny. But yeah I have no idea how serious this is meant to be.
[+] Retr0spectrum|8 years ago|reply
Why don't we just compile the kernel to machine code, and distribute that instead?

This would completely eliminate waiting for kernel compilation.

[+] kbr|8 years ago|reply
Machine code varies depending on the platform, and Linux is meant to be distributed to a _ton_ of platforms.
[+] to3m|8 years ago|reply
I do indent my code, but I very rarely insert syntactically irrelevant spaces. I don't mind if clang-format (etc.) puts them in for me, but I don't add them by pressing keys myself and I don't have a problem reading code that leaves them out (since that code looks just like the code I write myself before I run it through clang-format).

This has long been my habit, since I started out on a computer with 32K RAM, where putting in extra spaces just meant you'd need to use shorter variable names to balance things out.

(Here's a photo of some representative code I wrote for a reddit contest a couple of years ago: http://ffe3.com/pics/.beeb/IMG_1373.JPG - not much different from what I wrote in the early 1990s as a teenager. But I did typically use longer variable names back then, because unlike this case I wasn't concerned about fitting the whole listing on one 40x25 screen...)

Even today, doing this still means fewer L1 cache misses in the scanner.

[+] copx|8 years ago|reply
Your code is still needlessly verbose.

Have you ever seen how the ancient Romans wrote Latin? Not only no white space, no interpunctuation either, and everything in uppercase. E.g: http://ratcliffe-college.co.uk/wp-content/uploads/2015/09/La...

So instead of..

  FEO1:INX:LDAS:STX
 
.. you should just write:

  FEO1INXLDASSTX
Now that is concise code!
[+] jmull|8 years ago|reply
Ha, that takes me back.

I got started on Commodore BASIC on an 8K PET.

Your program had to share memory with the source code, so you didn't waste bytes on spaces! (You also used single character variable names as much as possible and jammed as many statements on a line as possible since the overhead per line was a few bytes.)

As a result I can still read very dense code, but I'm reformed and write code that uses white space to avoid an overly busy screen, suggest coupling in the underlying logic, aligns comments, etc.

[+] userbinator|8 years ago|reply
Have you done any APL? You might enjoy it.
[+] altotrees|8 years ago|reply
So many people taking it seriously. I have never attempted to commit anything to the kernel, but it seems like a tough crowd in some areas.
[+] roblabla|8 years ago|reply
I'm fairly sure that there's almost no serious kernel developer answering here. Kernel contributions don't go through github PRs but through mailing lists. The "tough crowd" you see here are trolls - not the actual community, which is inclusive and quite nice to work with.
[+] chainsaw10|8 years ago|reply
It doesn't compile though -- I hope.

I'm pretty sure C keywords require a space on either side...

[+] Jach|8 years ago|reply
Missed opportunity to put in some zero-width unicode spaces just to add that extra bit of uncertainty for whether gcc would respect it...
[+] Pxtl|8 years ago|reply
Solving the tabs vs spaces debate and the cr/lf debate using the Gordian Knot approach.
[+] AaronFriel|8 years ago|reply
Ah, someone must have mistaken this for the Gentoo repository. This sort of patch should be maintained by downstream distributions where concerns like speed are overriding concerns.

Me, personally? I found that compiling was a lot faster if I ran "rm -rf ." first.

[+] roywiggins|8 years ago|reply
While you're at it, minify all the symbols. That will make it much faster.
[+] msla|8 years ago|reply
It's almost certainly a joke, but defaulting to treating things you think are a bad idea as if they were jokes is fairly hostile behavior which makes it impossible for controversial issues to be discussed because someone will treat the side they don't support as being so obviously stupid it must be a joke, which can be dismissed without consideration.
[+] eigenbom|8 years ago|reply
Best joke I've heard all day.
[+] TazeTSchnitzel|8 years ago|reply
Wasn't there an embedded JS implementation where whitespace slowed down code execution?
[+] rjeli|8 years ago|reply
v8 used the string length of a function, including comments, to determine whether to inline. HotSpot used (uses?) bytecode length of a method, so adding useless lines would affect performance.
[+] bmcooley|8 years ago|reply
A few years ago I was playing around with arduino, and adding comments increased the executable file size.
[+] tolgahanuzun|8 years ago|reply
I do not think he's joking. JS thinks in logic. :D
[+] phinnaeus|8 years ago|reply
Lots of people getting whooshed in the comments there.
[+] pvtmert|8 years ago|reply
this guy is hilarious, well i am in the same country where he is from. Turkey obviously.
[+] linopolus|8 years ago|reply
You could always put it through a C formatter after..
[+] saagarjha|8 years ago|reply
I'm pretty sure that no C formatter can handle tokens that run together.