How to become a JavaRSS member on blogger.com
The trick is to create a post with the javarss image and to use the link generated by blogger.com to display the image. Then you can follow the rules from http://www.javarss.com/pages/?page=suggest
The trick is to create a post with the javarss image and to use the link generated by blogger.com to display the image. Then you can follow the rules from http://www.javarss.com/pages/?page=suggest
I have been doing some Ruby On Rails, for 2 small projects. While I think it is good, I think it is overhyped as well. It is well designed, has good ideas (easy configuration), and focus on the right problem, architecture. But my conclusion is that I am not more productive with it than with Java.
I think most of the development time is not spent coding, but thinking. It is a very obvious statement, and yet too often ignored.
The current Joel On Software article is just making my point: if you look at how much time it took the students to complete their program, you can see it is not the writing that took that much time. And I am sure you noticed the same on your own projects.
So all the nice features of the Ruby language don’t save you a lot of time. And actually when your code size is growing, it becomes increasingly difficult for an outsider to understand your program. Everything can be so dynamic, and your only help is a syntax coloring editor. Compare that to Eclipse, or IDEA, or Netbeans, where you have very convenient search, not text search, but search for declarations, for calls, of methods, variables, classes, all that just a mouse click away. Strong typing goes a little bit in the way while writing, but helps understanding better in many cases (personally I wish Java had type inference, as all the verbosity is not always needed). And when if you really want less verbosity, then you have access to a handful of JVM languages.
A drawback of Java is maybe that you have access to too many libraries. Sometimes, making a choice among the bazaar is not easy and the hype gets scattered.
Simple benchmark but with interesting comments here:
Some of the conclusions are:
It would have been interesting to benchmark interpreted languages for the JVM.
Now for most projects, architecture, not language is key in achieving good performance.
# call jython make.py method1 method2, ...
# to invoke method1 and then method2, ...
import sys, os, os.path, shutil, urllib, base64, re
web_dir = 'web'
webapp_name = 'myrestaurant'
tomcat_dir = 'c:/java/Tomcat 5.5'
#copy web directory to tomcat app dir
def deploy():
target_dir = tomcat_dir+'/webapps'+'/'+webapp_name
copier=LatestTreeCopier()
copier.copytree(web_dir,target_dir)
print "copied %s file(s) to %s" % (copier.count,target_dir)
#reload tomcat web application
def reload():
url = "http://localhost:8080/manager/reload?path=/"+webapp_name
base64string = base64.encodestring("%s:%s"%('michelin','michelin'))[:-1]
opener = urllib.URLopener()
opener.addheader('Authorization',"Basic %s"%base64string)
h = opener.open(url)
print h.read()
h.close()
class TreeCopier:
def __init__(self):
self.count = 0
def filter(self, srcname, dstname):
return true
def filterDir(self, srcname):
return true
def copytree(self, src, dst, symlinks=0):
"""Recursively copy a directory tree using copy2().
"""
names = os.listdir(src)
if not os.path.exists(dst):
os.mkdir(dst)
count = 0
for name in names:
srcname = os.path.join(src, name)
dstname = os.path.join(dst, name)
try:
if symlinks and os.path.islink(srcname):
linkto = os.readlink(srcname)
os.symlink(linkto, dstname)
elif os.path.isdir(srcname):
if self.filterDir(srcname):
self.copytree(srcname, dstname, symlinks)
else:
if self.filter(srcname, dstname):
shutil.copy2(srcname, dstname)
print srcname
count += 1
except (IOError, os.error), why:
print "Can't copy %s to %s: %s"%('srcname', 'dstname', str(why))
self.count += count
class LatestTreeCopier(TreeCopier):
def __init__(self):
self.count = 0
self.excludePattern = re.compile(
'(^\.svn.*|.*\.swp$|.*\.bak$|.*~$|.*\.swo$)',re.I)
self.excludeDirPattern = re.compile('^\.svn.*',re.I)
def filter(self, srcname, dstname):
return (not self.excludePattern.match(os.path.basename(srcname)))
and (os.path.getmtime(srcname) > os.path.getmtime(dstname))
def filterDir(self, srcname):
return (not self.excludeDirPattern.match(os.path.basename(srcname)))
if __name__ == "__main__":
if (len(sys.argv)) >= 2:
methods = sys.argv[1:]
for m in methods:
method = m+'()'
print "launching %s" % method
eval(method)
else:
deploy()
reload()
When Ant came out, I welcomed it. It was better than Makefiles for Java, it solved the path and classpath format difference between Windows and Linux, did not rely on shell programs. It did provide a platform independent way for building Java software. At that time, there was another alternative, JMK which had a lisp like syntax, and solved the same problems as Ant. But Ant was backed by apache, and this were the times of XML everywhere. I got more and more fed up with ant scripts over the years. During a long time you had to resort to an XML trick just to include other ant file, you did not have conditionals, but more importantly, it is quite a pain to write long ant scripts in XML. XML is not that good to write logic with, XSLT did not become as big as it could have been partly for this reason.
Recently, Java IDEs (Eclipse) have made Java coding really comfortable, but why is it that for each project, you need to have to setup your project classpath, build, and write an ant script that does the same? In many companies I have seen ant scripts taking minutes to do a build in order to test your latest modification. This is crazy when it took a few seconds to eclipse to compile it, and it’s already compiled, so why not using that output for testing your development? Ant, despite its codebase and age, does not do much: it does not calculate dependencies, it leaves that to the java compiler, it does not keep checksums of files to check if one has changed, it just uses file system dates (which can be a problem if you retrieve an older version of some file).
Now I am using a Jython script that justs copies my eclipse build and packages it appropriately, it works well, it is fast, it is flexible (all the power of python), and platform independent. You need to be a bit careful how you choose to design your Jython script, but hey, even with Ant limitations on messing everything around, I have seen so many awful Ant scripts.
