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

Is this still the number one book to study to learn C? Some fags

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 45
Thread images: 2

Is this still the number one book to study to learn C? Some fags say this is too old to be used for anything 'modern'
>>
>>61389948

I recommend C Primer and then this. Or rather read them along side each other.
>>
Just read it faggot, it may not be "modern" but it's the best foundation possible.
>>
It's a good book. Of course, you can also learn C by writing programs or reading through source code and trying to understand it.

What are you going to use C for?
>>
>>61390031
Studying Linux
>>
I wanna learn device drivers and kernel development. Am sick of the flavor of the week
>>
Is C still the most important language to know for anything related to netsec and OS sec?
>>
>>61389948
I don't even know it, but if it recommends or shows how to implement linked lists it's shit.
>>
>>61390522

Can you give a little explanation why that's bad?
>>
>>61390005
bruh
>>
>>61390522
>if it recommends or shows how to implement linked lists it's shit
>>
>>61390522
wat
>>
>>61390043
Do you have an unsupported flash drive in this day and age?
>>
>>61391538
?
>>
>>61391904

he's implying you need to write a driver for a device that's unsupported and that's why you want to learn C
>>
OP go suck a dick and learn something useful like Java
>>
>>61390522
> Doesn't know the DEFINITIVE c book
> must be shit if it recommends any data structures
So all Computer science, Electrical engineering and some physics degrees are shit because they have a data structures component?
>>
try writing a c program if you want to learn c

novel i know
>>
>>61390618
>>61391306
>>61391524
>>61392845
>So all Computer science, Electrical engineering and some physics degrees are shit because they have a data structures component?
No, all CS, EE and some phajeet degrees are shit because they don't tell them to use preallocated dynamic arrays instead which leads to C repositories being riddled with slow linked list implementations.
>>
>>61393050
This literally never happens you faggot. Nobody uses Linked Lists nonetheless rolls their own.
>>
>>61393050
>>61393558

The problem isn't bad linked list implementations, the problem is that linked lists are themselves inefficient and despite being babbies first data structure actually should only be used very very rarely.

Depending on what type of programming you do you may not EVER need to use a linked list.
>>
>>61390493
Yes.
>>
>>61389948
It's definitely a good place of reference. There are a few places that don't show modern code. For example, in section 1.1:

#include <stdio.h>
main()
{
printf("hello, world\n");
}


Compiling that code with gcc throws a few warning but it still executes.

Despite that, I think it is a good starting point to introduce you to a bunch of topics. Plus, if you are lazy, you can just google for the book and find a PDF version. No reason not to start with it.
>>
Why is C so hard to learn compared to Python and Java? Python has ten million free books and websites that are easy to use, fun to read, and if you get bored or stuck, you can just go somewhere else to learn the same thing. C, meanwhile, has maybe three shitty websites that are poorly designed and keep trying to shill C++ instead in the classic, "How do I do X?" "Lol why do X? Do Y instead! Thread locked" bullshit, and if you want something you can read offline, the books are all Stallman-tier unreadable crap that are all theory and no examples, so you never actually learn anything.

Why does the Internet hate C?
>>
>>61395492
They're brainlets, that's why
>>
>>61395492

protip: most online resources are complete shit and just a waste of time. Buy actual books. O'reilly has plenty of books for learning C.

If you think you actually learned a programming language from a hodge podge of random tutorials online you are probably mistaken and don't know the language anywhere near as well as you should.
>>
>>61395492
Many modern programmers are used to lots of layers of abstraction with their programming languages nowadays. Nobody wants to think about an actual solution for a problem, they just want to stitch together libraries in high level languages and call it a day.
>>
>>61395492
>Why does the Internet hate C?

memory management
>>
>>61395588
fkn this, sometimes videos are useful, but for leaning big stuff like frameworks or lenguages the official documentation or books are the way to go
>>
I throw C under those programming languages like python you learn and never use but sets you up for the second language which is the one you'll be programming in for a long time.
>>
>>61395963
python is useful, wtf are you talking about? every major website and even scientific developers use python so stfu
>>
>>61389948
Step 1: Read K&R, realize the style of declarations used in it won't be used today but it still is the definitive resource on how to read a declaration/bracket order operations ect.

Step 2: Read these lecture notes, slides/additional resources http://www.cs.cmu.edu/~15122/schedule.shtml

Step 3: Watch these lectures, read the course book (click on 'old lectures') https://www.cs.cmu.edu/~213/schedule.html

Step 4: Read this modern C guide https://matt.sh/howto-c

Final step: Read this and use for reference http://www.cert.org/secure-coding/publications/books/cert-c-secure-coding-standard.cfm?

That's all you need. K&R will teach you what is undefined behavior. 15-122 will teach you to write safe programs and how to analyze existing programs. 15-213 will teach you what C looks like at the assembly level, stack frames, two's complement representation, floating point ect. That 'How to C in 2016' guide will teach you how modern C is written to avoid classic C problems like throwing around char's and ints. The CERT guide is a good desktop book to have around to make sure the shit you are writing cannot under any circumstances lead to undefined behavior. Whatever project you decide to contribute to after doing all this to obtain base competence in modern C programming, they will have a contributor's style guide which you must read like the kernel.org style guide or OpenBSD man style
>>
>>61395492
Java abstracts away the shit in C. Java devs never have to deal with pointers. Java devs never directly deal with memory management. Getting the JDK and an IDE setup going is stupidly simple compared to getting gcc or whatever going for C. Probably other reasons too but that's what I can think of off the top of my head.

That doesn't mean Java is better than C, it just means it is easier to work with.
>>
>>61389948
>this is too old to be used for anything 'modern'
C is old already, anything after ANSI C is bs.
>>
C Programming A Modern Approach by King is good.
>>
>>61395963
>>61396430
Is C really that uncommon or mostly a meme?
>>
>>61389948
Read it, nothing is better.
>>
>>61396709
it's not uncommon at all. I have been working in the industry for a long time and managed one country wide server project and one AV engine for a major AV company. I coded in C all the time with an exception of python for simple scripting.

in systems programming, it's still the norm.
>>
>>61396709
C is still everwhere, it's legacy. Even Kernighan doesn't use it anymore if he can avoid it. You will often find it these days in a library with wrappers in another language or careful API to prevent the quadrillion problems that have happened over the years. You should still learn it and how it is translated to assembly just for legacy reasons as something you own still is powered by The Eternal C.
>>
>>61396786
And those AV engines are exploited routinely because of it, it's like installing a backdoor for anybody to jack your system.
>>
C is just good to know full stop-
It forces you to learn about stuff higher level languages gloss over, like passing by reference or value.
>>
>>61396822
many people ignore 40 years old practices and be smartass, that's the real reason here. I don't say C is a safe language, your code can exploited in many ways, maybe because of an external library you use, but you can minimize the possibility.

Every C programmer should read 'Writing solid code, Maguire' in every six month, but i don't know any.

Also 'Practice of programming, Pike, Kernighan' at least once a year. People are lazy.

I do my programming mostly in Go these days and avoid C as much as i can, but it still has use, mostly for legacy reasons though.
>>
>>61397018
Pajeet detected.
>>
>>61397168
>pajeet
>C
>practices

did you really have to work with a pajeet or are you just shitposting, maybe you are a pajeet?
>>
>>61397018
They do, but also it's just trying to keep track of state in millions of lines of code and portability. "This cast to X is now a cast to Y on this architecture" type things. Like the dreaded arithmetic VS logical bit shift that has fucked up many portable programs.

C was great when there was just a few machine targets, and you could reason about a single program that only had a few hundred lines instead of 17million+ lines like today.
Thread posts: 45
Thread images: 2


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

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
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.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.