Best language to start programming in?
#23 Moderators - Reputation: 5305
Posted 03 December 2012 - 09:44 AM
The kind of "performance" difference one can potentially get by changing languages is not relevant for a beginner. Beginners will be limited algorithmically, rather than by the potential low level speed-ups a master can obtain.I recommend c/c++ if your question aims at performance.
By the time this is your bottleneck, you should be capable of picking the tools that will deliver the performance you need.
No, it isn't.At the same time c/c++ is a better language for solving general purpose programming problems.
This is like saying that French/English is better for general communication, or that Screw/Hammer is better for solving general DIY problems. It is plain nonsense.
#24 Members - Reputation: 131
Posted 03 December 2012 - 12:58 PM
Another benefit with C++ is that, later on, you can expose your library via .dll/.so and interface every language that can load them (Java, Python, Lua, C, D, whatever). That said, why not start with Java and target Android. If you download the package that Google offer, you are good to go. Eclipse makes learning Java exceptionally easy and what you learn from Java, you can take with you to C++, for example.
Point is, make a decision that suits your needs. We will pretty much just tell you what we like based on our experiences - that is, after all, what a general consensus is ;)
Check out my site: bigdavedev.com
#25 Members - Reputation: 3363
Posted 03 December 2012 - 01:25 PM
I would recommend C++ (specifically, the C++11 standard) as a good place to start off. It's not a hard language to learn. What makes it hard are features that beginners just don't need to worry about. The standard library contains many gems, and there are a plethora of GUI, physics, graphics, etc. libraries available to you as well.
Another benefit with C++ is that, later on, you can expose your library via .dll/.so and interface every language that can load them (Java, Python, Lua, C, D, whatever). That said, why not start with Java and target Android. If you download the package that Google offer, you are good to go. Eclipse makes learning Java exceptionally easy and what you learn from Java, you can take with you to C++, for example.
Point is, make a decision that suits your needs. We will pretty much just tell you what we like based on our experiences - that is, after all, what a general consensus is ;)
Rarely do I disagree with a post more than I do this one.
What makes C++ difficult is its complexity. Period. You can't simply avoid it either, a new developer gets punched in the face by stuff they just shouldn't have to handle when starting out, such as the pre-processor and the horrifically outdated build/link system. To move past the most trivial of hello world applications, you need to conquer these beasts, and that's just the beginning.
To use a direct example, lets say a user wants to use a 2D library, such as SFML... great!
Now what?
Let's see, now they need to know how to add the library header files to the include path, the library lib files to their library path.. oh wait... which ones? Debug or Release? Multithreaded sor single threaded runtime? Why am I getting these LIBCRT errors all of a sudden??? WHAT THE HELL! Oh crap, SFML isn't compiled for Visual Studio and the shipped binaries are for 2008 and not compatible... ok, now I need to build the library myself. Oh crap, it depends on these other libraries and... oh crap, why is this one library statically linked? What the hell is static linking anyways...? Off to Google!
This might seem like an out there example, but it is EXACTLY what you will encounter if you want to work with SFML with C++.
Now, some might say you shouldn't be working in 2D graphics at this point and with C++ I suppose that is true. However, if you went with say... Python and PyGame, JavaScript or even C#, you will be able to be drawing graphics on screen day 1 and you wont be getting ahead of yourself.
Next up, Eclipse is the devil and beginners should stay the hell away from it. Over engineered, fragile with one of the worst UIs ever made. If you are going to go the Java route and dont want to repeatedly smash your head against a wall, do yourself a favor and use IntelliJ or NetBeans. Only use Eclipse once you are forced to ( and eventually you will be unfortunately. )
#26 Members - Reputation: 6183
Posted 03 December 2012 - 01:35 PM
#27 Members - Reputation: 3363
Posted 03 December 2012 - 02:30 PM
Although I agree with the spirit of Seraph's post, I recently installed SFML with C++ on Linux and I didn't have any of those problems. The simplest Ubuntu install puts the header files and library files in the standard places, and I just need to add some -lsfml-blah options to my compile command, but I just got them from the tutorial on the SFML website and it worked fine on the first attempt.
The problem I described is what happens when you work with Visual Studio 2010. SFML is shipped in binary form for 2008 only, and the two binary formats are not compatible, so you need to recompile SFML if you want to using VS2010. If you use Visual Studio 2008, the experience is flawless. That said, it's when things dont go perfectly smooth, or when the tutorial misses a step, that the newbie is now starting their descent down a deep dark bottomless pit of hell.
I didn't mean it as a shot at SFML, it's just a real world example that comes to mind. Linux often actually makes the build process a much easier prospect in many cases, until it breaks or you end up in dependency hell that is. There are different problems too on different platforms. XCode, well, its just awful... but even trying to figure out how to create a C++ application is a bit of a nightmare ( command line utility anyone? ) and Apple has this nasty habit of moving frameworks and library files around, or just getting rid of them completely between OS versions and patches. Another issue that comes to mind is CodeBlocks ships with SFML templates, that simply dont work. Plus it ships (on Windows ) with a version of GCC that simply isn't compatible with SFML at all, requiring you to replace your compilier completely if you go that route.
In a nutshell, the overly complicated build process is going to bite you, in some way, shape or form, regardless to what platform you call home.
Edited by Serapth, 03 December 2012 - 02:35 PM.
#31 Members - Reputation: 284
Posted 04 December 2012 - 05:00 AM
Learning some basic C, as to how it handles memory allocation, may help you understand what is going on in hardware too. Not enough people learn that stuff any more.
Edited by PurpleAmethyst, 04 December 2012 - 05:01 AM.
#32 Members - Reputation: 3822
Posted 04 December 2012 - 07:36 AM
Although I agree with the spirit of Seraph's post, I recently installed SFML with C++ on Linux and I didn't have any of those problems. The simplest Ubuntu install puts the header files and library files in the standard places, and I just need to add some -lsfml-blah options to my compile command, but I just got them from the tutorial on the SFML website and it worked fine on the first attempt.
alot of things are far easier in Linux these days (Especially application and library installations). If you download the source tarball instead of pulling the dev package from the ubuntu repository you're in for a world of pain though.
My main problem with Linux today is that some developers still seem to think that all Linux users know how to and want to compile their own software, SFML still gets this wrong. (It shouldn't be that difficult to toss up a apt:libsfml-dev link on the website to make life easier for beginners who happen to google for sfml rather than search for it using the package manager).
The voices in my head may not be real, but they have some good ideas!
#33 Members - Reputation: 410
Posted 04 December 2012 - 12:14 PM
My main problem with Linux today is that some developers still seem to think that all Linux users know how to and want to compile their own software
I agree and if you look at the amount of patches that the packages for Ubuntu or Fedora have to write to get software to compile on their distributions then it will quickly be obvious that it is too awkward to compile from source these days (I blame GNU Autotools for being defective but I digress).
However, this isn't really to do with languages any more. For example, when I had to compile the MonoGame C# binding on Fedora 16, it was a horrible experience!
Much worse than something like the native SDL C library which has been tried and tested on many many distributions and is now extremely portable across them and actually built without any issues.
Though one thing that I thought was cool was the OpenTk Windows .dll worked perfectly on FreeBSD without needing any recompiling. (The best example I have seen of C# being truely cross platform).
Edited by Karsten_, 04 December 2012 - 12:16 PM.
http://www.mutiny3d.org - Open-source pluginless Unity Re-implementation.
#34 Members - Reputation: 562
Posted 04 December 2012 - 12:18 PM
Performance should be the least of your concerns as a beginner game programmer; the goal you need to first overcome is completing a few very basic games. Creating a fully functional, low FPS-performance, basic game in say GameMaker is going to be much more rewarding and get you where you want to be going faster than trying to create a 100 module, C++ / Assembly optimized game using your own custom low-level high performance multi-platform game engine. Your chances of creating the former are not too bad, but of creating the later as your first major programming project are probably about 1 in 10,000.
The first question a beginner should ask themselves is not which language to learn first, but what project do they first want to complete and on what platform. It should be something simple, like Pong or Tetris at most in complexity, and should definitely be 2D, not 3D. Along with this question is which platform do you want to target. XBox / PS are too complex for a beginner as an initial platform; the platform should be either web-based, Desktop PC/Mac, or Mobile.
It's fine to have a long term bigger goal, such as the very common "I want to design and create a MMORPG on Desktop PC/Mac, like World of Warcraft but with far nicer features". Just as long as you translate that long term vision into a very tiny, doable stepping stone. In this case, your stepping stone is first that it means you decided on a target platform of Desktop PC/Mac. Then for your first project, you might do some very tiny 2D game aspect of it, such as a basic Mini-Map where you appear as a dot that can move around it using the cursor keys.
For a 2D game on a mobile platform for a beginner, I would definitely advise Corona (which uses Lua as a development language) to start. You can have something animated move across a scene in under 10 lines of code. Lua is an easy to use high level language that is great for this kind of thing.
For a 2D game on the desktop platform for a beginner, I would choose Love2D, again in Lua. Much like Corona it is very easy to get started quickly even for a beginner and has lots of great advice in its documentation and forums.
For browser-based games, I'm not as familiar but GameMaker would probably be a good starting option.
Over time, you will become more familiar with basic concepts, such as 2D animation, 2D scenes, simple user input, simple game states, programming basics such as variable declaration, loops, and creating functions, and game-wise you will start getting a better sense of what you can realistically accomplish. Eventually, you can move onto other concepts such as Object Oriented Programming and try out some other languages and SDK's to get a broader feel of the available methodologies and tools.
#35 Members - Reputation: 123
Posted 05 December 2012 - 07:51 AM
When your through with the 200 pages (part 1) you would have gone from totally nothing to an advance beginner.
What I really like about this book is that you write your example code (getting coding exercise) while reading about the subject.
You could learn C with in a week and if you're fast even less time.
After that you're next step should learning C++, after that OpenGL, then then ... before you know it you are creating games.
#36 Members - Reputation: 3363
Posted 05 December 2012 - 09:36 AM
You could learn C with in a week and if you're fast even less time.
With prior programming experience, perhaps, and even then I doubt it. As a first language, no bloody way. C is a fairly simple language, but it would still take much longer than a week to learn, and certainly much longer than that to master.
Unless we are seriously stretching the definition of "learn". I mean, you could memorize the C keywords in an afternoon, but I would hardly call that learning the language.
#37 Members - Reputation: 6183
Posted 05 December 2012 - 09:42 AM
You could learn C with in a week and if you're fast even less time.
Peter Norvig (head of research at Google) has something to say about this.
#38 Crossbones+ - Reputation: 1094
Posted 05 December 2012 - 10:38 AM
You could learn C with in a week and if you're fast even less time.
We spend a semester coaching M.Sc. students (who all have previous programming experience in another language) with C, and at the end of that their skills are quite shaky. If we could get them even to that point in a month, that would be awesome. A week would be a miracle.
#39 Members - Reputation: 546
Posted 05 December 2012 - 03:12 PM
#40 Members - Reputation: 463
Posted 05 December 2012 - 04:29 PM
C# has extensive library, and it's all uniform syntax. Even 3rd party libraries follow the MS conventions. It also has better IDE and dev tools. It is much faster to develop at the beginning. There are many design flaws in the dotnet classes, some originating from the flaws of the language, and some just poor OO design. In the end it can get very verbose syntax wise (even more so than c++), and you have to be very careful if you want to do anything deterministically.
Java's design has been flawed from get-go, and the repairs haven't worked yet.
Overall, at high level, most concise source code will come from c++, but getting there will take lot of of code and might require you to build "meta language" with lower level classes first.
Now, after being out of picture for a long time for c++, Microsoft seems to invest heavily in (modern) c++ now. Maybe they will try to create some decent library for the first time ever. There's even some hints that they might try and make native compiler for C#.






