Programming

Well the reason C++ is difficult is because the syntax is a bit wacky, and the low level stuff you can do is designed to be as close to the machine as possible.

It's like assembly language that is portable and object oriented.
 
Well the reason C++ is difficult is because the syntax is a bit wacky, and the low level stuff you can do is designed to be as close to the machine as possible.

It's like assembly language that is portable and object oriented.

The only issues I'm having is that I'm teaching myself so I lack that teacher-student interaction which I'm sure would help.
 
Well I opened a Q&A thread in the group.
 
I've been doing some research on languages and while learning C++ is fun and exciting. I'm seeing some issues with it that maybe I shouldn't start with it? I don't want to be limited in my future programming by choosing Python or something like that as a first language. I keep reading that Python is slow and I would hope that it is atleast somewhat powerful. I'm not major software developer and probably never will be but if I want to make basic programs in the say next 6 months should I take up Python first? I would really like someone who knows about the languages to compare them and let me know what is a good course of action. Maybe it's just the classes in C++ that are twisting my mind up. :lol: ;
What makes C++'s learning curve stand out is that you have to learn classes and pointers at the same time. Java, C#, and Python don't have pointers, what they have instead is easier to learn. C on the other hand has pointers, but not classes.

I don't recommend learning C unless you're working close to hardware though. Classes are the way to go.

So learning C#, Java or python first will mean that you can do more sooner, but if you go strait into C++, then you'll be able to do more in C++ sooner, then if you were to go Java to C++. But starting with C++ may discourage you from programming completely.

Another thing to consider is if programming is to be a casual hobby, then maybe Python or Ruby is all that you ever use. The advantage of these two languages is rapid development. The biggest disadvantage is that they are slow due to being interpreted (but being interpreted has upsides too). But they are only relatively slow, and it is possible to rapidly develop pretty nifty games in a few hours in Python and Ruby. This is not possible in C++, C#, C, or Java.

Some of the above may make you conclude that Python is better than Java, but that is not necessarily the case. Java can be as fast as C++, and with less effort than required in C++. C++ is fully compiled, and Python is fully interpreted. Java is mostly interpreted, but will compile critical sections of code.
 
Plus java has an extensive standard library that can do so many different things its mind boggling. The library is also pretty well curated so you know the mthods will work and they will work well.
 
From what I've looked into Google is funding research into making Python faster by actually letting it work in machine code. So who knows what the future holds for that language. Google makes stuff happen. If Python is good enough for Google it's good enough for me as a first language.
 
It will never make sense to me why they won't just make a new language just a powerful as C++ but vastly easier to grasp and use. It would really improve everything.

The problem is that higher level and easier to use languages are generally made by abstracting lower level languages. That is, by hiding the complicated stuff that makes lower level games more difficult to use yet powerful.

Take string handling for example:
-In a low level language like C, a string is nothing but an array of integers. The language library gives you functions to do a couple of basic things like copying and comparing, but that's it.
-Move to C++, and you can still do everything the same as C if you want/need to. However, the language library now provides a string class that vastly simplifies most average string usage. Ultimately though, that string class is just a thin wrapper around the same array of integers. It really only works with ASCII strings and is still pretty basic in terms of string manipulation and etc.
-Move on to a still higher level language like Java or C#, and you typically get a full featured string class that supports Unicode and has just about all the string functionality you'll need wrapped up in one package.

The other problem I think is that you don't really understand what you're talking about when you say C++ is more "powerful" than other languages. The main place where C++ has advantages of "power" is in its ability to let you dive into low level details to heavily optimize for specific hardware and so on. Guess what? You quite likely won't ever need that kind of ability unless you plan to write an OS, a high-end AAA level game (say, the next Crysis), or maybe performance intensive science/math type applications (though I think they still heavily use Fortran).
 
You quite likely won't ever need that kind of ability unless you plan to write an OS, a high-end AAA level game (say, the next Crysis), or maybe performance intensive science/math type applications (though I think they still heavily use Fortran).

I took a couple classes of a computational physics program before I got kicked out, and the prof was of the opinion that C is now superior to Fortran for almost any physics-related purposes.

Math stuff I mostly did in Matlab/C.
 
From my couple hours of fooling around with Python its vastly easier to grasp and write than C++. Without having the ;'s and }'s helps alot with the cutting down of errors.
 
C++ does support 16-bit unicode strings (wstring class).

C99 is finally as good for maths as Fortran, since they introduced restricted pointers (regular C pointers can be aliased which means certain operations are difficult for the compiler to optimise, e.g. copy the pointer content's value on entry and write back at function exit). Restricted pointers make pointer handling in C99 as efficient as in Fortran.

Luckymoose: You get used to the braces and semicolons pretty quick in C++. An expression ends with a semicolon and braces are just a way to make a block of code where a single expression would suffice.


EDIT: Some things are also more awkward in Python and other loosely types languages - the main one that comes to mind is:

No declaration of variables

This means that if you make a typo you introduce a new variable which can be an annoying error to find. This would immediately be flagged as an error in a declarative language.
 
I've been plowing through Python, and have upgraded my IDE to PyDev/Eclipse for more features. IDLE was getting on my nerves. I'm really liking this language. Unlike with c++ I can actually wing it and figure out how things work along with the book I'm reading.
 
Civ4 was primarily written in C++, but has python as an in-built language for scripting (and for manipulation the UI too, I think)

This really doesnt mean much because a lot of games, especially large commercial ones are built on C++ and have some sort of scripting language ingame. All it says is that C++ is prevalent in the game dev industry.
 
This really doesnt mean much because a lot of games, especially large commercial ones are built on C++ and have some sort of scripting language ingame. All it says is that C++ is prevalent in the game dev industry.

Python will work fine as a first language and for small programs. I'm not going to be making the next Crysis or anything. Once I get a good handle on Python I'll move on to learn other languages to step on up the ladder. I'm trying to make this a fun experience so I don't get frustrated.
 
Python will work fine as a first language and for small programs. I'm not going to be making the next Crysis or anything. Once I get a good handle on Python I'll move on to learn other languages to step on up the ladder. I'm trying to make this a fun experience so I don't get frustrated.

Oh I dont doubt that at all. In fact thats good. Fun when learning programming is good, it will keep you engaged.
 
Java is probably a good starting language. What you want to do is not learn by memorizing the functions native to the language you're using, but rather learn the concepts, as they will be similar (if not the same) across programming languages.

Object oriented programming fundamentals are important.. I would say a book would be good to read about the theoretical concepts.. the hands-on work will be better for learning how to deal with syntax, etc.

I also recommend some sort of editor that supports syntax highlighting. What that means is that it will make your code easier to read - so instead of trying to figure out what's what, it'll be easier for you to focus on more impotant things.
 
Back
Top Bottom