Live data from Hacker News

Essential C (2003) [pdf]

cslibrary.stanford.edu

31–40 of 84 posts

Re: Essential C (2003) [pdf]

#33
post #11

Earlier quoted context omitted.

Hmm, I think `for (i = n - 1; i >= 0; --i)` is way clearer and maybe more common? edit: Ah unsigned underflow. :O

Yeah, so then you write for (size_t i = n-1; i It works fine (unsigned overflow is well defined) but it's even less clear.

size_t is unsigned? Since when?

Re: Essential C (2003) [pdf]

#34
post #33

Earlier quoted context omitted.

Yeah, so then you write for (size_t i = n-1; i It works fine (unsigned overflow is well defined) but it's even less clear.

size_t is unsigned? Since when?

Couldn't find an online version of the C standard with links to parts of it, but here's one for C++: http://eel.is/c++draft/support.types#layout-3

> The type size_­t is an implementation-defined unsigned integer type that is large enough to contain the size in bytes of any object ([expr.sizeof]).

Re: Essential C (2003) [pdf]

#35

This, paired with their Pointers and Memory [1] guide are how I learned C in college. They're both pretty short and to the point, I would highly recommend. [1] http://cslibrary.stanford.edu/102/PointersAndMemory.pdf

That and other useful links are listed in the parent page of this pdf. http://cslibrary.stanford.edu/101/

> the greatest pointer/recursion problem ever (advanceed)

Does 'advanceed' mean 'more advanced than advanced?' [1]

[1] https://www.youtube.com/watch?v=YAYKnnWCzto

Re: Essential C (2003) [pdf]

#37

This, paired with their Pointers and Memory [1] guide are how I learned C in college. They're both pretty short and to the point, I would highly recommend. [1] http://cslibrary.stanford.edu/102/PointersAndMemory.pdf

That and other useful links are listed in the parent page of this pdf. http://cslibrary.stanford.edu/101/

I get 404 for the videos on http://cslibrary.stanford.edu/104/.

Example: http://www.cs.stanford.edu/cslibrary/PointerFunCBig.avi returns 404. :(

Re: Essential C (2003) [pdf]

#38
Now then, isn't that nicer? (editorial) Build programs that do something cool rather than programs which flex the language's syntax. Syntax -- who cares?

Although some feel like it’s too opinionated to belong in this article I really appreciated the above. Edit To be clear the author is advocating for simpler syntax here to increase program readability. This could be taken other ways.

Re: Essential C (2003) [pdf]

#40
post #18
post #9

This is a pretty neat guide if you’re cheap and have moral qualms about pirating K&R. Still, I think the best introduction to C remains K&R.

K&R is woefully out of date. Gives you no info on how to do things safely and sanely. And encourages a leet style of programming that results in catastrophic edge case bugs. As you can see in comments above where naive code that iterates backwards through an array fails when the array size is 0. Worse K&R leet style buys you absolutely nothing with a optimizing compiler written in the last 30 years.

I hate guides showing me how to do things safely and sanely from the get-go. Show me how to do it. If safety and sanity are priorities for me, I’ll seek those out on my own.
Post reply on HN