[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Home]
4chanarchives logo
Is R&K still the best way to learn C? Are the new things
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /g/ - Technology

Thread replies: 71
Thread images: 6
File: c_prog.jpg (103 KB, 767x991) Image search: [Google]
c_prog.jpg
103 KB, 767x991
Is R&K still the best way to learn C?

Are the new things in C since the second edition worth learning/important?
>>
>>54380678
C Primer Plus - Stephen Prata.
>>
>>54380678
>R&K
>R&K.
>R & K
>R AND K
>>
>>54380698
I did this. Do this.
>>
>>54380701
Shit now I feel like a retard.
>>
>>54380723
You are, but it's alright.
>>
>>54380678
>R&K

I feel strange
>>
>>54380678
C is a very small language. You can learn anything about it in less than a week, but you can learn anything about Scheme in an hour. You should start by "Structure and Interpretation of Computer Programs".
>>
>>54380698
This.

Or C Programming: A Modern Approach by K.N. King if you are getting a little impatient as it's tad more brisk, but still comprehensive.

I use both.
>>
>>54382173
>You can learn anything about it in less than a week
>very small language

It isn't a "very small language", it's relatively small. You're misunderstanding the difference. The C library can't be "learnt" in less then a week, there's still a bunch of functions to understand how to use safely. Then there's the rules of syntax in a multitude of areas.

It's RELATIVELY small, not "very small".
>>
C is stupid easy. Being a code guru now, the only thing I haven't really gotten into much is meta programming and advanced optimization techniques, which you really don't need need unless you want to show off.
>>
>>54383451
>Being a code guru now

But you're not.
>>
>>54383489
More of a guru than most people.
>>
>>54383506
That's like saying you are the smartest retard.
>>
>>54383506
>More of a guru than most people

You're not a guru. You have a basic knowledge of certain areas of programming and you feel smarter than you are. Try to give advice without pretending that you're some kind of genius.
>>
>>54383537
Society is ran on retards now, who would've thought
>>
>>54383597
you can suck my pretentious dick.
>>
>>54383622
I'll be willing to do that if it'll shut you the fuck up.
>>
>>54383631
less talking more sucking, anon.
>>
So K&R or C Primer Plus?
>>
>>54383716
K&R and Oreilly understanding c pointers
then a C data structures book
Then Advanced Progamming in the Unix Environment.

See ya in 18 months.
>>
>>54382173
fucking shills I tell ya
>Guys I wanna learn C which book should I...
>Learn Scheme, read SICP!!
>>
>>54380678
>>>/r9k/
>>
>>54383716
K&R only took me two days. Then, just practice and Google-fu.
>>
>>54380678
>R&K
Were you dropped on your head as a child?
>>
books recommended here: http://fabiensanglard.net/c/
>>
>>54380678
The book by King-sama is gud too senpai
>>
>>54383649
Get out the feminine penis then. Ante up, faggot.
>>
I have to learn C++ for work purposes, is the best approach to learn C and then C++, or do I learn C++ straight-away?
>>
This guy says it is

http://fabiensanglard.net/c/
>>
>>54386589
I'm assuming you already know enough about programming and this isn't your first radio. Either way, I'd start with C++ though.

Imo C++ is still functional and useful in the future, while C is becoming more and more depreciated. I just personally feel it is better practice to learn C++, and if you find something in C++ that C does better ,than it's an easy thing to add in your project. Although I find those things are far and few in between.
>>
>>54386589
Learn C because C is easier, smaller, and more useful. C++ is only useful for taking money from the wallet of fools (i.e. Windows programs)
>>
>>54386589
How much do you know about encapsulation, inheritance and polymorphism?
>>
>>54380698
well this. One of the best books up there.
>>
>>54380678
learn modern C++ ffs
>>
>>54388377
>the modernity meme that things made in 2016 are always better than things made in 2015
>>
>>54388377
>>54383359
>modern
>C
>modern
>>
As a non-programmer, I've found both >>54383359 and "Programming in C" by Kochan immensely better than K&R. K&R just throws meaningless terms at you without bothering to explain them in any meaningful way, it's not clear in its explainations etc. etc. As something to teach you, it's grossly overhyped and prime proof that someone who's good at designing something might not at all be adequate to teach others about the system.
>>
>>54388456
That's probably just personal preference.
I like dense things, no matter what the topic, so K&R C was fun, enjoyable, and useful for me.
>>
>>54386589
Learn c++ there really is not point in learning C first because everything you're gonna need from C is built right into c++. It's not necessary to learn C at all to learn C++ I would suggest thinking about them as two completely separate languages even though they are not.
>>
File: windowsxp.jpg (83 KB, 600x400) Image search: [Google]
windowsxp.jpg
83 KB, 600x400
>all of these people trying to get OP not to learn Unix's official programming language
>>
Is it possible to write high end game engines like CryEngine or Unreal in C?
>>
>>54388545
All languages compile to the same assembly which runs on the same physical hardware. Therefore, you can do anything with any language, provided the language doesn't explicitly prohibit you from doing something.
>>
>>54388572

C explicitly prohibits you from having sex
>>
>>54388581
But I had sex in February.
>>
File: images.jpg (51 KB, 547x681) Image search: [Google]
images.jpg
51 KB, 547x681
Best book coming through.
>>
>>54388456
Programming in C has some mistakes, however. I noticed early on that he didn't distinguish the difference between a prefix and a postfix operator. He says that it's "just a matter of personal preference" and didn't mention the precedence of them at all or what they're used for.

At that point, I began to doubt the book. I'm only a beginner and even I know there's a difference between prefix and postfix.
>>
>>54388430
That's why it says a modern "approach", you illiterate retard.
>>
>>54380698
First time I've seen someone other than myself recommend it. Great book, highly recommend, OP.
>>
>>54390826
99% of the time it doesn't make a difference at all.
>>
>>54393556
But there's a difference, that's the point. The writer made no distinction and that could lead to bad habits forming. Thus, it's poor writing and poor guidance.

Bearing in mind the nature of algorithms, using a postfix increment instead of a prefix could fuck up the intended computation completely. Off-by-one errors galore.
>>
>>54383890

Exactly this. C is a language without a lot of built in hooks for interacting with the OS. It relies heavily on libraries to provide those functions. C will teach you the logic, APITUE will teach you how to interact with your system.
>>
so, is it outdated?
>>
>>54383890
Should I just read K&R or should I be taking notes and running code examples, etc. ?
>>
>>54397926
You should read the K&R
then you should be running some form of a UNIX system with access to man pages
I personally have all the man docs installed and a copy of the GNU libc manual for reference.
C it self is very simple, its when you interact with anything or want to do anything useful it gets complex

oh and btw alot of the examples can be hard to follow in the K&R book
>>
>>54397926
>>54397984

I feel retarded I didn't answer your question
Programming is alot like math or any skill really in that you learn by doing.
You should be doing all the examples and rewriting them (NOT COPY+PASTING & RUNNING THEM)
and then also try to understand what the code is doing instead of blindly copying it.

then you should find a project you are interested in and try to understand the code base
and maybe even contribute to fix bugs that you think you can fix.
>>
>>54398064
Contribute to a project that is already in motion? I've never heard of such a thing. Where do these things take place?
>>
File: 0673999866.jpg (162 KB, 500x648) Image search: [Google]
0673999866.jpg
162 KB, 500x648
>>54380678
there are much more advanced and better written C books for beginners
>>
File: Clipboard01.png (134 KB, 739x962) Image search: [Google]
Clipboard01.png
134 KB, 739x962
>>54390826
>>54395460
this. it's unacceptable. just get a better book
>>
I'll have to check some of these out. I mean, I have a basis on C/C++ but other than Shell scripts I really only use Python.
>>
>>54398642
Which book is this from?
>>
>>54399079
Pointers on C
>>
>>54380701
what? explain yourself, computer-man.
>>
File: 90s.jpg (75 KB, 720x490) Image search: [Google]
90s.jpg
75 KB, 720x490
>>54383649
>>54383631
>>54383622
>>54383597
>>54383506

>literally arguing like children on an image board in [current year] like it's [current year - 20]
>>
>>54380678

You should definitely interact with K&R. After you learn what's in it, you can add to it.
>>
>>54399150
what was 4chan like 20 years ago?
>>
>>54399190
shit
>>
>>54399150
>bothering to reply to the argument and even attach an image when it's allegedly below you
>>
>>54388545
no, not unless you want to write C wrappers for those engines. in general, there's a reason they use c++: C is an absolute nightmare to do high-level graphics work with.

also kill yourself you fucking "i just wanna make games bruh" retard
>>
>>54399584
>tells someone to kill themselves based on an assumption made based on one post

You're extremely unhinged. Seek help.
>>
>>54399642
where do you think you are?
Thread replies: 71
Thread images: 6

banner
banner
[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y] [Home]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.