<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>inlined code | Learn C Games Programming Blog</title>
	<atom:link href="https://learncgames.com/tag/inlined-code/feed/" rel="self" type="application/rss+xml" />
	<link>https://learncgames.com</link>
	<description>A blog about C, programming games and my ebook(s).</description>
	<lastBuildDate>Fri, 04 Dec 2020 19:21:12 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>https://learncgames.com/wp-content/uploads/2020/03/cropped-favicon-32x32.png</url>
	<title>inlined code | Learn C Games Programming Blog</title>
	<link>https://learncgames.com</link>
	<width>32</width>
	<height>32</height>
</image> 
<site xmlns="com-wordpress:feed-additions:1">181446779</site>	<item>
		<title>John Carmack take on C code arrangements</title>
		<link>https://learncgames.com/john-carmack-take-on-c-code-arrangements/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=john-carmack-take-on-c-code-arrangements</link>
		
		<dc:creator><![CDATA[David]]></dc:creator>
		<pubDate>Sun, 06 Dec 2020 00:00:54 +0000</pubDate>
				<category><![CDATA[C]]></category>
		<category><![CDATA[inlined code]]></category>
		<guid isPermaLink="false">https://learncgames.com/?p=1997</guid>

					<description><![CDATA[<p>&#160; John Carmack is a major games developer involved with DOOM, Quake and many other titles. Recently some past things he wrote were published and its interesting particular about inlined code. You can read the piece here, but I&#8217;ll just copy a little bit out. Which of these three coding styles do you prefer? ------- [&#8230;]</p>
The post <a href="https://learncgames.com/john-carmack-take-on-c-code-arrangements/">John Carmack take on C code arrangements</a> first appeared on <a href="https://learncgames.com">Learn C Games Programming Blog</a>.]]></description>
										<content:encoded><![CDATA[<div class='__iawmlf-post-loop-links' style='display:none;' data-iawmlf-post-links='[{&quot;id&quot;:340,&quot;href&quot;:&quot;https:\/\/en.wikipedia.org\/wiki\/John_Carmack&quot;,&quot;archived_href&quot;:&quot;http:\/\/web-wp.archive.org\/web\/20260206024207\/https:\/\/en.wikipedia.org\/wiki\/John_Carmack&quot;,&quot;redirect_href&quot;:&quot;&quot;,&quot;checks&quot;:[{&quot;date&quot;:&quot;2026-02-06 14:11:53&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-02-10 13:38:17&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-02-14 23:43:44&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-02-18 14:46:06&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-02-26 15:14:11&quot;,&quot;http_code&quot;:404},{&quot;date&quot;:&quot;2026-03-04 18:43:05&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-03-14 03:17:59&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-03-21 05:26:20&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-03-27 00:03:54&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-03-30 00:52:38&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-04-03 03:02:37&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-04-08 09:08:36&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-04-13 05:44:01&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-04-16 19:38:42&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-04-21 06:10:28&quot;,&quot;http_code&quot;:200}],&quot;broken&quot;:false,&quot;last_checked&quot;:{&quot;date&quot;:&quot;2026-04-21 06:10:28&quot;,&quot;http_code&quot;:200},&quot;process&quot;:&quot;done&quot;},{&quot;id&quot;:341,&quot;href&quot;:&quot;http:\/\/number-none.com\/blow\/john_carmack_on_inlined_code.html&quot;,&quot;archived_href&quot;:&quot;http:\/\/web-wp.archive.org\/web\/20251225091227\/http:\/\/number-none.com\/blow\/john_carmack_on_inlined_code.html&quot;,&quot;redirect_href&quot;:&quot;&quot;,&quot;checks&quot;:[{&quot;date&quot;:&quot;2026-02-06 14:11:54&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-02-14 23:43:44&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-02-18 17:01:44&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-04 18:43:14&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-14 03:18:01&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-27 00:03:54&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-03-30 00:52:38&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-04-03 03:02:40&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-04-08 09:08:37&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-04-13 05:44:04&quot;,&quot;http_code&quot;:206},{&quot;date&quot;:&quot;2026-04-18 19:38:25&quot;,&quot;http_code&quot;:206}],&quot;broken&quot;:false,&quot;last_checked&quot;:{&quot;date&quot;:&quot;2026-04-18 19:38:25&quot;,&quot;http_code&quot;:206},&quot;process&quot;:&quot;done&quot;}]'></div>
<p>&nbsp;</p>
<figure id="attachment_2009" aria-describedby="caption-attachment-2009" style="width: 300px" class="wp-caption alignleft"><img fetchpriority="high" decoding="async" class="size-medium wp-image-2009" src="https://learncgames.com/wp-content/uploads/2020/12/quake2-intro-300x194.png" alt="Quake 2 Intro" width="300" height="194" srcset="https://learncgames.com/wp-content/uploads/2020/12/quake2-intro-300x194.png 300w, https://learncgames.com/wp-content/uploads/2020/12/quake2-intro.png 571w" sizes="(max-width: 300px) 100vw, 300px" /><figcaption id="caption-attachment-2009" class="wp-caption-text">Screenshot from Quake 2</figcaption></figure>
<p><a title="Link to Wikipedia article on John Carmack" href="https://en.wikipedia.org/wiki/John_Carmack" target="_blank" rel="nofollow noopener noreferrer">John Carmack</a> is a major games developer involved with DOOM, Quake and many other titles. Recently some past things he wrote were published and its interesting particular about inlined code.</p>
<p>You can read the <a title="Link to Jonathan Blow about John Carmack and inlined code" href="http://number-none.com/blow/john_carmack_on_inlined_code.html" target="_blank" rel="nofollow noopener noreferrer">piece</a> here, but I&#8217;ll just copy a little bit out. Which of these three coding styles do you prefer?</p>
<pre><code class="language-c" data-line="">------- style A:
 
void MinorFunction1( void ) {
}
 
void MinorFunction2( void ) {
}
 
void MinorFunction3( void ) {
}
 
void MajorFunction( void ) {
        MinorFunction1();
        MinorFunction2();
        MinorFunction3();
}
 
--------- style B:
 void MajorFunction( void ) {
        MinorFunction1();
        MinorFunction2();
        MinorFunction3();
}
 
void MinorFunction1( void ) {
}
 
void MinorFunction2( void ) {
}
 
void MinorFunction3( void ) {
}
  
---------- style C:
 
void MajorFunction( void ) {
        // MinorFunction1
 
        // MinorFunction2
 
        // MinorFunction3
 
}</code></pre>
<p>If you look at the source of Asteroids, you&#8217;d probably notice I&#8217;m more of an A or B person. I do like readability. Though if you looked back at the assembler code I wrote 30 odd years ago, it was not very modular. I used functions very rarely back then. In those days, you had to do a lot of tricks like unrolling loops to get that extra bit of performance. Now, it&#8217;s not quite as important and I&#8217;m happy to make it readable.</p>The post <a href="https://learncgames.com/john-carmack-take-on-c-code-arrangements/">John Carmack take on C code arrangements</a> first appeared on <a href="https://learncgames.com">Learn C Games Programming Blog</a>.]]></content:encoded>
					
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1997</post-id>	</item>
	</channel>
</rss>
