2008-10-27

Polishing PHP application - Role of tests

Real life scenario:
Slightly changed requirements from category "eventually" - gives as result quite lot code changes.
An extra problem was that in one production environment it have to work on PHP 4, so application needs downgrading from PHP 5 mainly in XML processing area.

Solution:
Writing more tests for new features.
Gradually code fixing and refactoring.
As a result I have more clean, better working code with new features and potentially new undetected bugs :) .

Savings from using unit and regression testing are almost priceless.

Trying to do some changes like that in PHP production code without automated tests will be really painfull.

2008-10-20

I'm busy - new Java project

I'm quite busy now, while setting up new project. It will be Medical Diagnostic Expert System using machine learning algorithms. I've got legacy applications preceding that project, that could be used for their core algorithms implementation. Besides that, the whole application must be build from scratch, to meet new requirements. I'm working now on data gathering services and user interface for experts modules. It is designed as web application, implemented in Java and using Spring framework.

2008-10-13

Automated time tracking with Rescue Time

Sometimes I have mixed thoughts about spending all day with computer. I know what I have done that day, but I know I could do that in a more productive way.

Time is passing in a tricky way while you are sitting in a front of a screen. Sometimes tasks categorized as "easy" took only 15 minutes, other time its 3 hours, and you feel only "small" difference between both cases. Other issue is actual context of task that includes communication, looking for references, research etc. Many times work ends on reading "more interesting" site or blog.

Here is an automated time tracking software from Y Combinator startup named RescueTime. It makes possible "Effortless Time Tracking" under Mac, Windows and thanks to "an enterprising Linux fan" for Linux. It automatically tracks time for every application, web address and gives reports by applications, categories, and user defined tags.

Cons: I see only one- development team still works on recognizing java applications. Now all Eclipse and java applications are seen as Java. Something about privacy and tracking web addresses: you can define white/black list for web addresses, and daily hours of tracking (for example since 8:00 till 16:00). Urls are also truncated to not track irrelevant data. So software can be properly configured and used in "a safe" way.

The graphical reports give very informative strategical overview of time usage. You can also set your time management goals and track your success. They also have business plan that enables team activity tracking and comparing results.

Now I'm going to check share of my time wasters.



2008-10-06

Good method of web frameworks comparison for programmers

If you are programmer and want to choose the web frameworks suitable for your project, one of the best ways of framework evaluation (not fastest) is writing simple prototype that uses concepts similar to your project requirements. Opinions of other experienced frameworks users also counts, but sometimes framework selection is based on personal preferences. Thanks to prototype code all framework sweet spots and "need to be done" areas are easily exposed. Prototyping gives also practical measure of framework impact on overall development productivity.

Last week I have done little research about new trends in Java web frameworks, and found very good and detailed frameworks comparison based on prototyping on a Peter Thomas blog.
Here are articles comparing Wicket framework to Spring MVC, JSF and GWT.
Good job Peter Thomas!

By the way, I have found many Wicket positives in his articles, that I give that framework a try in my next project requiring component based UI.

2008-09-29

Mature programming languages and internationalization

Have you ever tried to implement application using character encoding other than Latin 1? What is deal with that? If you are using modern development platforms like Java or .Net - it just works. Let's omit other problems caused by bad implementation of internationalization issues in framework/library. Multilingual application scenario is simple - use internal UTF character encoding, allow transcoding from external systems at the API level (I/O operations with text files, databases etc.) - and your application will be able to write messages in most standardized character sets including Russian and Chinese.

What about other popular programming languages? Take for example Python 2.5 - recent version that could be used in production environment. It supports UTF strings processing, and character transcoding- but be aware - there are glitches and unimplemented UTF features, causing bad UTF processing. To get it work you have to use (sometimes ugly) workarounds. Here is nice presentation about these issues. There is hope that developers from open source community will fix that till let's say version 3.0.
Ruby is in better situation- as a younger language it has more properly adressed internationalization issues at the design stage. I suspect there is still more work to do.

What about old work horse of web applications development- PHP in newest stable version 5.5.2. It came a long road, but still have problems caused by legacy of non integrated separated libraries. It has long list of options to set encoding like internal encoding, http input output encoding, and many more affecting single libraries.

So what about using mbstring module (multibyte string representation) , setting UTF as internal encoding and sticking to it. Situation is worse than in Python- many even simple string functions can't process multibyte strings in proper way. The Solution is to write own workarounds or use third party libraries like PHP utf8. Here is good list of PHP internationalization issues. Last week I have checked xml import support for old PHP application- it caused problems with Latin2 encoding. The reason was simple: The XML SAX parser supports only ISO-8859-1, UTF-8 and US-ASCII encodings.

Such low detail problems could potentially take a lot of precious project time. So if your next application will use character set other than Latin 1, you should consider good internationalization support by chosen development and production platform.