Which of the 250 major computer languages are you learning? I need some idea so I can compare.
vegaseat
DaniWeb's Hypocrite
5,989 posts since Oct 2004
Reputation Points: 1,345
Solved Threads: 1,417
I use both C++ and Python and came up with this ...
My 13 point comparison of C++ and Python:
1. C++ and Python complement each other.
2. Maybe C++ is the piano and Python is the guitar.
3. C++ is a low level language and Python is a high level language (more modular).
4. You can write Python programs in just a few lines that would require pages in C++.
5. C++ requires type declarations and Python avoids type declarations.
6. Python containers are simpler and more flexible than C++ containers.
7. Python allows for easier experimentation/concept-development than C++.
8. C++ is compiled to an executable file and Python is compiled and then interpreted.
9. Python has an interactive page where you can quickly test ideas.
10. C++ is more difficult to master than Python. Python code is easier to read.
11. Both C++ and Python are object oriented.
12. Both C++ and Python work on multiple platforms (Windows, Unix, VMS etc).
13. C++ can be and Python is open source.
Edit: You may want to add ...
C++ is prone to memory leaks if you forget to free up used resources, Python has automatic memory management.
vegaseat
DaniWeb's Hypocrite
5,989 posts since Oct 2004
Reputation Points: 1,345
Solved Threads: 1,417
The Python text code file .py is compiled to a .pyc byte code file that speeds up the interpretation process. Most of the time this is transparent to you. There are ways to retain the .pyc file and use it for higher speed.
Python itself uses the compiled files to speed things up. Look in your \Lib folder, there are both .py and .pyc files. the compiled files are not readable with a text editor.
Edit: You made me think about it some more and it finally came back. For ordinary .py code files the bytecode image of the .pyc file is created in memory. That's why you don't find them on the disk. You can force the creation of a .pyc file on disk, if you import the file in another program. Just write a short test program with the line:
import myPyFile # converts myPyFile.py to myPyFile.pyc
You can distribute your .pyc file instead of the .py file, if you want to hide your source code a little.
vegaseat
DaniWeb's Hypocrite
5,989 posts since Oct 2004
Reputation Points: 1,345
Solved Threads: 1,417
Python is my first language I am learning, other then some bash scripting. I am really enjoying it.
I am a big open source(linux) guy, so i was attracted to python for that reason. I also like the fact I can write a program that will run on both linux and windows alike(there may be some porting issues, I am still learning)
There shouldn't be too many porting issues-- Python was designed ground-up to work with any platform. Unless you start fooling around with GTK or Tk/Tcl, etc, then you'll be in good shape. Even with the previously mentioned setups, you can still make them work in Windows.
alc6379
Cookie... That's it
2,820 posts since Dec 2003
Reputation Points: 186
Solved Threads: 147
Well I've only ever learned two languages. HTML and Python. HTML and Python don't really compare because they do two totally different things. But I still give Python a big thumbs up it's easy to use and somewhat integratable. Just like HTML.
danizzil14
Junior Poster in Training
68 posts since Jul 2005
Reputation Points: 16
Solved Threads: 1
Python looks like fun.
Got some books on it and can read it pretty well, didn't spend much time on it so far (too busy with Java).
jwenting
duckman
8,392 posts since Nov 2004
Reputation Points: 1,662
Solved Threads: 337
Every day i learn py, I see it doing many things and from what I can see, it can do anything. Anyway i plan to do my massive code for my project sometime this year! For now there are some things I must learn!!
Happy Py Programming!
evstevemd
Senior Poster
3,713 posts since Jun 2007
Reputation Points: 462
Solved Threads: 392