By using this site, you agree to our Privacy Policy and our Terms of Use. Close

Forums - Gaming - Can I learn rudimentary programming from a book?

Plaupius said:
C and C++ are related in such a way that C is a subset of C++, meaning that a program written in C should compile also using a C++ compiler. They share the same basic syntax with C++ having a number of additions over C, but most of programming IS basic syntax, so if you learn C++ you definitely learn C as well.

For ease of learning, though, I would recommend Java. The basic syntax is still the same as C, but you don't have to worry about memory management, pointers etc. and you'll learn objective oriented programming. Just make sure you don't get stuck on Java, learn the basics there and then move on to C or C++ (or even objective-C if you'd like to try OS X or iPhone programming). Learning just Java will lead to some poor coding habits, so it's good to move to the C-family to see what is going on under the hood, so to speak.

So, in a nutshell: Java, C++ and objective-C all have the same basic syntax that is based on C.

Not true, you can write perfectly legitimate C programs which will not compile on a C++ compiler. That said, *most* C programs will compile with a C++ compiler.

For the OP, I'd suggest starting with something like C++ or Java or perhaps Python to get the basics of programming. If you are interested in a career however, I'd heavily suggest moving onto something lower level (C/C++ or Asmembly depending on how keen you are) for at least a small project to get a good understand of how things work under the hood. I'd also suggest picking up a book on computing algorithms (even if you are just sticking to it as a hobby). I've seen way too many "Java graduates" who can write code, but have no concept of what their code actually does, which leads to some attrocious code.

If you decide you are just in it as a hobby, feel free to stick with the hand holding langauges



Around the Network

In my experience OO languages encourage practices which are terrible from a performance point of view, but great from a code maintenance and RAD point of view. What you want to learn depends on what you want to do.

If you decide to learn C I would recommend either an O'Reilly book (usually my first stop when I need to learn a new language) or the original K&R book.



If you want something easy to pick up, just to get the feel of programming logic, I recommend Dark Basic Pro. Good entry language, allows you to create apps and games, even games reliant on DirectX 9. Plus its very cheap to acquire.



I started teaching myself to program from books/online tutorials when I was probably 11. Its not hard to do at all. By the time I got to college, it was more of a refinement of proper coding techniques and theory.

C is a procedural language, C++ is the object oriented language of C. You will eventually want to learn C++ so I would just start with that. The basics are the same between the two languages, and basically if you can write complex functions in c++ then you can code in C.

Java or C# is OK but I would NOT suggest starting with it. In my opinion it teaches you lazy programming techniques that will kill you if you move to C++. Its much easier to go "Oh yeah, I don't have to free this memory" than have memory leaks all over the place.



I am a Gauntlet Adventurer.

I strive to improve my living conditions by hoarding gold, food, and sometimes keys and potions. I love adventure, fighting, and particularly winning - especially when there's a prize at stake. I occasionally get lost inside buildings and can't find the exit. I need food badly. What Video Game Character Are You?

Mega Man 9 Challenges: 74%

Waltz Tango Jitterbug Bust a move Headbanging
Bunny Hop Mr. Trigger Happy Double Trouble Mr. Perfect Invincible
Almost Invincible No Coffee Break Air Shoes Mega Diet Encore
Peacekeeper Conservationist Farewell To Arms Gamer's Day Daily Dose
Whomp Wiley! Truly Addicted! Truly Hardcore! Conqueror Vanquisher
Destroyer World Warrior Trusty Sidearm Pack Rat Valued Customer
Shop A Holic Last Man Standing Survivor Hard Rock Heavy Metal
Speed Metal Fantastic 9 Fully Unloaded Blue Bomber Eco Fighter
Marathon Fight Quick Draw G Quick Draw C Quick Draw S Quick Draw H
Quick Draw J Quick Draw P Quick Draw T Quick Draw M Quick Draw X

I recommend starting with C or C#, Java is a horrible mess. If you learn C, you can learn almost anything else because you'll learn how a computer really works at the same time.

C# is easier to learn than C, it should be a much easier introduction. The only disadvantage is that it's not as multi-platform as Java.

Having said that (and feel free to ignore the next two paragraphs until later):

The most important part is that you learn the logic behind programming, which will allow you to learn new languages faster and easier. The end objective should be to think about programming abstractly, rather than focusing too much on a single language.

After you have learned some programming and solved some small-medium size programming problems, I recommend you get an "algorithms and data structures" book to get into the really important part of programming... but you can always come and ask questions about that later.



My Mario Kart Wii friend code: 2707-1866-0957

Around the Network

I myself learnt programming from python, it's the best language to get you started imo



Initiating social expirement #928719281

I recommend going and taking a very cold shower every time you have the urge to learn to program.

Repeat until said urges go away.



Katilian said:
Plaupius said:
C and C++ are related in such a way that C is a subset of C++, meaning that a program written in C should compile also using a C++ compiler. They share the same basic syntax with C++ having a number of additions over C, but most of programming IS basic syntax, so if you learn C++ you definitely learn C as well.

For ease of learning, though, I would recommend Java. The basic syntax is still the same as C, but you don't have to worry about memory management, pointers etc. and you'll learn objective oriented programming. Just make sure you don't get stuck on Java, learn the basics there and then move on to C or C++ (or even objective-C if you'd like to try OS X or iPhone programming). Learning just Java will lead to some poor coding habits, so it's good to move to the C-family to see what is going on under the hood, so to speak.

So, in a nutshell: Java, C++ and objective-C all have the same basic syntax that is based on C.

Not true, you can write perfectly legitimate C programs which will not compile on a C++ compiler. That said, *most* C programs will compile with a C++ compiler.

For the OP, I'd suggest starting with something like C++ or Java or perhaps Python to get the basics of programming. If you are interested in a career however, I'd heavily suggest moving onto something lower level (C/C++ or Asmembly depending on how keen you are) for at least a small project to get a good understand of how things work under the hood. I'd also suggest picking up a book on computing algorithms (even if you are just sticking to it as a hobby). I've seen way too many "Java graduates" who can write code, but have no concept of what their code actually does, which leads to some attrocious code.

If you decide you are just in it as a hobby, feel free to stick with the hand holding langauges

I was half expecting this to come up. Yes, you are right, and that is why I put the "should compile" there instead of "will compile". If one wants to learn an OO extension that is 100% ANSI-C compliant, then one should try Objective-C which to my understanding is 100% compliant. But this is all nitpicking and has about zero relevance to somebody who is just starting to learn programming.

As to the point of getting a book of algorithms, that is something that I strongly support. Maybe it's not the first priority right now, but once you get the hang of things and learn to do some proper code, you will run into things that require some sort of algorithms and if you're armed with a good book, you'll go miles further. I have "Data Structures and Algorithm Analysis in C" by Mark Allen Weiss and it has served me well. It is also available for C++ and Java and some other languages, so that is one option for you and I'm sure others can recommend you different books.



I would start with C++. C is too cryptic in many ways and can be a hassle. Java is to abstracted from the actual machine IMO.

C++ will give you an easy introduction and understanding into what you're doing. As you grow with C++, you will be able to handle Java or most of what you want with relative ease.



Words Of Wisdom said:

I recommend going and taking a very cold shower every time you have the urge to learn to program.

Repeat until said urges go away.

If there was nobody who knew programming then there would be no internet and no computers or tv's or for that matter, virtually no electronics.

 



Initiating social expirement #928719281