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

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

OK!!!! WOW!!!

I thought I was all set, then I go out drinking for just a few hours and a war has started.

First of all I would like to thank everyone for their enthusiasm and input. Based on what has been said I would like to ask some questions.

As someone said, I am a clean slate with an interest in programming. But I do not pretend to have endless willpower. Please bear in mind that if you put me up to something that is too difficult or too intimidating FIRST, it is quite possible I will go off the idea.

That in mind, SHOULD I be starting with Java? If I do, is it really likely that I will develop bad habits I cannot easily break even if I am aware of the need to avoid doing so in advance?



starcraft - Playing Games = FUN, Talking about Games = SERIOUS

Around the Network
starcraft said:
OK!!!! WOW!!!

I thought I was all set, then I go out drinking for just a few hours and a war has started.

First of all I would like to thank everyone for their enthusiasm and input. Based on what has been said I would like to ask some questions.

As someone said, I am a clean slate with an interest in programming. But I do not pretend to have endless willpower. Please bear in mind that if you put me up to something that is too difficult or too intimidating FIRST, it is quite possible I will go off the idea.

That in mind, SHOULD I be starting with Java? If I do, is it really likely that I will develop bad habits I cannot easily break even if I am aware of the need to avoid doing so in advance?

In the beginning, you'll be mostly doing basic stuff which will be almost equal whether in Java, C, C++ or C#. So between those, your choice won't really matter much. (arithmetic expressions, statements, function calls, loops and simple data types are almost the same thing in all of them)

To answer your last question:

When you get to the point where you're using more complicated stuff like dynamic memory allocation, it pays to know that Java includes garbage collection (as C# does) whereas languages like C and C++ usually don't. Garbage collection essentially means that you don't have to worry about freeing allocated memory, as that will happen automatically. If you get too used to garbage-collection and then do the jump to a language which doesn't have it, your programs will probably leak memory until you get the hang of it.

 



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

Programming isn't for everyone. I take Computing at college, and it's really half/half. Half the class picked it up straight away, the other half are still struggling with the basics and we're coming up to the exam.

You need to have a logical mind, and relatively strong Mathematical skills (like breaking down formulas, creating algorithms, etc).

I couldn't learn coding from home, I had too many distractions, and no one to turn to when I needed help. My uncle's a programmer, but he's not the kind of person you ask for help (he's really half arsed at helping me).

Hence why I offered to help you when you needed it, because it is a struggle, and it is very easy to give up on.

One thing I will say, though, don't just learn one language because people on here posted the said language, download a few IDEs and play around with a couple of languages, look at the strengths and weaknesses of each language, don't do anything too low level, and chose a language which has a lot of support on the web.

Download the express editions of Microsoft Visual Studio.net (they're free... even when legal), find yourself a free Java IDE, and just play around, see which one appeals to you.

Some people will say "true programmers use Notepad" - that's just making it a hell of a lot harder for yourself, a good IDE, like Microsoft's, are really good and provide great tools and advice on where to find bugs in code.



Starting in Java you'll take for granted some low level issues (mainly memory management) that the language/environment will take care of for you.
When you later (if?) you'll jump to C or C++ you will discover that you have no help from the language to solve those issues, and a less direct help from the libraries you'll use. These issues are the causes of most bugs that can be found in C/C++ code.

On the other hand, starting with Java you'll learn much faster the higher level concepts of many useful algorithms and object-oriented programming. I think you will be more able to cope with additional hoops to jump through _after_ you've been broken into coding rather than being overwhelmed with details at first and losing sight of the forest for the trees.

The only concession I would make is that while you're studying Java (or C#) you could look at other sources enough to realize the issues you're _not_ encountering, without going too deep into their details. They will come as a less nasty surprise later on :)



"All you need in life is ignorance and confidence; then success is sure." - Mark Twain

"..." - Gordon Freeman

@SamuelIRSmith: Do you really think it's a good idea to ask him to try many languages right from the beginning? I think that can be distracting and too time consuming.

The point is to learn the basics of programming, which can be done with almost any of the languages mentioned in the thread.



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

Around the Network

@NJ5

When I started programming, I often made threads on forums asking people which language I should start with, people gave me different advice, but the majority said C++ (which isn't surprising as I often asked game development and emulation sites), so I tried C++.

I bought a book, I studied tutorials on the web, and I worked hard to get "with it", but I really couldn't understand what was going on, and I developed a true distaste for the language.

So, I went with VB. People often criticise VB, but I loved it. I found the code a lot easier to understand, I preferred the articles on the web about it, and I didn't have to worry about things like pointers.

Now, I haven't been back to C++ since, but I have played around with other languages, such as C#, and with the skills I learned with VB I was able to understand and use C# with relative ease. Looking through my C++ book there aren't any concepts that I fail to understand in there anymore.

What did I learn from this? That your starting language is really important, and spending time playing around with a few languages at the start can save hours of frustration later on.

It may not be the best advice, most people will probably push through with a language, but I didn't have that kind of motivation, and so this approach worked best for me.



I learned C in 3 days (although not consecutively), so it's entirely possible.

The C language isn't used for games nowadays, but it's a good stepping for the understanding of programming. If you're a newbie on programing, then C is a great way for that. After you have learned C, then you can go to object-oriented languages such as Java and C++, the two most used for games.



Use a book.

Do not use the internet.

If you learn off the internet you'll be a copy and paste slave.



shio said:
I learned C in 3 days (although not consecutively), so it's entirely possible.

The C language isn't used for games nowadays, but it's a good stepping for the understanding of programming. If you're a newbie on programing, then C is a great way for that. After you have learned C, then you can go to object-oriented languages such as Java and C++, the two most used for games.

I'd agree that low level to high level is much easier than high level to low level.

I wish I'd paid more attention to low level at school :(

 



^^^With which, you mean that you learned the _syntax_ of C and how to include/compile/link your programs. And various functions from some basic standard libraries, I guess.

Actually learning C as in being proficient and producing good, safe code will take... uhm, let's just say much longer.



"All you need in life is ignorance and confidence; then success is sure." - Mark Twain

"..." - Gordon Freeman