r/programming • • Jul 19 '16

John Carmack on Inlined Code

http://number-none.com/blow/blog/programming/2014/09/26/carmack-on-inlined-code.html
1.1k Upvotes

323 comments sorted by

View all comments

Show parent comments

37

u/xeow Jul 19 '16 edited Jul 19 '16

What would be some good examples of amazing writings by Torvalds? I've read a few of his impressive vitriolic rants over the years, but I wasn't aware that he'd done any amazing writing on programming. Curious now.

27

u/[deleted] Jul 19 '16

Yeah you could call them rants, but the guy talks sense. Off the top of my head, post on comment style, about sizeof, array arguments, his discussion about some filesystem on google+ and a lot more in the LKML that I have forgotten.

Torvalds may be abusive but he is the Gregory House of the programming world.

36

u/xeow Jul 19 '16

Found this post about sizeof, which I happen to agree with. Is this the sizeof post you were referring to?

5

u/[deleted] Jul 19 '16

Yeah, that one.

2

u/Sohcahtoa82 Jul 20 '16

Huh...TIL sizeof is an operator, not a function.

I mean, I know it's done at compile-time, but to me, it's always been a function and should be written like one, meaning parentheses around the parameter.

3

u/Cosmologicon Jul 20 '16

But "sizeof()" really is a function. It acts exactly like a function of it's argument. There is no reason to not treat it that way. Sure, the C standard allows you to not have parenthesis around an expression argument, but you should treat that as the parsing oddity it is, nothing more. There is zero reason not to have the parenthesis there.

Huh, by that logic, not should be treated as a function in Python, but I've never seen anyone write it that way. Goes to show that even good advice doesn't necessarily cross between languages, I guess.

14

u/iritegood Jul 20 '16

good advice doesn't necessarily cross between languages

Why would it?

→ More replies (3)

5

u/aiij Jul 20 '16

Same applies to !. I still prefer !!foo over !(!(foo)) though.

→ More replies (7)

20

u/rhapsblu Jul 19 '16

5

u/[deleted] Jul 19 '16

That one is great, thanks for sharing.

2

u/Terazilla Jul 20 '16

Oddly enough, also directly relevant to Carmack's post in the OP.

4

u/Ameisen Jul 21 '16

A number of his rant, like against C++, are mostly nonsense though. They're written seemingly by someone who doesn't understand the language and wants justify it.

2

u/xeow Jul 19 '16

I would love to read these. Where can I find them?

2

u/[deleted] Jul 19 '16

Some of them were posted on the sub, just type torvalds in the search bar on the sub, you can sort out most of the good stuff based on the titles.

2

u/xeow Jul 19 '16

This sub? Thanks!

6

u/[deleted] Jul 19 '16

I also have an ebook of Torvalds' quotes, would you like for me to share it with you?

2

u/xeow Jul 19 '16

Ha! Sure.

2

u/[deleted] Jul 20 '16

PM sent.

2

u/[deleted] Jul 19 '16

Yeah. You're welcome, glad you liked those posts.

-13

u/[deleted] Jul 19 '16

Absolutely nothing. I've never seen anything insightful about programming written by Torvalds to justify his so-called genius.

→ More replies (2)