Beginning programming - Page 2

Beginning programming

Post just about everything that isn't directly related to Spring here!

Moderator: Moderators

User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6240
Joined: 29 Apr 2005, 01:14

Re: Beginning programming

Post by FLOZi »

People shouldn't be allowed to use computers unless they know Python
User avatar
SwiftSpear
Classic Community Lead
Posts: 7287
Joined: 12 Aug 2005, 09:29

Re: Beginning programming

Post by SwiftSpear »

Panda wrote:As far as PERL programming goes, there's a class being taught at my university on PERL programming and bioinformatics, so apparently it's good to use when it comes to dealing with biological data.
More likely it's just the best language the professor knows. Either that or there's some specific program they are dependant on that happens to be in PERL already. In computing we rarely fix that which isn't broke.
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: Beginning programming

Post by smoth »

Dragon45 wrote:I SUCK TITS
Image
THERE'S NOTHING WRONG WITH THAT
User avatar
Felix the Cat
Posts: 2383
Joined: 15 Jun 2005, 17:30

Re: Beginning programming

Post by Felix the Cat »

First, http://www.amazon.com/Primer-Plus-4th-S ... 0672322234

Read it. The beginning will of course be easy if you already have programming experience, but it gets into key C++ OOP (object-oriented programming) concepts later on.

Then get a solid data structures book and work through that.

Then get a solid software architecture book and work through that. Focus heavily on the design patterns. By the end of this you should be extremely comfortable with every aspect of object-oriented design and implementation.

Run through some Windows programming basics, if you're interested in doing anything Microsoft-related, including DirectX. Familiarize yourself with both the (outdated and procedural) Win32 API and the (less outdated and OO) MFC. Since programming anything Microsoft is approximately equivalent to the sixth circle of Hell, this is a good way to hone your problem-solving skills.

Then, you'll have all the tools to teach yourself whatever you want to learn - DirectX, OpenGL, any other API, AI programming, network programming, etc.

Few people have the patience to learn this correctly, because they have exactly the same way of going about it as you're demonstrating: "I'm gonna like learn C++ and then mod a cool game and then make cool games!!!!". No. Doesn't work that way. You need to have a very solid foundation first, and that takes time, dedication, and work.

This is C++ specific, YMMV with other languages.
User avatar
Dragon45
Posts: 2883
Joined: 16 Aug 2004, 04:36

Re: Beginning programming

Post by Dragon45 »

Felix's tip makes sense. Keep in mind that you'll want to do this over at least a year or two.
User avatar
Panda
Posts: 2042
Joined: 22 Jun 2006, 00:20

Re: Beginning programming

Post by Panda »

Good summary, Felix. 8)
User avatar
Michilus_nimbus
Posts: 634
Joined: 19 Nov 2004, 20:38

Re: Beginning programming

Post by Michilus_nimbus »

I say: learn Java. It's easier than C++ and more pure OO than C++.
Then, if you really want to learn C++, learn C first.
If you want to learn about gui programming, Java Swing is one hell of a nifty gui toolkit. I really don't know why some people hate it, all other gui libraries can be horribly inconsistent at times compared to Swing.
User avatar
Pxtl
Posts: 6112
Joined: 23 Oct 2004, 01:43

Re: Beginning programming

Post by Pxtl »

Michilus_nimbus wrote:I say: learn Java. It's easier than C++ and more pure OO than C++.
Then, if you really want to learn C++, learn C first.
If you want to learn about gui programming, Java Swing is one hell of a nifty gui toolkit. I really don't know why some people hate it, all other gui libraries can be horribly inconsistent at times compared to Swing.
Don't do that - the C first thing. Too many people learn C first, and then go on to use all the unsafe C features that just set you up for disaster once you get a large, complicated C++ project, when C++ has many features that let you write code that is every bit as safe as Java or C#, but faster and native.

Google "Thinking in C++" - it's a free ebook that nicely covers the C++ language as an object-oriented programming language of its own, rather than treating it like a bunch of crap stuck onto C.
User avatar
Dragon45
Posts: 2883
Joined: 16 Aug 2004, 04:36

Re: Beginning programming

Post by Dragon45 »

Also: C++ is not a strict superset of C. Precedence of operators is not identical in both; not all pieces of code that run a certain way in C will run the same way in C++.

A somewhat pedantic point, but just keep it in the back of your mind's lock-box.
User avatar
Felix the Cat
Posts: 2383
Joined: 15 Jun 2005, 17:30

Re: Beginning programming

Post by Felix the Cat »

Michilus_nimbus wrote:I say: learn Java. It's easier than C++ and more pure OO than C++.
Then, if you really want to learn C++, learn C first.
If you want to learn about gui programming, Java Swing is one hell of a nifty gui toolkit. I really don't know why some people hate it, all other gui libraries can be horribly inconsistent at times compared to Swing.
Learn C before you learn C++?

They're two very different languages, with two very different concepts behind them.

It's like saying you need to learn to ride a unicycle before you learn how to drive a tractor-trailer...

IMO there's really no use in learning C these days unless you want to maintain legacy software or something. C++ is the standard for software where performance is critical - such as games. (*braces for onslaught of Java fanbois in 3... 2... 1...*)

C++ isn't as terribly difficult and hardcore as everyone makes it out to be. If you want to learn C++, learn C++ - don't take some complicated, circuitous route to it. If you want to learn Java or C# or VB.NET or freaking Ada... learn it instead.

Also... you could say that Java is "more pure OO", but Java lacks some OO-isms that C++ has and that require workarounds in Java - such as multiple inheritance. True, multiple inheritance is the surest path to completely fucking yourself and your program over, and IMO if you think you need to use multiple inheritance to solve a problem then 9 times out of 10 you're approaching it the wrong way... but still, it's an OO-ism that Java doesn't have.
User avatar
Michilus_nimbus
Posts: 634
Joined: 19 Nov 2004, 20:38

Re: Beginning programming

Post by Michilus_nimbus »

Pxtl wrote: Don't do that - the C first thing. Too many people learn C first, and then go on to use all the unsafe C features that just set you up for disaster once you get a large, complicated C++ project, when C++ has many features that let you write code that is every bit as safe as Java or C#, but faster and native.
That's a very good point. C++ is a very different language to C, but that's exactly why I'd recommend people to learn C first. C is quite a bit simpler than C++, and imho it's a better tool to learn about pointers and memory management. You'll get a better view of the low-level workings of the language, which imo can be a real advantage when starting C++.
I'm quite sure you'll think twice before touching a C idiom if you're used to Java, C# or any high level language :-)
It's like saying you need to learn to ride a unicycle before you learn how to drive a tractor-trailer...
I like to see it more like learning to ride a unicycle before doing down-hill mountainbiking with it :-)
Last edited by Michilus_nimbus on 13 Jan 2009, 21:26, edited 1 time in total.
User avatar
Pxtl
Posts: 6112
Joined: 23 Oct 2004, 01:43

Re: Beginning programming

Post by Pxtl »

Yes, it's important to know about those tools, but it's also important to never, ever, ever do manual memory management if you can avoid it. Bringing out malloc should be seen with the same disdain as bringing out, say, assembler.

Good C++ does not have void*.
User avatar
Michilus_nimbus
Posts: 634
Joined: 19 Nov 2004, 20:38

Re: Beginning programming

Post by Michilus_nimbus »

Pxtl wrote:Yes, it's important to know about those tools, but it's also important to never, ever, ever do manual memory management if you can avoid it. Bringing out malloc should be seen with the same disdain as bringing out, say, assembler.

Good C++ does not have void*.
No arguing that :-)
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: Beginning programming

Post by smoth »

Michilus_nimbus wrote: C is quite a bit simpler than C++
Image
User avatar
Dragon45
Posts: 2883
Joined: 16 Aug 2004, 04:36

Re: Beginning programming

Post by Dragon45 »

You can safely disregard most of the advice from this thread.
User avatar
Hoi
Posts: 2917
Joined: 13 May 2008, 16:51

Re: Beginning programming

Post by Hoi »

Dragon45 wrote:You can safely disregard most of the advice from this thread.
User avatar
Felix the Cat
Posts: 2383
Joined: 15 Jun 2005, 17:30

Re: Beginning programming

Post by Felix the Cat »

Michilus_nimbus wrote:C is quite a bit simpler than C++,
IMO that's like saying that a cotton gin is simpler than parliamentary democracy... again, they have two different concepts behind them.

If you really LEARN C before even touching C++, then you'll pick up a lot of habits that are bad in C++.
and imho it's a better tool to learn about pointers and memory management. You'll get a better view of the low-level workings of the language, which imo can be a real advantage when starting C++.
Most of the time you're better off ignoring the low-level workings of the language anyways... I've seen far more mistakes resulting from misuse/abuse of low-level tools than from ignoring them.

This is especially true for someone who wants to learn to program recreationally... someone who won't be in a position where he has to heavily optimize his programs.

IMO learning the very low level technical stuff is something that should come later and as necessary.

On the other hand it would be very amusing to walk into an Intro to C++ class and see them discussing, say, hacking the vtable :twisted:
User avatar
Dragon45
Posts: 2883
Joined: 16 Aug 2004, 04:36

Re: Beginning programming

Post by Dragon45 »

There really needs to be a programming subforum that only actual programmers have write access to. For stuff like this.
User avatar
Boirunner
Kernel Panic Co-Developer
Posts: 811
Joined: 05 Feb 2007, 14:24

Re: Beginning programming

Post by Boirunner »

dragon45 founds club that wouldn't take him as a member itt
User avatar
Boirunner
Kernel Panic Co-Developer
Posts: 811
Joined: 05 Feb 2007, 14:24

Re: Beginning programming

Post by Boirunner »

dragon45 thinks cobol is an elegant language
Post Reply

Return to “Off Topic Discussion”