Idea for a small project, should you use Python?
I have a project idea, but I'm not sure if using Python would be a good idea.
First, I am a C ++ and C # developer with some SQL experience. My day job is C ++. I have a project idea that I would like to create and was considering developing it in a language that I do not know. Python seems to be popular and has piqued my interests. I am definitely using OOP in programming, and I understand that Python will do a great job with this style. I could get away from this, I just read little bits about the language.
The project will not be public or anything else, just something like my own creation, which will be done at home.
This way the project will be a simple game that I have. The game will consist of something like these:
- Data structures for storing specific information (will be strictly typed).
- A way to display the game for players. It's completely in the air, it can be graphic or text, I don't care at the moment.
- A method for storing game data for players in the form of a database or file system.
- A relatively simple way to enter information and a "GO" button that handles the changes and obviously creates a new game mode.
- The game will be similar to a board game.
Nothing really out of the ordinary when I look back at this list. Will this be a fun way to learn Python or should I choose another language?
a source to share
Python seems to be very suitable for your purposes (for example, pygame
other popular third party extensions make it easy to achieve nice graphics, and also you can opt curses
for structured text I / O, etc.) with one exception, which is what you probably have in mind by "strongly typed".
Python is strongly typed (you can't mistakenly use a string for an operation that requires an integer, and vice versa), but it's dynamic strong typing: every object has a strong type, but names (in a broad sense, including names, compound names, elements in containers, ...) have no types - every name refers to an object, an object has a type, not a name. You can reassign a name to another object and that object can have a different (strong ;-) type than any object previously associated with the same name.
All dynamic languages ββhave this symbol, although many go further than Python in "type blur" (confusing strings and numbers and different numbers of numbers, while Python separates integer strings from floating point numbers, for example ) - Python is pretty picky ... in a dynamic sense, where names are essentially typeless, though; -).
a source to share
I've already voted on del boy's answer, but I'd like to go further and say that if your goals are (1) to have fun, (2) to learn a new language, and (3) to write your own game, then Python is a corny, hassle-free, great choice for achieving all three.
The language beats anything you seem to be looking for (see Alex Martelli's answer for a caveat about strong typing), and in my opinion it is not very much a "stretch" from the C family (I think you will find most things easier, not weird) compared to other good languages ββlike Ruby or Lua.
a source to share
Ok if you are doing C ++ / C # I would say go for it - I personally love C ++ because it is (in my opinion) self-intuitive and lightweight. Python's "grammar" doesn't make much sense. Also, if you already know another language, why learn Python for fun? My point is that if you want to create a simple project for fun, it really isn't worth it, and you will at least work for a few weeks before you can start playing. So yes, you should definitely use C ++.
However, if you are just trying to learn a new language, there is nothing wrong with that; Python is definitely quite popular. Javascript is pretty straightforward as it uses automatic output and all that jazz.
a source to share