4 ms·
I've had experience with both Java and Python, so I know how you feel. At MIT, most classes in CS are taught in Python for this very reason: the idiomatic-style
by systemizer 15y ago
I've had experience with both Java and Python, so I know how you feel. At MIT, most classes in CS are taught in Python for this very reason: the idiomatic-style and overly verbose syntax of Java detracts from learning pure CS logic.
Sure, using python abstracts away a lot of things (e.g. memory management, type settings, etc.), and some might argue you have less freedom in python, but in the end, python is much closer to "logic" than java. Each line contributes to the logical flow of the program.
That being said, python is a language to write something up quick, prototype an idea, put up a simple webserver. However, when your program must scale or if you're trying to optimise for speed, you should highly consider java. The code will be more verbose, but you will pick up a tremendous speed increase.
I'm sure those of you who are hard-core Java programmers will disagree in some sense, so please leave your thoughts.
- owenmarshall 15y ago>That being said, python is a language to write something up quick, prototype an idea, put up a simple webserver. However, when your program must scale or if you're trying to optimise for speed, you should highly consider java. The code will be more verbose, but you will pick up a tremendous speed increase. If your Python application is slow, you can throw hardware at it. That's easy & cheap. If your Java application development cycle is slow, good luck -- you cannot just throw programmers at the problem. It's almost always better to have fast programmers than a fast application.
- igouy 15y ago> It's almost always better to have fast programmers than a fast application. So I guess algorithms just don't matter.
- akavi 15y agoI'm not sure I understand how choice of programming language affects choice of algorithm.
- owenmarshall 15y agoSelecting a language that lets you develop quickly over a "fast language" is orthogonal to selecting algorithms. Is there a reason you believe them to be related? Or, did you repost one line of my comment without any context and expect to make a salient point?
- SoftwareMaven 15y agoThere are a LOT of variables in that performance equation. A lot of numerical analysis happens in Python, where speed is critical (see NumPy and SciPy). Web-based applications have so many potential bottlenecks that python rarely starts as the bottleneck and there are ways around many of them (multiple processes, etc). The problem I have with Java (and this comes with 10 years of writing appps in Java) is that it so slow. By slow, I mean slow to get anything implemented. Everything takes a long time to build. Depending on your company, that can be the biggest performance problem of them all!
- pmiller2 15y agoI'd argue that doing numerical analysis with NumPy or SciPy isn't really "numerical analysis in Python." It's numerical analysis routines in C being called from Python.