Showing posts with label Java. Show all posts
Showing posts with label Java. Show all posts
Friday, October 15, 2010
Code Smell
Can I count any Java class with the string "Util" in its name as smelly code? Helper classes, utility classes, they all scream. "I am Not Writing Object Oriented Code!"
Monday, October 11, 2010
I Need a Protocol Droid
"What I really need is a droid who understands the binary language of moisture evaporators." - Uncle Owen (Star Wars - The Real Movie)
Working in software development, I am continually inflicted with the latest open source scheme to transform the way we program computers. Someone in the organization decides that WidgetScam 2.1 will make waterfall, procedural, proprietary coding a thing of the past.
First off, there is some resume padding going on - software architects recommend to management the latest thing so that they can put it on their resume inspite of the fact that it will make the comopany no more productive or profitable. Relatedly, I believe that there is an ego factor whereby individual programmers need to feel like they are on the cutting edge. Me, I am old fashioned. I take pride in being a pretty good debugger and in being able to produce decent code that solves the needs of the customer (remember them?)
One amusing thing about this technological arms race is that we install all the new jars and dlls on our laptops and then keep programming the way we always have. Don't get me wong. I like programming in Java. It has some nice properties but Object Oriented Programming was sold as a complete paradigm shift in IT. Have you looked at any Java code recently? Most of it is dressed up C. Most programmers are writing procedural code in .java files. Of course, it works. It does what the specs require (most of the time) but there is no way that the advertised benefits of OO are going to realized.
So where are we now. I spend my days trying to install (and re-install, and re-re-install) software development tools on my cutting edge laptop all the while trying to balance my 64-bit vs 32-bit apps, the programs that require Java 1.5 vs those on 1.6 and the three different document repositories our company is using (Wiki vs network drive vs Alfresco). My industry is approaching the point where two systems will not be able to share information without an intervening layer that is more expensive, cumbersome and annoying than a protocol droid. Sometimes I wish we all just had R2 units. They aren't real shiny but they seem to get the job done.
Thursday, April 17, 2008
I knew him, Horatio
The other day I found myself wondering what would replace Java as a programming language. Many are so entrenched in Java (or the latest cool new tool) that they just ignore the fact that all things come to an end. C seemed so entrenched that it was hard to imagine anything else eclipsing it (no pun intended).
What got me thinking about this was my philosophical frustration with String vs StringBuffer. String is the base class for handling text but to do anything even as banal as concatenation, you are supposed to use StringBuffer. I understand that immutable Strings were introduced for efficiency but they lie like a pustule festering in the heart of the language. Nothing will ever make them elegant.
And now we have Annotations in Java 5 (or is it Java 1.5?) We are told that XML is banished and deployment descriptors are a thing of the past (see here). The trend now is to entangle your code with deployment information (WebService and Entity annotations). Ironically, the instructor in the Core Spring class I recently took tried to sell us on the ways that Aspect Oriented Programming would disentangle our code. He followed this up by indicating all the Spring-specific annotations that we should add to our code! I can't escape the feeling that we are going to be deluged with new annotations when every framework will insist on their own, unique attributes. In order to port our so-called POJO to a newly released framework (or new version of an old one) we are expected to recompile our code. Imagine the stack of Annotations required to make our Plain Old Java Object deployable on the wide variety of possible environments our clients may be using. Alternatively we could try to tell CitiGroup that they have to use the technology that we chose to Annotate. Good luck! This smells like an attempt to solve a short-term problem (That Evil XML) with a long-term solution.
In Java 1.7, there is talk of multiple object return types. This may be the final sign that Java has Jumped the Shark. Are the developers of the language compelled to pile more and more stuff on the specifications to show that the language is growing or something.
And thus begins the gradual decline of Java.
What got me thinking about this was my philosophical frustration with String vs StringBuffer. String is the base class for handling text but to do anything even as banal as concatenation, you are supposed to use StringBuffer. I understand that immutable Strings were introduced for efficiency but they lie like a pustule festering in the heart of the language. Nothing will ever make them elegant.
And now we have Annotations in Java 5 (or is it Java 1.5?) We are told that XML is banished and deployment descriptors are a thing of the past (see here). The trend now is to entangle your code with deployment information (WebService and Entity annotations). Ironically, the instructor in the Core Spring class I recently took tried to sell us on the ways that Aspect Oriented Programming would disentangle our code. He followed this up by indicating all the Spring-specific annotations that we should add to our code! I can't escape the feeling that we are going to be deluged with new annotations when every framework will insist on their own, unique attributes. In order to port our so-called POJO to a newly released framework (or new version of an old one) we are expected to recompile our code. Imagine the stack of Annotations required to make our Plain Old Java Object deployable on the wide variety of possible environments our clients may be using. Alternatively we could try to tell CitiGroup that they have to use the technology that we chose to Annotate. Good luck! This smells like an attempt to solve a short-term problem (That Evil XML) with a long-term solution.
In Java 1.7, there is talk of multiple object return types. This may be the final sign that Java has Jumped the Shark. Are the developers of the language compelled to pile more and more stuff on the specifications to show that the language is growing or something.
And thus begins the gradual decline of Java.
More Stupid Programmer Tricks
Am I dense or just not one of the cool kids?
This is from JAX-WS FAQ page (https://jax-ws.dev.java.net/faq/index.html#jaxwsdiffJaxRpc)
This is from JAX-WS FAQ page (https://jax-ws.dev.java.net/faq/index.html#jaxwsdiffJaxRpc)
Q. What is the difference between JAX-RPC and JAX-WS ? One of the main difference between JAX-RPC and JAX-WS is the programming model. A JAX-WS based service uses annotations (such @WebService) to declare webservice endpoints. Use of these annotations obviates the need for deployment descriptors. With JAX-WS, you can have a webservice deployed on a Java EE compliant application server without a single deployment descriptor.Excuse me, but the @WebService anotation is the deployment descriptor, except now the deployment is entangled with the implementation!!!
Labels:
Annotations,
Java,
JAX-WS,
Programming,
Web Services
Tuesday, February 20, 2007
Technological Evangelism
Since no one actually reads this blog, I can take a moment to vent...
I have been informed that the software project on which I work will be modified to use something called the Spring Framework. Naturally I googled it to get a taste of what it involves before diving in. As near as I can tell, the "core" framework involves building XML files that contain all the definitions and dependencies of your classes and then using Spring to instantiate them , blah blah blah. Whatever. The lulu is that the proponents of Spring are claiming that this "removes the class dependencies from my code." Huh? Do these guys not realize that my new XML file IS my code. To boot, the XML is far harder to read than Java! Guess what? Since the XML is essentially my Java program rewritten in XML, I better have a way to test it. I have gained something questionable at the cost of more complex and error-prone code.
This reminds me of the Code-To-Test movement where you write a bazillion unit-tests and then use them as your "specification" - once you pass all the tests, you're done. Um, guys... your unit-tests ARE your code. They have to be tested, too. You gonna write unit-tests for your unit-tests?
A number of critiques of Spring make the disclaimer that they are not impugning Spring originator Rod Johnson's intellect. I am not sure I can extend the same charity to every one of his disciples. Aside from the marketing copy quality of some of the tutorials (isn't "versatile and flexible" redundant?), the concept of what constitutes "code" is a pretty basic to computer science. Is this too abstract for the average open source user?
It has sometimes been claimed that the problem with software development is that it is not enough like engineering. Having at least graduated as an engineer, I can see some truth to that claim. The alarming thing is that we are moving rapidly in the opposite direction. People are adopting all sorts of crap because it's hyped and it's free (I was personally burned by Log4J) .
Perhaps a great new software paradigm will emerge from this wild west free-for-all. Perhaps we can all get back to writing applications instead of tools. Or maybe I will just continue in my curmudgeonry, decrying the poor state of our university education system.
I have been informed that the software project on which I work will be modified to use something called the Spring Framework. Naturally I googled it to get a taste of what it involves before diving in. As near as I can tell, the "core" framework involves building XML files that contain all the definitions and dependencies of your classes and then using Spring to instantiate them , blah blah blah. Whatever. The lulu is that the proponents of Spring are claiming that this "removes the class dependencies from my code." Huh? Do these guys not realize that my new XML file IS my code. To boot, the XML is far harder to read than Java! Guess what? Since the XML is essentially my Java program rewritten in XML, I better have a way to test it. I have gained something questionable at the cost of more complex and error-prone code.
This reminds me of the Code-To-Test movement where you write a bazillion unit-tests and then use them as your "specification" - once you pass all the tests, you're done. Um, guys... your unit-tests ARE your code. They have to be tested, too. You gonna write unit-tests for your unit-tests?
A number of critiques of Spring make the disclaimer that they are not impugning Spring originator Rod Johnson's intellect. I am not sure I can extend the same charity to every one of his disciples. Aside from the marketing copy quality of some of the tutorials (isn't "versatile and flexible" redundant?), the concept of what constitutes "code" is a pretty basic to computer science. Is this too abstract for the average open source user?
It has sometimes been claimed that the problem with software development is that it is not enough like engineering. Having at least graduated as an engineer, I can see some truth to that claim. The alarming thing is that we are moving rapidly in the opposite direction. People are adopting all sorts of crap because it's hyped and it's free (I was personally burned by Log4J) .
Perhaps a great new software paradigm will emerge from this wild west free-for-all. Perhaps we can all get back to writing applications instead of tools. Or maybe I will just continue in my curmudgeonry, decrying the poor state of our university education system.
Labels:
Code-to-test,
Java,
Programming,
Spring Framework,
XML
Subscribe to:
Posts (Atom)