I would love to hear from a Python user, in his words, what are the language features that make Python a good language Also, have you ever used Python as an embedded language for a C++ application?
mrtwo, C++ has many fine qualities and many serious shortcomings. If you want better insight into its strengths and weaknesses, it is not enough to just be a good C++ programmer. You have to be fluent in at least one of its serious competitors, modern higher level programming languages like Java, Ruby, Python, or Smalltalk. Certainly more fluent programmers produce better, cleaner, faster code in any language. But people who have broad experience with many programming languages recognize that different languages are better suited for different tasks and purposes. No amount of fluency can justify using a language that is poorly suited for the task. C/C++ will be around for a long time. System programming will be done in C for the forseeable future. But the use of C/C++ for application programming is clearly on the wane, and rightly so. Martin
www.python.org That's for me like putting the clock back for some years. I never had the need for this. In my 2 year Python experience I mostly wrote new code - exclusively for trading and charting. If you want to explore this further, look at the above url. Searching: http://groups.google.com/group/comp.lang.python?lnk=gschg&hl=en will also often help. Further look at Martelli & Ascher "Python Cookbook, 1st Edition", chapter 16. I embedded a few times some C++ code into Python though.
I agree wholeheartedly with this last assertion. I have been a software engineer for 20+ years, and it is still amazing to me the number of people that get overly emotional, "proselytizing" attitudes about their particular language of preference. For some reason, historically these have tended to be people that are really fond of UNIX (Linux these days), Perl and lately Python. They also tend to be anti-Windows zealots as well. Not that I think Microsoft is the answer to everything, but some of this anti-Windows crap is just nonsense. Anyways, back to the C++/Python question. It is possible to write really complicated, bug-ridden crap code in C++ - it is also possible to write really tight, elegant, well-designed bug-free code in C++. The whole thing comes down to SOFTWARE DESIGN, understanding how to approach the problem being solved with an object-oriented approach, understanding how to properly create boundaries between subroutines, objects, and modules, understanding the performance requirements of the system, understanding what other hardware, software, databases, and/or protocols may be involved in the project, whether the code will be application and/or server-based, whether or not it needs to have real-time performance, and using the best tools for the job at hand. The primary benefits to C++ are speed and flexibility. You can do just about anything with it, and coded correctly it is quite fast. It also gives you direct "control" over things when you want it to. It is quite powerful, and can be multi-threaded under programmer control. The drawbacks to C++ are that it is not overly "strict" in enforcing good design (not strongly typed), thus allowing for newbies, hackers and seat-of-the-pants coders (NOT software engineers) to think they have solved a problem by creating error-free syntax, but still create messy, spaghetti code with numerous nightmarish bugs involving improper modularization, nonthread-safe code, pointer nightmares, timing problems, etc. If a person cannot create quality C++ code, but can code correctly in Python, then you know that they are not really aware of a lot of the things going on "under the hood" and are really probably more of a "coder" than an engineer. If they can code C++ well, and Python also, then more power to them when they are solving problems which are not real-time in nature. But arbitrarily preferring Python to C++ is not a correct approach in all cases.
I hope you're being sarcastic. Python is nothing like C++. The type system, object model, scoping, execution model... all completely different. The syntax has some common elements but that's about the extent of it. Martin
You know, you do have a point Martin. Also, the thing with C/C++ is that it requires a steep initial investment to get it to a 'useable' level. If I was starting a new team today and If we didnt have all the libraries and standard pratices we now have in place, I am not so sure we would be walking down the C/C++ road. Now, that leads to another interesting question for everyone: If you were stripped of all 'investment' you made in a certain platform/language, would you make the same choices again?
Agreed. It just takes a lot more time and effort to write tight, elegant, well-designed, bug-free code in C++ than in a modern high-level programming language. This isn't a matter of fluency. I've been writing C++ code for 20 years and Python code for 2 years. I'm far more productive in Python. It is a simple tradeoff between the programmer's time and the computer's time. I know whose time I'd rather waste. Martin
I would like to hear your subjective experience though. What was the tipping point for you, why did you chose Python over all other options? I am pretty sure you can name a few things that you saw in Python that 'did it' for you and that if shared, it could make people consider giving it a try
Glad to hear that Yes, it seems like there is always some tension when people talk about programming languages or operating systems. It is an interesting case of 'people serving technology' instead of the expected 'technology serving people' Your 'coder' vs 'engineer' comment was brilliant btw.
I understand your objection. As a language, Python is indeed very much different. I meant to say that Python was written using the internal code constructs of the C++ language. This fact though is of much benefit as it greatly facilitates passing from Python to C/C++ as needed. If you want to explore this further, plenty has been written by the many people active in developing Python. Last but not least: Guido Van Rossum. As usual with language threads, a lot of gratuitous wisecracking has been going on in this thread. Many of these dogmatists are obviously beyond help. Python.org publishes a list of quotes which may be useful to some: http://www.python.org/about/quotes/