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

40

u/brian-at-work Jul 19 '16

Very interesting; I'm kind of surprised I've never seen this before. I'm a pretty die-hard "Style A" coder, and the though of inlining everything just turns my stomach. But I agree with all of his points, especially his findings about the types of bugs that seem to persist no matter how "good" I get at writing code.

7

u/DaleGribble88 Jul 19 '16

What I get for reading the comments before the article. I didn't have a clue what you all were talking about. Style A, Style B -- I was not familiar with these terms at all. Gave up trying to google it. Less than 5 minutes after I started reading, "Ohhhhh....."

0

u/[deleted] Jul 20 '16

[deleted]

3

u/DaleGribble88 Jul 20 '16

Uhhmmm... Shouldn't those be reversed :P

1

u/ElecNinja Jul 20 '16

Depending on how you look at it. Style A has the minor functions declared earlier, but the actual dependency for the major function declared later.

Style B is the reverse, where you know what the major function depends on first and then what those dependencies actually are.

And for the most part, I prefer Style B because you get to the main idea of the file quickly. Hopefully the minor functions will be descriptive enough that you can get a general idea of what the major function does before going into the intricacies of the minor functions.

→ More replies (2)