Which Language?
#1
Posted 06 July 2009 - 01:41 PM
#2
Posted 06 July 2009 - 03:03 PM
In the long run, you should try many different languages and decide for yourself what you like and dislike about each and what kinds of applications each is best suited for. Leaning a new language is never a waste of time, because it will show you a different way of thinking about and expressing a problem. You will discover too that most paradigms can actually be implemented in any language.
#3
Posted 06 July 2009 - 03:31 PM
I'm going to recommend Python as a first language. It makes it easy to learn the style of structured and object-oriented programming up-front and doesn't leave much to puzzle over since it has the most common data structures built into its commands. Once you learn Python scripting, then you can start writing extensions to the language in C and C++ to learn the more advanced topics.
#4
Posted 06 July 2009 - 04:02 PM
#5
Posted 06 July 2009 - 04:31 PM
#7
Posted 14 July 2009 - 02:57 PM
As a simple analogy, it doesn't take the carpenter long to see how to sling a hammer, a chisel and a saw, but building a Chippendale cabinet can take years to master.
But, in order of preference, I would agree with SamuraiCrow and Reedbeta: Python first, C++ second, then maybe C, C# or Lua third.
Python is arguably simpler, but not by much, than C++, and prevalent in the game development world. C++ can be much more complex, but the parts you actually need (vs. admire from a distance) are not much worse than Python. And, it is the most prevalent language in the gaming world.
Lastly, C is obviously popular for historical reasons and/or where performance matters a lot. C# is made popular by Microsoft its push in the game development world, and its large community. And Lua is a popular scripting language similar to Python.
#8
Posted 19 July 2009 - 11:50 PM
This is probably going to be the opposite of what teacher will tell you but I would start with C (in my day I learned fortran) and then move on to C++. Next learn about garbage collection and when and if you finally move to languages like C# and Java you will have some idea what is going on underneath the hood.
#9
Posted 20 July 2009 - 12:57 PM
#10
Posted 20 July 2009 - 03:19 PM
#11
Posted 20 July 2009 - 04:20 PM
Also garbage collection is often of concern with newer languages. The time when objects are destructed can be an issue in certain cases. Can objects be moved during GC? What are the implications of this if you are trying to interface your data to something outside the language? Are back references in your data structures going to cause issues during GC?
If you know C/C++ first and have some knowledge of memory management you tend to think about these things implicitly, and take steps to avoid problems. I'm not claiming that everyone should absolutely learn C/C++ first. However, if you want to be a "complete" programmer and especially if you are working on performance sensitive games, I think this is a good route to take.
#12
Posted 20 July 2009 - 04:57 PM
#13
Posted 20 July 2009 - 05:33 PM
While I can see that you are both developers with some decent amount of experience, it's just that we have somehow arrived at different opinions over our careers.
First, there's a difference between saying something like "a strong developer knows multiple languages" and something like "knowing X will make you better at Y". I agree with the former, but not with the latter.
Knowing multiple languages will help you really see the relative strengths and weaknesses of each. You will better know when to use one versus the other. But, this is a kind of "meta-knowledge", if you'll allow the term. Knowing multiple languages doesn't make your potential in one language any higher; it just makes you more adept at choosing the right tool. The only time knowing C will benefit you is when you need to use C, which can happen often in a performance-demanding subject like game dev.
However, the latter is simply not the case. It's like saying, if you want to really learn and be good at English, you should learn West Saxon Englisc first. Sure, it's interesting to see where some modern English terms and structures came from, but it won't make your English essays any more understandable.
I have yet to be found a concept in a higher-language that, without knowing how to implement it in a lower language, you are at a distinct disadvantage to someone who does...
#14
Posted 20 July 2009 - 05:39 PM
#15
Posted 20 July 2009 - 07:03 PM
In any case, all opinions here are equally valid so I guess we can just let the OP decide his best option now that he has heard the arguments.
#16
Posted 20 July 2009 - 07:36 PM
#17
Posted 21 July 2009 - 03:28 AM
To clarify my position, I don't think that one should necessarily learn lower before higher level languages. In fact, I think SamuraiCrow and Reedbeta makes very compelling arguments that it makes more sense to learn a higher(more "contemporary") language first.
I do maintain that learning multiple languages is one of the best ways of gaining new perspective and of learning new ways of expressing problems. It's not just a matter of knowing when to use which tool. In my own experience, it has often turned out that a method or idea has been possible (and practical) all along in one language, but only it never occurs to me until I learn a language that explicates that idea. High level languages tend to be different tools than low level languages, and that's what's is important. Different perspectives challenge each other and I believe, open up the opportunity to develop more consciousness about expression.
EDIT:
Also, by "think[ing] about how higher level languages are implemented", I mean thinking conceptually about how something works. One could, for example, learn Smalltalk as a first language without really understanding what a message is, how it differs from a function call, and what it's advantages and disadvantages are. Learning c afterwards would probably be very illuminating for that person. In reverse, one could learn c (I'd even argue c++) first, but might totally miss out on object oriented concepts until they learn a language like Smalltalk. Those object oriented concepts can greatly enhance c programming!
#18
Posted 22 July 2009 - 01:32 AM
The good old days of bit banging is mostly gone except for embedded controllers and with it the joys of programming in low-level languages is fading out as well. The only reason for learning a low-level language today is to move on to compiler design and to understand how they work.
I am learning about compilers and have been so overwhelmed by the high-level concepts of optimization and computation that if there was a low-level language I'd recommend to a beginner it would be LLVM Assembly. Once you learn static single assign form it is a simple matter to learn how to implement code at a level where it can still be auto-optimized by the Low-Level Virtual Machine itself and still create optimal code for many processors. Once you get over the thrill of having a lot of control over your code, moving on to a higher level language will still be the most practical way to do anything.
[rant]
The main reasons I think that C++ is going to start fading out in some circles is that certain features of the language make writing LLVM bitcode and .NET Managed code less portable than they should be. Conditional compilation was a technique in the C preprocessor to avoid compiling code that will only be used in certain situations, a practice that should be eliminated because dead-code elimination within the compiler itself can do this without a preprocessor.
For example: using dead-code elimination at link-time allows all of the system-specific codes to be included in the bitcode on LLVM so that a single collection of bitcode files can be generated portably so that the LLVM's llc command can be used to statically compile them the rest of the way to machine language regardless of the target. Only the runtime libraries would contain system-native code. This combines the best of the .NET and Java worlds with the SDL/SFML worlds.
[/rant]
#19
Posted 22 July 2009 - 02:56 AM
SamuraiCrow said:
I would think most C++ programmers write natively compiled and optimized code. I personally don't care about the .NET bastardization since it is hardly C++. I would rather use C# before using C++/CLI.
Also I don't see C++ "fading out" soon since no other language has come to prominence that fills its niche; that being performance oriented code. In fact other compiled languages such as COBAL and FORTRAN have been fading out in preference to C++. If another good compiled language does appear then C++ may indeed fade out but I don't think languages like C# or Java will replace C++ since they come with their own limitations.
In my tests and despite what some C# fans claim, C++ typically runs at least 2.5X the speed of C# and quite often a lot faster. Yes in some cases if the planets align properly or monumental efforts are made C# or Java may run near the speed of C++ but typically it isn't so. I have tested it many times, but I will be happy to test it again if someone has a particular C# algorithm (that's not too long) that I can code in C++ for comparison.
#20
Posted 22 July 2009 - 02:25 PM
This is getting off topic very quickly, but did you try LLVM also? When using LLVM to optimize the JIT code of Mono it is often just as much faster than running C# using the default JIT as running C++ over the default JIT.
My rant was based on the FAQ at the LLVM website. If you want to discuss this futher, we should start a new thread.
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users











