PDA

View Full Version : What programming languages should I learn?



RecycleBin
June 20th, 2009, 07:44 PM
If I were to create a game and physics engine?
Like Havok or Unreal engine.

klange
June 20th, 2009, 07:48 PM
C++

Horns
June 20th, 2009, 09:37 PM
C++ and VB.

Limited
June 20th, 2009, 10:00 PM
C++ and C#.

I dont recommend C++ as your first ever programming language, it has a steep learning curve and introduces complex programming methods.

Horns
June 20th, 2009, 10:33 PM
C++ and C#.

I dont recommend C++ as your first ever programming language, it has a steep learning curve and introduces complex programming methods.

Then i'm in the wrong path. What do you recommend?

Phopojijo
June 20th, 2009, 11:29 PM
I think the idea is that the higher level the language -- the less you need to worry about.

Java/C# -- Every program is made up of a collection of objects -- teaches you neat and clean ways to recycle your code and keep yourself optimized while understanding data structures, complexity, etc. You don't need to worry about memory management, pointers, etc. as Java shields you from all forms of that.

C/C++ -- Halfway down the rabbit's hole... your code is still some stream of logic... the good code etiquette you learned (I hope) from Java helps you now that you need to worry about more stuff. Things like memory management are important now. What does that mean?

Well -- lets say you allocate 4048 kilobytes for an image to be imported into your program.
Now -- lets say the very next kilobyte in memory was where some of your code is.
... Lets say you import the image and you forget to check its size (or you make a sign error in checking its size)... well if someone loads a 4100kb, lets say, image into your program... and kilobytes 4049 through 4100 are codes to download and install a virus -- when your program reaches what SHOULD be your code at kilobyte 4049 -- it reaches the virus code.

Congrats -- the users of your software now have a virus installed with the same permissions as whatever your program had.

*****
Benefits over Java? Speed... VERY MUCH speed...
Disadvantages over Java? Much more to worry about... if you don't know the basics about etiquette, your program will be illegible... so lets say you DO have a security bug -- you'll never find it... your code looks like shit.
*****

Assembly -- And congrats you hit the bottom of the rabbit hole... watch your head. This point everything goes out the window. No conditionals statements, no complex loops. You want those stuff? You gotta program them yourself. What you CAN do is tell the processor EXACTLY WHAT TO DO on an instruction by instruction basis. ((Note: There are some things you CANNOT program... like processor branch prediction... that's all done by the processor on its own))

Leanest, meanest, tightest code you can make that executes just about as fast as your computer can go...

BUTTT the weight of the world is on your shoulders.

Good luck.

****************************

Usual workflow?

--Scripting and other stuff in games are usually Java-style object oriented languages... where each object typically is, literally, a game object.
--The engine itself is coded in C/C++
--Anything that people find takes an excessive amount of time ((the insides of a commonly used nested loop, for instance)) gets done in assembly and plugged into the rest of the C/C++ code. The ideology is simple: If 90% of my time is in 5% of my code... make that 5% of my code as quick as possible and fuck the rest.

RecycleBin
June 21st, 2009, 03:36 AM
Brain rape here I come!
I guess it wouldn't hurt to learn C, C++, C#, VB and Java.

Also, I can't copyright an idea or can I?

TheGhost
June 21st, 2009, 12:32 PM
Let me know what it is an I'll let you know ;-)

klange
June 21st, 2009, 01:15 PM
Your original question was too specific.
You should learn Python on the way there, you can do anything, it's faster than Java, already in use for casual games, has thousands of libraries, forces you to use a syntax that is readable, and is open-source.

RecycleBin
June 21st, 2009, 01:41 PM
Okay, thanks.

Limited
June 21st, 2009, 05:03 PM
I'd recommend learning Java. It gives you an introduction into OOP and allows you to learn good programming standards but like Phoji said you dont have to worry about memory allocation and all that.

After Java, start learning C++.

Phopojijo
June 21st, 2009, 08:15 PM
Brain rape here I come!
I guess it wouldn't hurt to learn C, C++, C#, VB and Java.

Also, I can't copyright an idea or can I?You can patent an idea... not copyright... there's a difference. To quote a random definition, "Copyright protects the expression of an idea, patenting protects the idea itself".

In the old days the patent office used to deny all patents on software stating that it's "Just math". As a result, companies decided to print their code as some piece of hardware with a bunch of logic gates and said "Oh by the way, this patent is only just an embodiment of our program"... since Hardware has more legal rights than Software, that was allowed -- and simultaneously blocked all software implementations of that hardware except for the patent owner.

Eventually people went nuts though and started patenting everything, including Amazon's "one-click" patent. Even worse there's laws that state that if you publish anything, even on the internet, copyright is assumed unless you specifically give away your rights by Creative Commons, etc. That of course assumes that a Judge won't rule your patent undefendable by one of the following common landmines:

1) You never defended your patent, copyright, or trademark against abuse in the past... that voids your patent, copyright, or trademark for the future... entirely.

2) Your patent is deemed "Too-Obvious"

3) Your patent has been proven "Done before"... which basically follows under 1).

Copyright and Patent laws are going to be reformed, it's only a matter of time... frankly I'd recommend going the floss-side of things and keeping your stuff open to the public. There *is* that expression "You attract more bees with honey than with vinegar"... community can give back to you in many many many ways.

... Just look at all the debt being rung up by the MPAA and RIAA because they are trying to "defend their copyrights"... Hell, Sony is being told, by their investors, to sell off Columbia Pictures because their movie labels are too bleedy. Patents turn people away.

My prof was actually talking to the class about his lasers experiments. There were several things they could have gotten patents for... but they had to seriously decide as a group what to do. IPs could be useful to make money... but an open publication would yield Government grants and the attention of others in the field. (And extra Post-Doc work)

Locking your stuff down rarely is useful... occasionally... but rarely.

legionaire45
June 22nd, 2009, 12:03 AM
I personally went like this:

BASIC STAMP Basic (some robotics thing) -> Blitz Basic (Blitz3D) -> C -> C++
Then I went off and toyed with HTML, CSS and JS for the hell of it :P.

Most professional game engines are programmed with C++, C# or equivalent, but depending on your confidence level you might want to "dip your toes in" with something like Actionscript (Flash), Java, Python or something simple. Basic even, although most people will say that Basic will ruin you as a programmer. I wouldn't go that far, but the jump from something like Basic to C isn't small.

Scripting languages are usually implemented with things like LUA (GMod), occasionally off the wall things like javascript or game engine specific things (Quake C, Halo Script, etc). There are many others too.

Phopojijo
June 22nd, 2009, 12:43 AM
Yeah... C# isn't really used for engine development by any major studios that I know of... most of their code is C++ whether it be for performance sake, or more likely because their entire engineering staff codes in C++ already and there's no sense shaking a beehive unless you need to.