Critical Mass :: 3D Action Puzzle Game

Don't Like Ad's?
Click Here


Forum Index - General Chat - Python or C++?

There are 23 replies to this topic ShareIt! Text-To-Speech





+isaac
Moderator
isaac

2 years ago
I took this from a post of mine on a different forum. So far it's brought up some great posts from people.
----
For someone who's pretty new to computer programming, what would you recommend they learn? Not that you shouldn't learn the other, but someone who knows Python might not need C++ or visa-versa.

I asked a few reliable sources already.
My friend,(edit:fixed) who graduated from UT with Honors with a Bachelors of Science in Computer Science, and is working on Andorid apps and participated in the recent Netflix competition, wrote this :
Out of the two...
Quote: Python is easiest to learn.

Which, I can say, is true. Five minutes in and I was already writing small 3 line scripts that worked.

Quote: Lots of experienced programmers prefer to use Python over C++ for certain projects.

I'm not sure about this. My friend above only worked with those who knew it; he doesen't know the language himself. Lo, from ODF-online.org, does know Python and worte:

Quote: I personally, do not like python. The advantages seem to be that you can do many things much faster than with e.g. C++, you can debug it easier etc... However, pythons runtime is a mess. Also, I think C++ has far more librarys (3D engines, physics engines, netcode libraries, whatever other libraries) to use than python. You might find a workaround to access them via a C++ workaround, but why not using C++ for the whole project than?
My conclusion is, that if you just want to have a bit of fun - use Python. But for everything more, I suggest only C or C++. (My 2 Cents

However, my UT friend did show some jelousy of Python users.

Quote: You can do serious work with Python, it's not just for fun. Often times, it's better to use Python because it'll take you 20 minutes to do something that will take you 2 hours with C++.


So far, I've been reading the Python documents tutorial introduction section to better understand Python and its uses. It opens with...

Quote:
If you do much work on computers, eventually you find that there’s some task you’d like to automate.
...
Or maybe you’ve written a program that could use an extension language, and you don’t want to design and implement a whole new language for your application.
...
You could write a Unix shell script or Windows batch files for some of these tasks, but shell scripts are best at moving around files and changing text data, not well-suited for GUI applications or games. You could write a C/C++/Java program, but it can take a lot of development time to get even a first-draft program. Python is simpler to use, available on Windows, Mac OS X, and Unix operating systems, and will help you get the job done more quickly.
/quote


Thank you.

---

I've started with Python and will go into JAVA(GWT to javascript).

What do you guys think? Let's get some conversation going! octo.gif


+Jamie
Admin
Jamie

2 years ago
Neither is better than the other. It all depends on your needs. If you want to write a game engine then C++ is the most powerful language for that. However if you just want to write windows apps then Visual Basic would be fine. With out more information regarding what you want to create it is hard to say what the best language for you is.
Please support us and post a [Link to www.digitalartsfront.com] on your website.


+isaac
Moderator
isaac

2 years ago
So far Python seems like the best language for me, because I want to make small apps for school. To make a window with 100% custom tools takes very little work and very little debugging. And, I have seen it run 3d stuff.

C++ is great for games, but I read that its popularity is waining and will eventually die out, unlike its predecessor, C.
I recently found out that Python is used for the bulk of an application, like setting up the UI and tools, and C++ is compiled for the core of the application, like a 3d/physics engine.

+Jamie
Admin
Jamie

2 years ago
Well as I am currently making a game with Otter I know for a fact that we would never use Python to write a game. It is a very high level language therefor it lacks the power of something like C. As for C++ dieing I find that hard to believe. C++ allows the dev to use Strings vs Character arrays in C. C++ is just a bunch of extensions for C they are essentially the same language it's just C++ allows for things like Object Orientated Programming which is very useful when writing large applications.
Please support us and post a [Link to www.digitalartsfront.com] on your website.


+isaac
Moderator
isaac

2 years ago
Quote from Jeff250 on descentbb.net:
At the risk of being controversial, I think that C++ is almost always the wrong choice. I'd recommend learning Python, then C, in that order. Python has a great C API, so there's a lot of overlap. Both Python and C are beautiful, elegant languages that will be around for a very long time. Conversely, C++ is an ugly language that adds more warts and pitfalls to C than actual expressive power and is waning in popularity. If you're going to add the overhead, then you might as well use a programming language like Python with all the modern bells and whistles, like garbage collection, first-class functions, closures, dictionaries, and list comprehensions. In fact, describing these as "bells and whistles" is a grave understatement.

Since most applications are IO-bound, using C++ is usually a premature optimization, and even that's being generous. I'd recommend using Python, and then, if you've actually *profiled* your application and you've empirically determined that your Python bit twiddling code running in a tight loop somewhere is consuming too much processor time, then consider factoring that code into a C function or small library. I honestly can't think of anyone who would start a new project in C++.

Also, if it's personally relevant, Python will put you much more quickly onto the path of becoming a hacker.


+Jamie
Admin
Jamie

2 years ago
The only thing I can say in response to that is. I want to create games, Python has basic support for DirectX 9.0 via C++ extensions. C++ has full support for all versions of DX and OpenGL. Why would I use something that can only interface with an old API via C++ extensions when I can use C++ and interface with anything? Also I challenge you to write an application as advanced as Photoshop with Python.
Please support us and post a [Link to www.digitalartsfront.com] on your website.


+isaac
Moderator
isaac

2 years ago
You could do the API in Python, more comfortably and in less time, than in C++, from what I'm reading. But like in most things, I'm sure this depends on the person doing the work. However, Python source code looks so clear to me, and I don't even know the language yet! That's got to mean something.
Of course, I plan to learn Python, not for games, but to have a fast and powerful math tool, to avoid needing a TI calculator, ever. Moving forward, I plan to make small applications, like Mnemosyne, the flash card program, or Freemind, the mind mapping program; I think I can do better.
Edit:
In the end I want to get into hard core web development. That will put Python doing work on the server side. I don't know too much more about all of that, but that's light years away from where I stand.
Edit:
Let me just say, the more I talk about this with you the more I'm learning. Thanks.

+Jamie
Admin
Jamie

2 years ago
Yeah I have done some research and Python is very limited in terms of what it can do with a Graphics API. There is a reason why everyone uses language's like C for games programming.

In terms of writing small applications you are better of using something like Python or VB. They are simple languages that allow you to get things done but they lack power in the long run.

If you want to get involved in web development you would be better off learning PHP & MySQL I can't really see a reason why you would use Python for anything server side.
Please support us and post a [Link to www.digitalartsfront.com] on your website.


+isaac
Moderator
isaac

2 years ago
I don't know exactly how Python is used, server side, either. But, people seem to use it for all kinds of things. Just yesterday, on another forum, I was told that someone uses it on their server.

Writing quick small apps is what I would really like to do in the near future and it seems that I could inch my way into C. However, according to what you're saying, I would eventually grow out of Python and move to C/C++ or even PHP. So far, Python, with the use of its interpreter, will quickly make me be a stronger Linux user. Other languages don't seem to offer that, unless I devote lots of time into their syntax and structure.

+Jamie
Admin
Jamie

2 years ago
Yeah if you want to write apps for linux use Python. If you want to do web dev use PHP and if you want to write games use C smile.gif Simple.
Please support us and post a [Link to www.digitalartsfront.com] on your website.


+isaac
Moderator
isaac

2 years ago
That seems to sum it up, nicely.

+isaac
Moderator
isaac

2 years ago
However,

Quote from [Link to www.paulgraham.com]:
During the years we worked on Viaweb I read a lot of job descriptions. A new competitor seemed to emerge out of the woodwork every month or so. The first thing I would do, after checking to see if they had a live online demo, was look at their job listings. After a couple years of this I could tell which companies to worry about and which not to. The more of an IT flavor the job descriptions had, the less dangerous the company was. The safest kind were the ones that wanted Oracle experience. You never had to worry about those. You were also safe if they said they wanted C++ or Java developers. If they wanted Perl or Python programmers, that would be a bit frightening-- that's starting to sound like a company where the technical side, at least, is run by real hackers. If I had ever seen a job posting looking for Lisp hackers, I would have been really worried. /quote

So as far as sever code goes, Python does have a power I don't yet understand.

+Jamie
Admin
Jamie

2 years ago
I'm not exactly sure what you are referring to when you say hacking. Do you mean, understanding how systems work and learning to exploit and change them? If this is what you are interested in then Python and Perl are the languages of choice. However, I am not in anyway endorsing any form of illegal behavior.

Is that what you are looking to do? do you want to be a hacker or a programmer?

Please support us and post a [Link to www.digitalartsfront.com] on your website.


+isaac
Moderator
isaac

2 years ago
No hacking doesn't have to be illegal.
Quote: A person who enjoys exploring the details of programmable systems and how to stretch their capabilities, as opposed to most users, who prefer to learn only the minimum necessary. RFC1392, the Internet Users' Glossary, usefully amplifies this as: A person who delights in having an intimate understanding of the internal workings of a system, computers and computer networks in particular.

You may have missed the point of the quote and I recommend reading the whole article.

+Jamie
Admin
Jamie

2 years ago
Yeah I know hacking ins't illegal. But when most people refer to it they are referring to the illegal form of hacking. However there is a difference between a programmer and a hacker and that is the the question I asked.

Do you want to be a hacker or a programmer?
Please support us and post a [Link to www.digitalartsfront.com] on your website.


+isaac
Moderator
isaac

2 years ago
Ah! Programmer. I don't have any interest in arm wrestling with other people's code if I can write my own apps.

+Jamie
Admin
Jamie

2 years ago
Ok then well I would start with Python and then move up to C later when you feel confident.
Please support us and post a [Link to www.digitalartsfront.com] on your website.


+isaac
Moderator
isaac

2 years ago
I strongly agree, by my current low level of knowledge on this subject.

+VarnishedOtter
Admin
VarnishedOtter

2 years ago
For web, I don't think you can do better than PHP.

Structurally its alot like C++ or JAVA, they share many many function names and all of your conditional statements are identical (eg, if, switch, while, for).

Plus there are so many built in libraries, like mysql, curl, gd, zlib, sockets, sessions etc. to name a few. Pretty much anything you will ever need for a web app has either a built-in library or an easily available one. This means that writing apps is so quick because most of the work is already done for you.

Plus PHP is supported and installed by default on pretty much all linux web servers (unless you request that it not be).

On a different note, I dont know what the linux equivalent of VB is, or even if there is one. I use linux every day and havent even touched a linux GUI in about 5 years. For simple (and some not so simple) desktop apps on windows you cant beat VB for speed of production.

Example: Just the other day jamie asked me to write an app that was an alarm clock that could hold an unlimited list of alarms to go off at set points through the day and display individual messages. It was written and polish with a full windows GUI for managing the alarms in under an hour.

If theres something like this for linux, that would be an option to look at.

I know I promoted C++ in my previous post, but I forgot to mention that I wouldn't learn it as a first language. It will frustrate the hell out of you. If you were to learn a language with a similar code layout, like PHP for example and then switch to C I think you would find it alot easier.
Please support us and post a [Link to www.digitalartsfront.com] on your website.

--Matt

+isaac
Moderator
isaac

2 years ago
As for code that runs on the server I understand you can use whatever you want and get away with it.
Here's a cool article on Lisp being used to smash Yahoo's competition:
[Link to www.paulgraham.com]

So as far as the server goes, the only rule is, there are no rules.

Yeah, PHP/Ajax are one of those monsters that I think will be impossible to avoid. Even the all mighty GWT takes advantage of its resources.

I think VB is an M$ thing, but I could be wrong.

+VarnishedOtter
Admin
VarnishedOtter

2 years ago
Yeah VB is Microsoft. Ajax is not a language you have to learn, its a method of programming, usually people use javascript to do it.

Most people don't realize, PHP isnt just a server-side web programming language.

I use it for crons, and other console apps. I've written socket servers with it, msn clients, port scanners, spiders and robots etc.
Please support us and post a [Link to www.digitalartsfront.com] on your website.

--Matt

+isaac
Moderator
isaac

2 years ago
I've got about 10 pounds, in weight, worth of PHP tutorials, printed from the internet. I couldn't stand learning it, though. It drove me nuts.

+VarnishedOtter
Admin
VarnishedOtter

2 years ago
I've never used python so I cant really give much input there.

But I can say this, C++ is definitely the most powerful language I have used. It is however a pain in the arse to debug, is horribly anal about data types and generally a bit confusing when working with multiple files.

On the other hand its analness makes you think properly about your decisions and you end up writing better more optimized code.


Please support us and post a [Link to www.digitalartsfront.com] on your website.

--Matt

+isaac
Moderator
isaac

2 years ago
That's true, and the reason why I'm thinking of getting some experience in it, much farther down the road.

Top

Critical Mass :: 3D Action Puzzle Game

Don't Like Ad's?
Click Here