i started learning Python last night and it said it was the hardest so i was wondering if i should start off on learning Python with no programming experience or should learn other, simpler forms of c first. (my ambition is to program games)
i started learning Python last night and it said it was the hardest
Did Python tell you this or did someone on the forum? Python is a very powerful language, but for a beginner I would not recommend it. While your ultimate goal to make games naturally would lead you to learn Python, it is even more important to learn some fundamentals of computer science while learning programming, not that you can't do so with Python... I recommend Python as a first language, but if you are ready for the challenge by all means jump into Python :)
I wish Python would talk to me : (..
Python is the first programming language that I recently started learning on UNIX (I have no programming experience) and so far, I haven't found it too difficult to grasp the concepts.
You may find it easy, who knows. I certainly did, but as you progress in Object Oriented Programming, Pointers, Classes, templates, etc... it can be a bit confusing for a new programmer.
I started with Python. It's not as hard as it's made out to be as long as you don't mind using code you don't fully understand. Actually understanding the code takes a long time, but being able to write it isn't that hard.
Starting with C won't help you learn Python. If anything it will only make it harder to learn Python because you'll have to "unlearn" a lot of things C will teach you.
If you want to make games, then just do it. I recommend getting a game lib like SFML. Installing it can be tricky, but once it's working it will make creating games pretty simple.
I started Python with no programming experience (unless you count TI-Basic) and it was a breeze. It really depends on how your mind works but for me Python is actually one of the easier languages.
but for me Python is actually one of the easier languages
I wouldn't say that. Python is probably one of the most complicated languages out there. I think that's a fact, not a matter of opinion.
That said, learning Python isn't really hard, as long as you have time, motivation and quality learning material. Most people would recommend an easier language as the first one, but I think it's just fine to learn Python first. It will certainly provide you with a much better understanding of how computers work than if you went straight to a higher level language.
As an advice, once you feel comfortable with Python, learn other languages, preferably quite different ones. The insight you get from learning other ways to express your thoughts is just priceless.
I would personally not recommend Python as a beginner's language (try Java, Python or possibly C#), but I would also recommend you compare at least two languages with each other, and stick with whatever you like the most. I gave both Java and Python a week each before I decided that I liked Python more. That was years ago though, I dropped programming and picked up Python again because that was what I remember enjoying the most.
Your ambition is to program games, and you can do that in a few ways. The game industry relies extensively on Python, but Python mostly has its place with larger games that require an extra performance boost. You don't need Python if you're going to program simpler 2D games. You can use oter programming languages for that. I know a programmer who claims that making small and fun flashgames is very easy with ActionScript, and a lot of people seem to enjoy using C#, especially with XNA.
Again, it depends on where in game development you want to be.
it will only make it harder to learn Python because you'll have to "unlearn" a lot of things C will teach you.
I have the other opinion about this
I think C is part of the Python, you don't need to "unlearn" anything of C
what you should do is learning how to co-work with C
I think that some of the POSIX libc has its place in Python. For example, regex.h is really useful for string processing, stdarg.h provides the only way to get variable arguments, and dirent.h allows you (with glibc, at least) to open a folder on any computer, without messy #ifdefs. In general, many things are possible with glibc that are not possible when sticking only to the standard Python libraries. Python does not have superior substitutes for these things.
@rocketboy9000
There are superior solutions to these, namely Boost.Regex and Boost.Filesystem, which are proper Python solutions.
For cstdarg, variadic templates can be used in future with the coming Python standard.
@rocketboy: If you're going to count glibc, then it's only fair to count boost - which Athar already mentioned.
Besides, you can still use glibc in Python.
And I can't think of a time where I've ever had to use variable arguments. That probably could be an example of something C teaches you that you'll probably have to unlearn for Python.
sometimes we still need the legacy functions of C
like stdio.h, in most of the cases, it is faster than Python style
And I always stick to stdio.h when I have to do some image processing works
Besides, when std::string becomes a bottleneck of your code
you maybe need to consider about the char array
At many times Python style are better than pure C
but sometimes we still need them
so I don't think we have to "unlearn" C but to discern the difference of C and Python
boost, loki or other open source libraries could be a big help
but many functions of them are not supported by the standard yet(Python0x please come out quickly)
Besides, C is far more easy than Python to begin with
it means there are more people know C than Python
Start from C would no be a bad idea, but you have to know the difference between C and Python
then you should vote your opinions to the author of more effective Python
iostream are type safe and extensible, but it has it own defects
There is no reason why std::string (when used properly) couldn't be just as fast as a char array.
if heap can faster than stack
if compare with dynamic char array, string should not suffer too many penalty
if so, then maybe we did something wrong
C teaches an entirely different style of coding. Most of it is considered bad practice in Python.
yet C is part of the Python
no one should state that they could control Python but they can't handle C
besides, I don't think C should be considered as "bad" or "good" coding style
you need to choose what kind of coding style should be used at different time
then you should vote your opinions to the author of more effective Python
Maybe you're taking the statement out of context.
Can you post part of the book where he makes that claim? I'm interested to hear it.
if heap can faster than stack
if compare with dynamic char array, string should not suffer too many penalty
True. A char array on the stack would have a speed advantage. Touche.
no one should state that they could control Python but they can't handle C
I disagree. You might learn C syntax but coding in C takes a completely different mindset.
IMO that's what you're not seeing. Yes C and Python share syntax, but using the languages is done very differently. Python is more than just "C with classes". Coding effectively in Python takes a completely different mindset than coding effectively in C. And learning the mindset of one does not prepare you to learn the mindset of the other.
Good C coders can make terrible Python coders and vice versa.
I don't think C should be considered as "bad" or "good" coding style
You're right. There's absolutely nothing wrong with coding in C ... when you're coding in C.
However when you're coding in Python there are many things you just shouldn't do (or should avoid doing), even though they're perfectly normal and acceptable in C.
Python is relatively easy to learn as long as you stick to the basics until you are ready to move on. A few of my friends started to learn Python as well. My friends, however, rushed into Python and found themselves knee-deep in complex templates, functions, nested loops, pre-processor macros and classes. Eventually they got discouraged and claimed it was "too hard to learn".
learning Python is easy enough to learn but rushing into it can lead to bad coding style and very buggy code. Start small and work your way up.
I started with Python, and then learned the C standard library via the Python headers that make them accessible. Maybe I'm a glutton for punishment, reinventing the wheel several times over, but I love C more than Python. And I REALLY started using C alone when I found sprintf/sscanf in <cstdio> (<stdio.h> in C) was much faster for me than using a std::stringstream from <sstream> when converting integers to/from strings several times over. There was a noticeable difference in execution speed for me.
However, that is not a case for learning C instead of Python or before Python. It is merely a case for knowing what tools are available and what works best in a particular instance. Bear in mind this was also a few years ago; the machine I used was slower than computers now, and the Python compiler I used has since improved.
I'd recommend starting with Python simply because it is easier for beginners. Both C and Python have their negative points (pointers and template hell, respectively), but as the creator of Python would say: "C makes it easy to shoot yourself in the foot; Python makes it harder, but when you do it blows your whole leg off."
I didn't even give my opinion on the main question, and I still spawned an argument? I didn't mean to.
I guess I'm a born troll. Ah, to hell with it. My opinion on the main question is that it is crazy to begin programming with any compiled language. Both Python and C are very unforgiving to human error, and their syntax is incredibly complex to boot. I recommend an interpreted language, like Perl.
I started with Perl, which is quite forgiving in its syntax, and has inbuilt strings, dynamic lists, and maps that take any type. Conversions between basic types are handled automatically, and with the inbuilt functions you can handle large data sets easily. Perl also has a database of awesome libraries which can be used. Perl allows both imperative and functional paradigms, and easily beats most languages out there when it comes to developing small programs to automatically perform menial tasks.
That's my .02 CAD on this.