Community Page
- blog.dhananjaynene.com Jump to website »
-
Subscribe -
Community
-
Top Commenters
-
Popular Threads
-
Recent Comments
- I hope you people realize how inefficient the code you've written is... After you've divided out all the 2's from the number, you still try to find out if it is divisible by...
- Boss!! and Bossess!!!! Please use perl for everything. Perl is ultimate for any purpose. Python is slow (even with psycho, pypy) and Java is over verbose. (But Java is faster) Check modperl before...
- Yes, and I needed to know. What is the smallest prime factor? I guessed around: 7 (Also, your "copy to clipboard" links don't work for me).
- There are supposed to be tab indentations. Not sure how to keep the tabs in a post
- I just wrote this code (works in python 3.0 with the special "//" for division of integers). This code is much faster and will find your prime factors. I take advantage of the fact that...
/var/log/mind
Dhananjay Nene’s free (as in free speech) opinions on all things related to Software Engineering
After having worked with Java (and earlier C++) for a number of years, I have been working with Python for the last few months. Since I came to Python from Java, I thought it might be useful to share my experiences, which might be of interest to many Java programmers. This is not inten
... Continue reading »
9 months ago
It's quite interesting to read others' experiences.
9 months ago
9 months ago
You may be interested in a tutorial I gave in 2007 at PyCon and OSCON, "Code Like a Pythonista: Idiomatic Python". Full notes here: http://python.net/~goodger/projects/pycon/2007/...
9 months ago
Nice tutorial and great references as well.
Thanks.
Dhananjay
9 months ago
nice article.I am also learning ruby although i am a java developer just for fun.
Thanks
prashant
http://www.prashantjalasutram.blogspot.com
9 months ago
You don't give any specific examples of where you found CPython to be slow (for some definition of slow), but I'd be interested to see sample code, benchmarks, and perhaps a run on Jython as well.
I spend around 50% of my time in C# (whose tools have similar refactoring capabilities to IDEs such as Eclipse), and the rest in Python. While my development environment for Python (TextMate or emacs) certainly don't have refactoring tools like Visual Studio exposes (and I suspect whatever your chosen Java IDE is also does) I've found that I simply don't need them; a search and replace answers 80% of the common cases. Can you give an example of a refactoring operation that you do with your Java tools that you missed with the Python tools?
It's probably worth mentioning that Python does have high-quality IDEs (Wing springs to mind). These may offer refactoring tools.
9 months ago
While I have conducted benchmarks on at least 10 occasions, I haven't kept records of the same. However the one time I did maintain detailed records, I documented these here : http://blog.dhananjaynene.com/2008/07/performan... , it includes a benchmark on CPython, Jython and psyco as well. I will stand by my assertion that there is indeed a substantial difference in run time performance on most counts.
An example of tough refactoring is changing the method name in a scenario where the method is being used in a class hierarchy.
9 months ago
9 months ago
9 months ago
One neat thing about Python is that if you have performance bottlenecks, you can drop down into C/C++ code to rewrite just those parts of your system that have problems. How come you don't see this approach as viable as simply writing the whole application in Java instead of Python with some parts rewritten in C?
9 months ago
I concur it is indeed a viable approach and that it is possible that I could
choose to exercise that optiion as well. I think it will indeed depend on
the nature of the application and its distribution model. I would think that
if the application hotspots are fairly localized and if it is intended to be
used in few installations, then using C/C++ indeed becomes a attractive
option.
Dhananjay
9 months ago