Live data from Hacker News

Beej's Guide to C Programming (2007)

beej.us

31–40 of 81 posts

Re: Beej's Guide to C Programming (2007)

#31
post #28
post #24

As someone who currently works with C# - is there much of a point to learning C? I've always found it interesting, but never had a reason to jump into it.

While C remains the single most important programming languages of all time, its share of popularity is shrinking, giving way to C++, C#, Java, and Swift (from Objective-C). Nevertheless, I don't think anyone should call themselves a (true) programmer unless they know C. C is easy to learn, because it's a small language. If you are not new to programming, pretty much all there is to know is in the second edition of t…

> "Nevertheless, I don't think anyone should call themselves a (true) programmer unless they know C."

You could make an even stronger claim about knowing an assembly language. The point being that understanding how a computing device works is helpful in getting the best out of it. If that wasn't your point, then C is no more special than any other popular programming language.

Also, whilst I only know the basics of C, it's pretty clear things have moved on considerably since the days of K&R. It doesn't cover any of the enhancements included in C99 and C11, nor does it cover the tooling and coding conventions (the ones that help avoid problems) that have become commonplace since 1989.

For a more up-to-date reference, I've heard good things about 21st Century C:

http://shop.oreilly.com/product/0636920033677.do

Re: Beej's Guide to C Programming (2007)

#32
post #24

As someone who currently works with C# - is there much of a point to learning C? I've always found it interesting, but never had a reason to jump into it.

First, what is programming? Programming is basically writing out instructions with names, verbs, if/else's, and loops. The latter three are not much different in all languages, but names! The programs we wrote -- the style, details, and effectiveness -- depend on the understanding of entities behind those objects. For example, the name Michael, if we assume he is intelligent and equipped with common sense, we may cho…

I'm assuming you wrote this comment as a C programmer (or have used C in a professional setting?)

If so - how did you get into that? I'm really looking to _build_ something rather than just going through a book or tutorial (although they have a place and time). '

I suppose my objectives are learning as much as I can, and (ideally) having a day job working with that technology. All of this is more or less driven by interest and enjoyment of programming.

Re: Beej's Guide to C Programming (2007)

#35
post #8
post #2

Beej's Guide to Network programming ( http://beej.us/guide/bgnet/ ) is also pretty good. It was effectively used as the textbook in my networking class. (There was also an actual textbook, but almost nobody bothered to read it.)

Was there anything in the textbook that was explained better than in the Beej Guide?

I would wager the textbook probably covered history & development, various topologies, congestion control algorithms, queueing theory, etc. There is more to networking than programming sockets.

But for a guide on programming sockets, which is all it sought to do, yeah it's excellent.

Re: Beej's Guide to C Programming (2007)

#36
post #28

Earlier quoted context omitted.

While C remains the single most important programming languages of all time, its share of popularity is shrinking, giving way to C++, C#, Java, and Swift (from Objective-C). Nevertheless, I don't think anyone should call themselves a (true) programmer unless they know C. C is easy to learn, because it's a small language. If you are not new to programming, pretty much all there is to know is in the second edition of t…

> "Nevertheless, I don't think anyone should call themselves a (true) programmer unless they know C." You could make an even stronger claim about knowing an assembly language. The point being that understanding how a computing device works is helpful in getting the best out of it. If that wasn't your point, then C is no more special than any other popular programming language. Also, whilst I only know the basics of C…

Any modern introduction to C should make heavy use of Valgrind at the very least. In addition to catching the nastiest class of bugs C programs are heir to, it can be used to teach how memory works at a low level.

Re: Beej's Guide to C Programming (2007)

#37
post #32

Earlier quoted context omitted.

First, what is programming? Programming is basically writing out instructions with names, verbs, if/else's, and loops. The latter three are not much different in all languages, but names! The programs we wrote -- the style, details, and effectiveness -- depend on the understanding of entities behind those objects. For example, the name Michael, if we assume he is intelligent and equipped with common sense, we may cho…

I'm assuming you wrote this comment as a C programmer (or have used C in a professional setting?) If so - how did you get into that? I'm really looking to _build_ something rather than just going through a book or tutorial (although they have a place and time). ' I suppose my objectives are learning as much as I can, and (ideally) having a day job working with that technology. All of this is more or less driven by in…

> I'm really looking to _build_ something rather than just going through a book or tutorial (although they have a place and time). '

It might be worthwhile to start 'small' by taking one of your C# projects and converting some small section into a native/unmanaged C or C++ DLL that gets used by the C# side. There's a lot of boilerplate involved setting things up on both sides of the divide, but you can stay in a mostly familiar environment yet start learning about some of the 'magic' C# handles for you that is exposed by the unmanaged code, and extend your experimental forays into the C side as you get more comfortable.

Re: Beej's Guide to C Programming (2007)

#38
post #32

Earlier quoted context omitted.

First, what is programming? Programming is basically writing out instructions with names, verbs, if/else's, and loops. The latter three are not much different in all languages, but names! The programs we wrote -- the style, details, and effectiveness -- depend on the understanding of entities behind those objects. For example, the name Michael, if we assume he is intelligent and equipped with common sense, we may cho…

I'm assuming you wrote this comment as a C programmer (or have used C in a professional setting?) If so - how did you get into that? I'm really looking to _build_ something rather than just going through a book or tutorial (although they have a place and time). ' I suppose my objectives are learning as much as I can, and (ideally) having a day job working with that technology. All of this is more or less driven by in…

It will be a frustrating experience to learn C with a mindset of career. The mindset of career is about results, C is often not a shortcut to most superficial (visible) results. (It is a shortcut to real programming skill though, but a real skill without paper career record doesn't mean much for your career.)

But if you can afford a hobby and have the luxury of certain time at disposal, then I would suggest you to approach C as if you are picking up a leisure book. You learn more and enjoys more that way. You only need a day or two with a book or tutorial. Then you should simply start solving simple problems. If your math is OK, I would suggest project Euler. Programming is mostly common sense, you learn through practicing. Without the career mindset, you are very likely to enjoy the practice.

Now assume you acquired your career some other way (Java for example) and now you gained certain freedom in your job, and with the unique experence from C, you can try make decisions based on your understanding and common sense. I choose C in my work only because I have that freedom (but that freedom was not gained via C).

Post reply on HN