Good programming practices


StructuredInfo – objects instead of plain String

December 29th, 2011

Common method toString is a simple way to display inner values of an object. But when you get a String want to present it in other format it can be difficult or unsafe to parse it. So better way is to pass a structured object witch can be next serialized to desired format. So I created a project in Scala 2.9.1 for gathering and serializing information in an application. More…

Simple SGML parser

October 30th, 2011

There exists many parsing libraries for XML, HTML and SGML. Sometimes it’s enough to use simple solution instead of whole library. I created 4 classes for parsing string into list of markups and plain text. The parser use regular expressions for extracting all elements. More…

Control flow with String

December 27th, 2010


Some programs are controlled by short commands in text form. They may come from user, to be read from a file, or received from another program. This make communication with such a program easier and clearer for other programs. This is a special and simplified case of Interpreter design pattern.


  • Programs, which gets parameters from the command line.
  • Servlets, for which data are sent using GET or POST.
  • Applets on web pages where the parameters are placed in HTML.

For performance reasons, it is better when there will be interpreted many groups of parameters in a single code run. More…