Re:Learn C Programming with Open-Source Books
by bluetomcat on Monday February 06, 2017 @12:28PM
(#13581741)
Take, for example, the declaration parsing example and honestly tell me that this isn't crappy code by any modern standard:
[ Parent
| on HN ]
Re:Learn C Programming with Open-Source Books
by eltoozero on Monday February 06, 2017 @02:09PM
(#13582807)
Pg 124 from 2nd edition where this code is pulled (emphasis mine):
"[T]he programs are intended to be illustrative, not bullet-proof, there are significant restrictions on dcl."
In context this code illustrates the points they're trying to convey about complicated declarations quite well and is a precursor to understanding typedef later in the book.
Also, you left the nice inline comments off the variable declaration block.
Re:Learn C Programming with Open-Source Books
by ejanus on Wednesday February 08, 2017 @04:35AM
(#13597024)
I would like to see where typedef could have been used?
Re:Learn C Programming with Open-Source Books
by Koshkin on Monday February 06, 2017 @01:10PM
(#13582222)
"Modern standard" or not, I find this piece of code highly readable, and, in general, very good for what it does, at the level (of simplicity, perhaps even "primitivism") at which it was intended to do that.
Re:Learn C Programming with Open-Source Books
by berkus on Monday February 06, 2017 @01:57PM
(#13582709)
This piece of code is crap - it's not functional, keeps implicit state.