5 ms·
Soon this will be me - freshman CS student who will be learning C the second semester. A lot of people say it will be difficult, but there is a certain fun in
by gallerdude 10y ago
Soon this will be me - freshman CS student who will be learning C the second semester. A lot of people say it will be difficult, but there is a certain fun in building things from scratch.
- yarou 10y agoTake a look at K&R C, and work through the problems without looking at the answers. Though it's a bit dated, I'd still recommend it to anyone who wants to learn C.
- CardenB 10y agoAbsolutely agree. It's not a long book either.
- AdmiralAsshat 10y agoIt's not a long book, but it certainly isn't an easy book, either. I've been doing C for several years and some of the exercises still give me pause.
- kensai 10y agoYou can also get the answer book.
- acomjean 10y agoK&R = Brian Kernighan and Dennis Ritchie. The book is small and pretty good. I found it useful. C is a small language thus the book is small (I think they say something to that effect in the forward). Its book famous enough to have its own wiki entry: https://en.wikipedia.org/wiki/The_C_Programming_Language https://en.wikipedia.org/wiki/The_C_Programming_Language
- jstimpfle 10y agoIt's actually required if you want to write efficient software. Not saying it can't be done e.g. in Python, but you have to know what's going on underneath.
- BipolarElsa 10y agoI took C first and then Python. Would not recommend. Was like going from a Mountain to a Mole Hill. If it were the other way around, the Mountain would not have been as daunting. Just my 2 cents.
- mi100hael 10y agoThis is oft-repeated, but I don't really agree in most cases anymore. These days 90% of software like web application front ends & back ends, mobile applications, desktop applications, data pipelines, etc. are all written with some library in a language like Java, C++, Obj-C, Python, Ruby, or maybe Go. Arguably modern software is going to be more efficient for the vast majority of cases if the author sticks to the best practices for their chosen platform/library than trying to roll their own C implementation or tweak what's going on underneath. Writing C from scratch for anything other than an embedded device or low-level system library is probably ill-advised.
- jerf 10y ago"Java, C++, Obj-C, Python, Ruby, or maybe Go." If you want to write efficient software, which is certainly not always necessary, you're looking at a ~50x factor difference between the top and the bottom of that list, which even in this age of "let's just spin up another couple dozen instances" is non-trivial.
- mi100hael 10y agoSure, even within languages you can be looking at nearly a 50x difference based on things like framework & database choice. Hence my suggestion that raw language speed should not be a deciding factor for most projects these days. For example, look at the difference between the gemini-postgres and dropwizard-mongodb: https://www.techempower.com/benchmarks/#section=data-r12&hw=peak&test=fortune&s=1&l=9r6ek https://www.techempower.com/benchmarks/#section=data-r12&hw=...
- sn9 10y agoJust take Harvard's CS50x on edx. It's probably the best intro to programming online and primarily uses C. Depending on your university's CS program, it might cover the equivalent of 2-3 semesters' worth of material without feeling like drinking from a firehose. If you already know how to program, then you could just pick up K&R and work through it.
- Chromozon 10y agoHopefully you will be learning C++ and not straight up C. Modern C++ has pretty much solved all the shortcomings of C, and it's sad that people are still stuck learning archaic C for no good reason. If you are actually learning C++, do NOT even look at K&R C. It is extremely outdated and straight up teaches bad practices.
- protomikron 10y agoThat is definitely some kind of https://xkcd.com/386/ https://xkcd.com/386/ - moment for me. I totally disagree. I am not sure if your comment is satire or not, I would do it the other way around. Learn C as it is fundamental to modern OSes and just learn C++ if you have to (e.g. maybe later at a job, or because you need a specific library, like OpenCV). However I do not think that fully grasping C++ is a worthwile endeavor, as there are many things implemented due to historical and/or compatibility reasons (to C) and not because they provide a real benefit. Not that C is perfect but I consider it less fucked-up than C++.
- jjawssd 10y agoTwo totally different languages with two totally different use cases. Their use cases should not overlap if applied correctly. C++ is a very high level language compared to C. C++ has low level constructs which closely resemble C but should only be used for high performance implementations of high level abstractions.
- protomikron 10y agoYou are right, it is crucial to emphasize to beginners that these languages are different (and C++ not being some kind of add-on to C, which is - considering its name - a valid guess, but we have the same discussion with Java and JavaScript). But I think learning C, Python and JavaScript (and maybe some Java) to a degree that let's you get useful work done, is a lot simpler (meaning takes less time) than learning C++. Not that I would discourage anyone from learning C++ (ok, probably, I might) I just consider it a bad PL for people starting out with programming.