A few months ago I started working on one web site. That was basically my playground. I was able to test different JavaScript libraries there, to play with CSS styles and HTML templates that I stole from other web sites, etc.
Once I was finally satisfied how my site looks like, I realized that I have a whole lot of junk in my resource folder! Hundreds of javascript functions, css styles and images.
I had no idea what was used and where.
So, I said to myself: “Boy, clean up your room!”
Well, easier said then done! After googling the Universe I realized that there are no programs that could help me with this. But I just wanted a simple stuff: tell me which images are not used, which JS functions are unused or duplicated, and the same for CSS styles!
The market was empty. For the first time in my development career there was absolutely nothing that could do this task. To be honest, there are some Firefox plugins that can help you with CSS styles, IntelliJ IDEA also has something, Dreamweaver too, but I wanted all of it in one place.
So, I said to myself again: “Boy, before you start cleaning your room, you need to get yourself a nice tool to help you out.”
And that is how WARI was born. WARI - Web Application Resource Inspector.
What it does is quite simple: goes through your directory structure and searches for JavaScript, CSS, HTML and image files. Then it processes all of them in order to find dependencies - where is what used. As a result, you get a report about unused and duplicated stuff in your web application. Works fine for me.
Wanna try? Get the latest version (and currently the only one) at: http://wari.konem.net
If it doesn’t work for you, tell me why and I’ll put the fix in the new release.
Putting hundreds of lines of code together is one thing, but putting them right is something completely different.
If you really want to know what you are writing, put these in your toolkit:
1. Structure101
Amazing tool. Shows you architectural violations and extensive code complexity.
It is so easy to break your architecture and overly complicate your classes.
After every milestone I check my architecture with Structure101 and almost always I need to do refactoring after that.
2. PMD
PMD is basically using rules from “Effective Java” book by Joshua Bloch. It is useful to have your code marked immediately after making some violation then going through the book and validating if you have done it right.
I don’t agree with all the rules used in PMD (like Controversial Rules for example - specifically DD anomaly) but you can switch some rules off.
3. FindBugs
Similar to PMD. Good to have as much code analyzers as possible that automatically run in background.
4. TomcatProbe
If you are writing web applications running under Tomcat this tool can be useful.
Its not super useful, but gives you some high level info about memory consumption and other stuff. Good to have, but if I would find some better and free profiler tool that can be used as easily as this one, I would be happy to use it.
I have also worked with some others tools Hammurapi, SonarJ, Profiler4J etc. but I am not very satisfied with those. Some are very hard to install (Hammurapi), some don’t work in Mac OSX (SonarJ), some are still in beta (Profiler4J) etc.
Can you suggest some other free code/architecture analyzer tool?
I would be happy to hear you experience.
Sounds crazy right? Keep on reading, maybe it won’t be by the end of the story…
For the last 8 years I was a hardcore Java developer. Worked on many different projects, various kinds and various positions - from junior to senior, team leader, project manager, lead developer and architect. But all in all, every working day of my life contained in average 80% of pure coding.
Then I decided that it’s time for a career change. I quit my job, moved away from software development companies and became a solution architect in an insurance company.
Why? Mostly because anyone can be a Java developer these days. You don’t need a Master degree to be a code monkey. Just read JDK tutorial, keep up to date by following InfoQ/DZone posts and start producing. I figured out that I was missing a real business know-how and that I am not a subject area expert in any business-related field.
Being an architect in a non-software company has benefits. You work for internal clients and don’t bring money into the company. You just spend it.
Other benefit is that you don’t code for living anymore! It took me a while to realize why that is actually a benefit. Well, I am a developer by nature and I missed it naturally. When you are developing something all day at work, you don’t have much nerves/energy/enthusiasm to do the same at home in the evening. No matter what software company you work for (Google, IBM, Oracle etc.) you will always do what your boss tells you to do and what your architect tells you how to do it. It will never be exactly the way you want it.
When you are not programming during the day (and we all know that architects just throw documents over the wall for somebody else to develop it) then you have a high wish to program something at home. But this time it’s different. There is no time pressure. No clients. You develop your way, what you want and how you want it. That exciting feeling I had long time ago, came again. It didn’t burn out, but was just pushed down under every-day-heavy-weight-high-pressure-development work. I did things that I always wanted to do. Read “Design Patterns”, “Effective Java”, “Beyond Software Architectures”, “Java Puzzlers”, “Java Concurrency in Practice” etc. and started implementing some ideas I had pending long time ago but never had time/energy to work on them. Now I have enough time and energy to think about every implemented class, to test it properly, to document it, to play around with different performance tuning options etc. I want to be proud of every line of code I make. Life is too short to waste it on something that you don’t like or despise or are ashamed of later.
Suddenly I figured out that I did many things wrong just because of time pressure. I knew they were wrong, but had to take short cuts to meet tight deadlines. And that sucks! That is what is killing your will to continue coding and what makes you a terrible developer.
Some of you probably work on nice projects and completely disagree with previous statements. Fair enough. I envy you guys. There are others that probably feel the same way I did before.
My advice to this latter group is: “find a job that brings you a financial stability but doesn’t kill your desire to develop your stuff in your free time. That job can still be with some software company but don’t be afraid to let it go in case it’s not. World is a huge place with lots of opportunities. Go for it…”
And the last day at Jazoon has arrived. And what a day! It was really “save the best for last".
Opening keynote was held by Duke itself - Joshua Bloch. It was a bit of marketing for his new edition of “Effective Java” book, but he showed some pretty complex generics and enum examples. He tried to explain usage of wildcards in generics, by inventing PECS mnemonic - Producer Extends Consumer Super. You should definitely check out his new book if you want to stay on bleeding edge of Java development.
“Java SQL databases” session was held by Thomas Muller, a guy who wrote Hypersonic SQL. He compared open source embedded Java databases - Apache Derby, HSQL and H2.
His favorite was H2 (aside the fact that is creator of that one too) because it is much faster and can carry heavy data processing.
“Migrate to Apache Maven” show real world experience moving from Ant to Maven. I am still not so impressed by Maven as I wrote in some of my previous posts. It took them 2 months to migrate their project from Ant to Maven. Too much dude, just too much.
Lunch - cheese with bacon. No comment.
“A quick guide to modern languages” session held by Cedric Beust. Excellent overview of Ruby, Groovy, Erlang and Scala. He showed why should we and why shouldn’t we care too much about these languages. Every has it’s pros and cons but the real point of story was - don’t give up on Java. Java is still number 1 and is here to stay for a long time.
“eBay’s architecture” session by Randy Shoup. I actually had a pleasure to meet him during “lunch". He is very nice and smart guy. What was really impressive with eBay’s architecture is that everything is automated - scaling, updates, rollout, failure detection and most interestingly eBay doesn’t use any transactions. Super radical but also super practical.
Okay, that’s it for this years Jazoon. Generally, much better then last year, better organization, good speakers but still very expensive comparing to JavaPolis and some other better known conferences.
First keynote was held by Ted Neward. Interesting and funny like always. He is a born speaker and gets right to the point. Session was about “Rethinking Enterprise” where the main conclusion was - be cynical, question everything and don’t blindly follow “best practices” because every problem/company/domain is different and there are no best practices.
Then came Roy Fiedling. Right. Ok, he is smart and is creator of REST architectural style, he was Apache chairman, wrote Apache httpd webserver etc. But he is sooo dead boring! He obviously is not a conference guy. He can’t present anything, he can’t keep audience alive and he is totally unprepared and confusing.
All the excitement that Ted gave us, vanished quickly with Roy.
The next session was about JBI and ESBs. It was quite poor. Guy was quoting “Enterprise Integration Patterns” book and gave a very little hands-on experience.
But then came a real delicious session - Joe Walker on DWR and Comet. I am a great fan of DWR so for me it was a must-see session. And it was great. Joe spoke about all the hacks, tips and tricks behind DWR and reverse ajax. Browser’s world is nasty and mean and Joe explained and obviously mastered it very well.
“Managing data in SOA” was next session. Didn’t understand a word. SOA and all WS-* specs together with REST is such a buzz that I can’t hear my thoughts of all the buzzing around. I think we need to give these guys another 5 years so they have enough time to understand these concepts themselves and then to come up in front of us again. I am a low-level developer who need to see things in a real perspective and to see real-world examples how something works before using it on some project.
“AOP meets the real world"… just starting… I have high hopes… see you in one hour…
one hour later: I’m back. Disaster and disappointment. Who brings these lames to a conference? I am going home. Enough for today. See you tomorrow.
:: Next >>