I didn't have a ready answer. After thinking about it for a while, I can list some good reasons why I prefer to work in Python, which is a dynamic language. Lately I have been writing a lot of code in C and C# (directly re-implementing Python algorithms), so I think I am in a good place to pass comment.
- Python code is ~10% the size of my equivalent C# code. This means less typing, faster prototypes and less room for bugs.
- Dynamic languages really do promote loose coupling. There is no dependence on types. This helps the programmer write re-usable code, and actually re-use it, rather than hide it away in some dusty, forgotten SVN repository...
- Python works rather well with C. It's a piece of cake to convert a Python function into C code, then call them using ctypes. This fits perfectly with an incremental development method, where a prototype can slowly be converted into C code as needed.
- Late binding lets you do some really clever stuff, and makes things like state machines very compact and easy to code and understand.
- A standard, OS independent socket implementation.
- ...hmm not much else.
Have I missed anything?
8 comments:
I think reason #1 grasps the essence why. Other points just explain how you reach it ;-)
Last week I found myself working in C# after developing a Python proof of concept.
Not only was the python code smaller but I was forced to do so many (cast)'s in C# that I seriously considered changing my name to Harry Potter.
no semi colons.
"Have I missed anything?"
Yes.
The standard library rocks.
True multi-threading.
Did you mean that Python multi-threading drawback? In the Python 2.6 there is a solution: new multiprocessing module.
The standard library rocks, again.
@jiri :
True Multithreading would be much more convenient than Multiprocessing.
We use it (so many people recommend it without having ever used it) and it is the only viable solution for a type of architecture/pb.
Still it is inferior to True Multithreading.
You missed a really big one: you don't have to wait for your code to compile each time you change something. Makes a happy programmer.
Post a Comment