<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom"><title>Z Space Blog - Category-0</title><link href="https://zlg.space/blog/" rel="alternate"/><link href="https://zlg.space/blog/feeds/t/category-0.atom.xml" rel="self"/><id>https://zlg.space/blog/</id><updated>2023-03-16T20:02:00-07:00</updated><entry><title>Why I learned C "Category-0" Style</title><link href="https://zlg.space/blog/why-i-learned-c-category-0-style.html" rel="alternate"/><published>2023-03-16T20:02:00-07:00</published><updated>2023-03-16T20:02:00-07:00</updated><author><name>zlg</name></author><id>tag:zlg.space,2023-03-16:/blog/why-i-learned-c-category-0-style.html</id><summary type="html">&lt;p&gt;I've been asked a few times over the years why I chose to learn C with the
colloquially-known "K&amp;amp;R C Bible", and specifically the &lt;a href="https://clc-wiki.net/wiki/K%26R2_solutions:Ancillary:Category_numbers"&gt;&lt;em&gt;Category-0&lt;/em&gt;&lt;/a&gt;
style, coined on USENET back in the day.&lt;/p&gt;
&lt;p&gt;For those unfamiliar, I'm talking about &lt;em&gt;The C Programming Language, 2nd Ed.&lt;/em&gt;,
by Brian Kernighan and Dennis Ritchie, the creators of the language. In it are
a series of exercises that the reader can work on to build their knowledge of
C through actually building something with it. On &lt;code&gt;comp.lang.c&lt;/code&gt;, people would
share their solutions to exercises in this book. After a while, they coined
different categories of solutions, to refer to their robustness and complexity.&lt;/p&gt;
&lt;p&gt;Category-0 is solving each exercise &lt;em&gt;using only the knowledge the book gives 
you, up to that point&lt;/em&gt;. In other words, it's to approach it as a complete newbie 
and see what you can put together using only the stuff you've learned in the 
book.&lt;/p&gt;
</summary><content type="html">&lt;p&gt;I've been asked a few times over the years why I chose to learn C with the
colloquially-known "K&amp;amp;R C Bible", and specifically the &lt;a href="https://clc-wiki.net/wiki/K%26R2_solutions:Ancillary:Category_numbers"&gt;&lt;em&gt;Category-0&lt;/em&gt;&lt;/a&gt;
style, coined on USENET back in the day.&lt;/p&gt;
&lt;p&gt;For those unfamiliar, I'm talking about &lt;em&gt;The C Programming Language, 2nd Ed.&lt;/em&gt;,
by Brian Kernighan and Dennis Ritchie, the creators of the language. In it are
a series of exercises that the reader can work on to build their knowledge of
C through actually building something with it. On &lt;code&gt;comp.lang.c&lt;/code&gt;, people would
share their solutions to exercises in this book. After a while, they coined
different categories of solutions, to refer to their robustness and complexity.&lt;/p&gt;
&lt;p&gt;Category-0 is solving each exercise &lt;em&gt;using only the knowledge the book gives 
you, up to that point&lt;/em&gt;. In other words, it's to approach it as a complete newbie 
and see what you can put together using only the stuff you've learned in the 
book.&lt;/p&gt;


&lt;p&gt;I had considerable difficulty learning C at first, due mostly to its 
similarities to C++, the challenge of finding good advice and practice, etc. I 
settled on the K&amp;amp;R because it was written by the original language authors. By 
choosing my reference on that criteria, I was certain to find a book that was 
more accurate than most, at minimum.&lt;/p&gt;
&lt;p&gt;After buying my copy and eventually discovering the
&lt;a href="https://clc-wiki.net/wiki/"&gt;clc-wiki&lt;/a&gt;, I started grinding out &lt;a href="https://git.zlg.space/knr"&gt;my own K&amp;amp;R
solutions&lt;/a&gt;. As you can see via the commit log on the
repository, it was a very slow advancement due to real life interfering. But I
did eventually complete it, so that's cool, right?&lt;/p&gt;
&lt;p&gt;Similarly, I have a copy of &lt;em&gt;Programming in Lua&lt;/em&gt;, by Roberto Ierusalimschy, one
of the language's authors, and it's also a wonderful resource in teaching me
Lua. I've heard Stroustrup's C++ books are great for learning. I would buy a
similar reference for Python by Guido van Rossum, but Python is a large beast
that evolves quickly via PEPs and its online docs are superb, so I'm not sure 
what the value of it would be.&lt;/p&gt;
&lt;p&gt;If you're into C, feel free to give it a look. Patches and constructive feedback
are both welcome. There are plans to make a "modern C standard" version of the 
solutions as well, to illustrate the difference between "good code for learning" 
and "the way you should actually build this".&lt;/p&gt;</content><category term="Software"/><category term="C"/><category term="Category-0"/><category term="Programming"/></entry></feed>