Jump to content

Good Place to learn C Language?


Auntie Mangos

Recommended Posts

This has been a question of mine for a while now. I want to get into programming, but where to start? I taught myself BASIC when I was 9... A software engineer that I respect who use to work for Google told me to start with C as everything else (Java, C++, C#, Objective-C, etc) bows to it's syntax. Most people seems to say just skip C and dive into C++. Yet another person is telling me to skip C++ and head towards C#/mono. I want to be a wide-spectrum programmer, able to generate code for Windows, Linux, and Mac OS X. (Way off topic here) my eventual goal would be to create an open source software virtual instrument rack patterned after Propellerhead's Reason, since there really isn't any linux/open source equivalent. Thoughts?

skinlayers

Link to comment
Share on other sites

Skip C, go into C++, its better to learn object-oriented concepts earlier on, and most of the C-specific stuff you aren't going to use regularily. Going from C to C++ is quite the leap, because you have to learn all the object-oriented stuff, but going from C++ to C# or Java is easy, because for the most part they are the same thing but with some complicated stuff removed (pointers are non-existant, automatic memory management, etc.)

Link to comment
Share on other sites

This has been a question of mine for a while now. I want to get into programming, but where to start? I taught myself BASIC when I was 9... A software engineer that I respect who use to work for Google told me to start with C as everything else (Java, C++, C#, Objective-C, etc) bows to it's syntax. Most people seems to say just skip C and dive into C++. Yet another person is telling me to skip C++ and head towards C#/mono. I want to be a wide-spectrum programmer, able to generate code for Windows, Linux, and Mac OS X. (Way off topic here) my eventual goal would be to create an open source software virtual instrument rack patterned after Propellerhead's Reason, since there really isn't any linux/open source equivalent. Thoughts?

skinlayers

Go for ASM if you need low level embedded non-portable programming.

Go for C if you need "somewhat" portable code and want to have control _how_ your program actually does things. C is generally good for system-level programming, I say it's a good compromise between assembly and high-level languages. If you turn off all compiler optimizations, you can write all the functions, variables, structures (almost) exactly the same way they'll appear in the final executable.

Go for C++ if you need higher-level portable programming and OOP style. Some people say it's "an extension" to the C language, they also say it's "not really a good way to extend C". C++ could indeed have better design and syntax specifications, but anyway - it's the most common language today (imho) and that's what counts. You can use C-like variables and structures in C++ to some degree. With C++ comes great responsibility for code concept, you can do MUCH more things in MUCH more ways than in C, which can result in a total code crazyness - don't forcefully use everything C++ offers just because it compiles fine.

Go for C# if you .. well, I can't really say. Many people warn about Microsoft's claims on intellectual property in relation to mono. On the other hand - it *might* be a good language for Windows-only apps, I haven't really tested that. Don't expect to get the same portability as with C++.

Go for Python/Java/Perl/whatever if you want ultra-portable code and true high-level syntax. Many people use Python with PyGTK to make nice GUI apps without having to fight the low level issues. Some guys here might say "naah, those high-levels are WAAAY too slower than C++". Yes, they're right. But the slowdown isn't really noticeable in common applications. It's even less noticeable when it comes to PyGTK/PyQt as the same graphic lib gets used anyway.

Link to comment
Share on other sites

C# is yet another attempt by Microsoft to push C++ out the door and co-opt the nearly universal status of that programming language. They tried the same thing with Java and ended up being bitch-slapped by Sun. Unless you're a slavish devotee of Windows, try to avoid any proprietary stuff like C#, DirectX, and so on. Stick with open source as much as would be practical. This leaves you free from being tied down by commercial libraries and APIs, not to mention allowing you to code your own updates as needed instead of waiting for them.

As for your choices of which language to pick, keep in mind that C++ requires a lot of structure and planning, like the once popular Pascal (Delphi, if you're a Borland fan.). If you don't take time to at least make a rough outline of your project, then you'll quickly find yourself in trouble. Such order does bring more stability, but it also restricts you where free-form coding styles are concerned.

If you want to "hack code" on the fly, then C would suit you better. It can be more powerful than C++, but you also have to be more careful with your code to prevent memory leaks, infinite loops, and erroneous logic, for example. Greater control and flexibility in any programming language means more responsibility burdens the coder to keep his own house cleaned up, instead of having the safety nets built into other languages. I think the supposed "need" for those nets, because it supports sloppy coding and stifles great programmers, merely allows lazy developers to pretend they're great and promotes mediocre coding standards.

If you want control over virtually every bit and byte, creating software that can make use of an OS or hardware with nearly unlimited freedom, go with Assembly. Portability is very limited, usually based on CPU type, and would require several different versions of the same program, not to mention all the bugs needing squashed are multiplied by the number of differing platforms for which you're coding.

Java is touted as the "universal" programming language for its supposed cross-platform compatibility but that is not as often true as its promoters would have you believe. Java is also infamous for being a clunky resource hog that, typically, requires far more CPU power and memory to do the same thing than a similar program written in C, C++, or Assembly. I believe that the opening of the Internet to the general public, and its commercialization, then the recent Web 2.0 and advent of Ajax saved Java from oblivion. Otherwise, it would have died off with the likes of Forth and COBOL. It's still popular with web developers, though.

It does seem almost everyone uses C++ these days, but some say that's only because it started as a fad that had good promotion and hype. And we all know how susceptible to hype and fads the geeks can be! However, the thing to consider is the technical merits and limitations of each programming language because programming is a very technical endeavor. Choose the one that best suits your project's needs. Programming languages are tools. You wouldn't want to use a wrench to tighten a screw anymore than you'd want to code a website in Assembly. Learn as many as you need or would like. Just like any good craftsman, you'll want several tools to handle different tasks.

Real artistry in programming comes from having an almost intuitive affinity for the language with which you are working to create a program. You may wish to stick with just that one, if you're coding for fun.

For an open source alternative to Reason and Fruit Loops, C++ will likely be your choice simply for the fact that its popularity means there are literally thousands of libraries and code snippets available online that you can use in your project. Take a good look at Audacity, the open source community's answer to Sound Forge, for ideas and inspiration.

Link to comment
Share on other sites

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use