|
Re: Are Dynamic Languages Going to Replace Static Languages?
|
Posted: May 1, 2003 12:15 PM
|
|
> I have kind of been kicking around the > idea of developing a "system" in Python, but haven't tried > it yet. I won't really know how I'll feel about building a > system with a dynamically typed language until I actually > try that.
And that is exactly what you must do.
For two years I used Python as you have described in your commentaries: as a nice scripting language, but not using OO features or multiple files, and not for "system" development.
Then I stumbled into a large system project that seemed to require Python for a couple of key components that needed to be user-scriptable. I decided to try writing it all in Python and see how far I got. That is when my programming life changed. I can't overestimate how much developing a 3-tier, multi-user, distributed application in Python changed my perspective. In about 7,000 lines of Python code I created a very complex data collection and analysis system that would have taken (based on experience) ~50,000 lines of C++ or maybe ~30,000 lines of Java. The development was so much faster, more intuitive, and closer to the user domain.
Python also gently introduced me to using functional programming in a real-world program. Using Prolog or Scheme is kind of fun, but it's hard to interface with real-world toolkits, etc. Python's slight functional slant encourages using functional paradigms in domain-specific areas where they make sense, while still having the flexibility and toolkits of a widely used procedural language.
I always planned to replace any slow modules of the system with C++ extensions, but I never found any that merited it. I did write a C++ extension for doing threaded serial port access, since I needed more than Python's platform-independent threading library could provide.
A poster to comp.lang.py recently said something to the effect of, "Programming in C++ is premature optization." I couldn't agree more.
So, please write your next large system in Python. It will change your life.
Chad Harrington
|
|