|
On May 14 2012 06:29 MaGariShun wrote:Show nested quote +On May 14 2012 06:17 Anacletus wrote:On May 14 2012 06:15 og8456 wrote: You really should go for C++ and not C, C is really outdated! ^_^
/Just my opinion! This could not be farther from the truth. It's from 1970. That alone should probably tell you that it's outdated Is it still widely used and has its own niches where it is best? Absolutely! Does that make it a good modern programming language? Nope!
C has been updated since then. And saying C is outdated means it's obsolete - it most definitely is not obsolete as it is still widely used today. I feel like I'm just arguing semantics, but dammit C is NOT outdated no matter how old it is!
|
On May 14 2012 09:12 Anacletus wrote: And saying C is outdated means it's obsolete
I never said it's obsolete, because it isn't. Its concepts and design are outdated. Sure, you can do most of the stuff you do in modern languages, but basically everything is a hack (error codes instead of exceptions, class-like structs with function pointers etc.)
I mean, if you are not programming on low level (be it hardware or the OS) stuff or desperately need that last bit of performance, there really is no need (or incentive) to use C. You could, no question there, but why would you go through all that extra hassle?
I understand you are a fanboy, but cmon!
|
On May 14 2012 10:36 MaGariShun wrote:Show nested quote +On May 14 2012 09:12 Anacletus wrote: And saying C is outdated means it's obsolete
I never said it's obsolete, because it isn't. Its concepts and design are outdated. Sure, you can do most of the stuff you do in modern languages, but basically everything is a hack (error codes instead of exceptions, class-like structs with function pointers etc.) I mean, if you are not programming on low level (be it hardware or the OS) stuff or desperately need that last bit of performance, there really is no need (or incentive) to use C. You could, no question there, but why would you go through all that extra hassle? I understand you are a fanboy, but cmon!
I'm more of a C++ fanboy (mmmm dat performance, am I right?). I'm just not going to let you guys get away with spreading misconceptions about C!
|
This thread makes me sad. The OP comes out knowing what he wants to learn and asking for help learning it, and what does everyone tell him? Their own opinions on what he should learn instead? Come on... there are other perfectly good threads for that.
OP, I see CecilSunkure linked his series of intro-to-C-programming tutorials above, and they're decent.
The original book on C, Kernighan and Ritchie's The C Programming Language is still considered one of the best references on the subject, although I'm not sure of its suitability for a beginner. It's a little expensive but you could probably find it, or parts of it, online if you looked. Of course you do want the second edition, the original is a bit dated but the 2nd ed covers ANSI C which is basically the lowest-common-denominator of what all compilers support these days.
The folks who frequent Freenode's ##c can be a bit off-putting for someone who just wants a simple question answered (and rightly so; they're busy people) but if you have a specific, carefully-worded question to ask they will always have the correct answer (and a citation from the standard to back it up). Their wiki also has some good links to useful resources.
Finally a bit of my opinion to leave a sour taste in your mouth. C is a lot of fun to program in once you've done it for a while and have stopped making the common mistakes. It's unforgiving: you have to be both precise and accurate in what you're telling it to do; if you just sort of fake it (which you can get away with in some languages) you'll find that it actually causes the most frustrating problems.
BTW, you may or may not (I don't know what's installed on Macs by default) already have a great reference for the C standard library installed, in the form of manual pages. When you're not sure what a command or function does, instead of going straight to Google, try opening a terminal and typing 'man command' (without the quotes). As an example, check out the web-based version of the manual page for printf(3).
|
For beginners, the objective is to learn HOW TO CODE, not how to use whatever language is the favourite this month.
Personally I would start with something that has strong string parsing like PERL or Python as trying to battle compilers while designing algorithm is not fun at all.
With that being said, C is still very influential, Java, C#, Objective C all derived their syntax from C, but seriously though, Syntax and Keywords should be the least of your concern as a programmer.
|
On May 05 2012 20:02 adwodon wrote:Show nested quote +On May 05 2012 06:40 olabaz wrote:On April 26 2012 06:11 adwodon wrote:On April 24 2012 06:11 olabaz wrote:So I also recently decided to learn C and have been learning for a couple of days now. The book recommended by MIT as well as a bunch of other legitimate sources seems to be C Programming Language. I looked into this book and did not really like that they didn't give the main function a return value. I then found out about another book that is widely accepted called C Programming: A Modern Approach and I really like the way it is written and laid out so far, and it is what I'll be using. A larger list of books can be found here. I was told by a lot of people not to learn C but I feel like it'll be a fun exciting language that will help me in the my future studies of physics. Haters gonna hate! I was one of the better programmers when I did my MSc in particle physics, not that I could have a valid opinion... C will not help you in physics, it will probably just hinder you, but you've obviously been told this and think you know better. Most physicists stuck with FORTRAN for the most part, they're switching over to C++ with a lot of the larger collaborations (event generators etc) because OO is too useful. If you're serious about physics over programming you'll not need to go in depth with anything, just learn Java then C++ and some scripting languages, as well as how to use Unix and you'll be fine, you'll learn what you need when you need. As people have said, C is for low level things, learning it will serve no purpose in the physics world and you'll simply have to erase bad habits when you learn a more appropriate language. C is not useless for physics... Care to elaborate? If you want to learn physics, learn physics, don't add complex programming languages on top of that. You'll have a much easier time, and find it easier to apply something like Java to a physics undergrad course. I'm sure you can find some use for C, but I've never come across a physicist in academia that uses C, it's not the ideal language and most physicists want to do physics, not programme, but if you think you can somehow squeeze 8 extra hours out of each day to double up your discipline then go ahead. Why not just do a Computer Science degree? Don't say I didn't warn you. I agree that C isn't required to learn physics and neither is programming but, isn't that obvious? They're different fields but that doesn't mean they're mutually exclusive. Many of today's popular programs used for numerical computations were written in C like MATLAB, Mathematica, and Maple. Now sure you can learn to "program" in those but that code doesn't carry over to other languages and of course they're not as powerful until they're combined with C or another similar language.
|
I think it's a good idea to learn C. C is the rolemodel for most programming and C++, C#, objective-C and even Python are all derived from C since it's such a common language, if you know C, you should feel at home in most languages since constructs, key words etc were often taken from C.
Problem though, C is not all that useful anymore. If you want to code something very heavy, you'll probably use C++ instead since C++ is a superset of C, it does everything C does and a TON more (which is why C++ is a shitty language, it's just a big mix bag of poop and candy, to eat the candy, you'll still need to put poop in your mouth). If you want to code modern applications, you'll use C# or java instead because the control and speed you get from C/C++ is not all that relevant on desktops/laptops today, not even on cellphones. Atm, I don't think pure C is used much outside of operating systems, both for PCs and machines.
I definitely think you should go ahead and get a good C book though. Learning C is a good investment since it teaches a lot of the concepts of programming without added abstraction. You can learn proper object oriented programming etc later on, when you know how loops, variables and such work.
|
On May 14 2012 18:32 Tobberoth wrote: I definitely think you should go ahead and get a good C book though. Learning C is a good investment since it teaches a lot of the concepts of programming without added abstraction. You can learn proper object oriented programming etc later on, when you know how loops, variables and such work.
You can learn the basics in just about any language, it makes absolutely no difference at rudimentary level. A loop is a loop in C or ruby.
Coding is about problem solving. Solve the problem first then start coding.
With that being said, it isn't immediately clear what OP's goal is, if application programming is the goal then C is perhaps not the most efficient starting point however C is a very influential language both in design and usage.
If OP only need a basic level of programming knowledge to compliment his degree then he should invest time into what ever tool his field uses e.g. Python is used for a lot of science projects, lisp in AI research...
|
United States10328 Posts
If OP has no experience programming, I think Python is a pretty gentle introduction to "thinking like a programmer." It does provide lots of really nice (though a bit slow) high-level stuff that a lower-level language like C won't; list comprehensions and dynamic typing come into mind immediately. But Python is intuitive enough that we have an annual "Python spelling bee" at our school each winter, where contestants have to dictate (easy-ish) Python code without looking at a screen...
N.B. "low level" means "more control over the fine workings of the computer," whereas "high level" means "more large-scale, abstract tools." Both have their uses, and often higher-level languages [e.g. Python] are built over low-level languages [e.g. C]. C will help you learn a bit more about the workings of the computer--pointers, memory allocation, etc. Supposedly learning C helps you learn the huge plethora of C-like languages rather quickly. But again, if you've never done any coding, I think a higher level of abstraction will benefit you a lot.
Also, I feel like Java is a very... overburdened (???) language, in that it forces huge amounts of verbosity everywhere, since Java code is often meant to be enterprise code (or just shared development in general.) It's sort of a compromise between C and Python in terms of how much nice stuff it does for you automatically (garbage collection, object-oriented stuff, etc.)
Edit:
On May 05 2012 18:35 Abductedonut wrote:huge post on C Oops, if OP really just wants to learn C, this post on page 3 seemed pretty decent.
Edit2: Wow I suck at reading threads, woo!
Anyway, to practice (and if you like math/algorithms), you can consider doing things like USACO training, TopCoder, and Project Euler. (Don't have to compete in the contests; just do the practice problems for fun!)
|
|
|
|