A Funny Java Flavoured Look at the World

Thursday, November 30, 2006

trouble using | (pipe) with the String.split method

I came across this little problem whilst coding this week and it was driving me crazy and it is only a little problem so I wasn't going to blog about it but I couldn't find any information on it anywhere so I thought I would write a blog entry in case someone else has this problem.

The problem came when I tried to using String.split method, you replace String with an actual String and not the static object. Anyway I had written a log file and used | (pipe) as a delimeter so that when I got the log file in my code I could just do a split("|") and then it would chop each line into a nice array of Strings which I could loop through and search and take out the values I wanted.

The problem I was getting was when I did split

myString.split("|")

it split the string on every single character, which was quite a shock. I tried to goggle the problem by typing in things like

"using pipes with split()"
"pipe metacharacters"

I knew from my study of the SCJP 5 that there is some tricky characters in regex (regular expressions) called metacharacters but I couldn't find | included in any of them and wasn't sure why it was acting funny. I have blogged about metacharacters before in a blog entry called
\n - newline saves the day and formats all my troubles away

In the end I found that to successfully use the pipe in a regular expression I had to add a double backslash like so

myString.split("\\|");

and then it worked fine.

I thought I would blog about this just in case someone else runs across this problem. I'm not sure perhaps its something which everyone knows not to do (except me obviously) , I know pipes are used for adding things together but I still don't really understand why it would split on everyone single space

Is Java getting bloated?

A friend of mine sent me an email today pointing me towards Stroustrup's web page, for those of you who don't know he is the person who invented C++. Here is his homepage http://www.research.att.com/~bs/ and it's quite interesting (even for a Java person)

of course because he invented C++ he is bombarded with questions comparing Java with C++ and which one is better/faster/more Object Orientated etc. So he put questions such as this into a FAQ list and this one in particular caught my eye

Is Java the language you would have designed if you didn't have to be compatible with C?

No. Java isn't even close. If people insist on comparing C++ and Java - as they seem to do - I suggest they read The Design and Evolution of C++ (D&E) to see why C++ is the way it is, and consider both languages in the light of the design criteria I set for C++. Those criteria will obviously differ from the criteria of Sun's Java team. Despite the syntactic similarities, C++ and Java are very different languages. In many ways, Java seems closer to Smalltalk than to C++.

Much of the relative simplicity of Java is - like for most new languages - partly an illusion and partly a function of its incompleteness. As time passes, Java will grow significantly in size and complexity. It will double or triple in size and grow implementation-dependent extensions or libraries. That is the way every commercially successful language has developed. Just look at any language you consider successful on a large scale. I know of no exceptions, and there are good reasons for this phenomenon. [I wrote this before 2000; now see a preview of Java 1.5.]

Java isn't platform independent; it is a platform. Like Windows, it is a proprietary commercial platform. That is, you can write programs for Windows/Intel or Java/JVM, and in each case you are writing code for a platform owned by a single corporation and tweaked for the commercial benefit of that corporation. It has been pointed out that you can write programs in any language for the JVM and associated operating systems facilities. However, the JVM, etc., are heavily biased in favor of Java. It is nowhere near being a general reasonably language-neutral VM/OS.

Personally, I'll stick to reasonably portable C++ for most of the kind of work I think most about and use a variety of languages for the rest.


This seem quite an amusing question to ask someone who invented C++ I wonder if people still compare Java and the various C languages so much any more, it seems to me and I admit I don't know that much about C++ etc that Java's speed and the processors in computers have improved enough so that speed is not the main issue any more. I have a sneaky feeling that this is probably because the stuff I have been working on is not on such a big scale that time is that important to me and I'm sure C++ is probably still quicker but it doesn't really matter to me.

It's interesting about his point that the JVM will bloat up, this does strike me as a fairly obvious statement because the more stuff that is added to the JVM and the Java language the bigger it is going to get. I remember listing to a debate/discussion on the Java Posse where they were talking about the database being added to the JVM, they were saying it would be nice if people could choose.

I was wondering if with Java going open source that there will be skinny versions of the JVM and people stripping out stuff they don't need a bit like Linux and it's kernel. Then again does it matter that much, computers have plenty of hard disk space.

I like his comment that JVM is a platform and not platform independent, I hadn't really thought of the JVM as a platform before.

As he wrote the FAQ quite a while ago he did quite a good job of predicting the future but I wonder how Java going open source will effect things like speed and bloatness. Does anyone have any comments on this, I would like to hear what you have to say as I am a bit in the dark over such things. Is Java getting/is bloated and does it matter?




If you like this blog or and fancy something a bit less technical with some laughing thrown in then check out my other blog Amusing IT Stories. Which is a blog about funny and amusing stories from the IT environment and the office. It is a mix of news, office humour, IT stories, links, cartoons and anything that I find funny

Wednesday, November 29, 2006

Date is depreciated - Calander is King

This week I had been working with dates which is sure sign of a lot of tricky nitpicking code and lots of little methods each testing certain bits of the code.

The first thing that got me annoyed was the Date class is basically all depreciated except for just creating a date. This is fine and the reason for this is (I think) because people needed a locale specific date or something like that. This is where I started to gnash my teeth a bit because it didn't really point me in the direction I should be going. I think it's the Calendar class and from studying for my SCJP 5 exam. I found the help for the Calendar class not that helpful, how do you set the flipping thing. Here is a link if you want to peruse yourself

Firstly the Calendar class is abstract so to get an instance of it you have to do this

Calendar rightNow = Calendar.getInstance();

or choose a different method to get the right flavour for you. Then to change the date and time from right now you have to set the date, it seem obvious to me now but I was looking through the documentation rather puzzled for a good five minutes before I just went into the code and used my IDE to get the methods available the rightNow variable above.

rightNow.setTime(Date)


I think this is what threw me off a bit because it was setTime and I was thinking about setting a date. Once you have got you Calendar instance set up with the correct time, the Calendar class is very good with the lots of methods to get Time or Months, first day of the week, number of days in month, all very nice.

Earlier on in the day though I was wanting to compare some dates and found this code example to do it, although this uses the Date object. I actually didn't really want to compare the actual date, all I wanted to do was see if the date was in a different month, which I did by getting the month from the calendar instance and then comparing the months.

This was what I was going to blog about all along, how to parse a date from a String value, this example was great, straight to the point

String s = "15-05-2005 5:55:55";

SimpleDateFormat df = new SimpleDateFormat("dd-MM-yyyy HH:mm:ss");
Date date = df.parse(s);

Above is the basic code to parse the date, I don't think I have used the SimpleDateFormat tool before but it made it quite simple, although I did have a bit of problem because I put small mm instead of big MM when I tried to change the format of the date a bit.

So there you go there were my adventures with dates, the best thing with working with dates is that you can test your functions easily with unit tests because generating some data for it is easy. This means that although my code was doing a lot of small tests at least I could easily and quickly test the code and be confident that it was doing what it should.



If you like this blog or and fancy something a bit less technical with some laughing thrown in then check out my other blog Amusing IT Stories. Which is a blog about funny and amusing stories from the IT environment and the office. It is a mix of news, office humour, IT stories, links, cartoons and anything that I find funny

Tuesday, November 28, 2006

Computer industry 'faces crisis'

I read this article last week but didn't have time to blog about it, I found this on the BBC and this isn't the first time I have read an article in this vain, the title is Computer industry 'faces crisis' The article is about the number of students studying computers at university has dropped dramitically.

It's quite an interesting thought that computers are no longer a fashionable choice for students, what are they doing instead. I can see that the topic can be perhaps more challenging than some of other topics because you have to learn a computer language and then put in the hours to make it do something. Where as in some other subjects like Business Management (which was in my degree) you could often make up parts of the answers to questions and use logic.

The above paragraph is obviously a bit of old man ranting and "it's all easier for these young un's today" type of warbling.

I find it slightly unusual that computer is not being studied as much in university because there does seem quite a lot of jobs in the industry, you get to play with computers. The article says there is a sharp decline in people studying it. I like this description in the article

The industry also had an image problem, he said, with computer scientists often portrayed on TV and in films as "geeky".
I suppose one problem that might occur with computers and studying computer is that it isn't very appealing to women. In my experience I have worked with very few women (1 or 2) so a computer degree is already starting off on the back foot.

The bottom line is that it will be good news for people already working in computers as smaller numbers of skilled people should mean are prices go up. We can but hope.



If you like this blog or and fancy something a bit less technical with some laughing thrown in then check out my other blog Amusing IT Stories. Which is a blog about funny and amusing stories from the IT environment and the office. It is a mix of news, office humour, IT stories, links, cartoons and anything that I find funny

Tuesday, November 21, 2006

What IT skills are used with Java?

Yesterday I blogged about The Average wage for Java Developers and the page where I got this information also had some interesting statistics regarding what other skills job adverts had when the word Java was mentioned. The original source of that data can be found on this link.

Below is are the IT skills that are mentioned in the same advert as Java

Java Related IT Skills
Top 20

Over the last 6 months permanent IT job ads across the UK citing Java also mentioned the following IT skills in order of popularity. The figures indicate the number of IT job ads and their proportion against the total number of ads sampled citing Java.
131498 (38.50 %)J2EE
222217 (27.16 %)SQL
321498 (26.28 %)UNIX
421368 (26.12 %)XML
521023 (25.70 %)Oracle
620439 (24.98 %)Finance
718660 (22.81 %)C++
818480 (22.59 %)Banking
916815 (20.55 %)Degree
1014833 (18.13 %)OO
1113380 (16.35 %).NET
1213159 (16.08 %)C#
1311514 (14.07 %)JSP
149895 (12.09 %)HTML
159510 (11.62 %)Sybase
169481 (11.59 %)UML
179222 (11.27 %)Linux
189125 (11.15 %)SQL Server
198823 (10.78 %)Windows
208694 (10.63 %)Front Office


I was slightly surprised J2EE was the top IT skill, I don't really know why but I was sure so many adverts would use that word as it seems slightly on it's way out. The database stuff like SQL and Oracle is very high as you would expect. JSP is quite low down the list and I thought this would be something to do with Ajax but that isn't on the list at all. Disappointingly OO is down to number 10, below Degree. It's interesting that other programming languages feature quite highly.

This set of data also interested me

Java Related IT Skills
By Category

Over the last 6 months permanent IT job ads across the UK citing Java also mentioned the following IT skills grouped by category. The figures indicate the number of IT job ads and their proportion against the total number of ads sampled citing Java. Up to 20 skills are shown per category.
Application Development
131498 (38.50 %)J2EE
221368 (26.12 %)XML
313380 (16.35 %).NET
411514 (14.07 %)JSP
59895 (12.09 %)HTML
68217 (10.04 %)WebSphere
76583 (8.05 %)Struts
86295 (7.69 %)EJB
96068 (7.42 %)Servlets
105182 (6.33 %)WebServices
114998 (6.11 %)Hibernate
124447 (5.44 %)JDBC
134150 (5.07 %)JMS
143981 (4.87 %)Swing
153931 (4.80 %)XSLT
163445 (4.21 %)SOAP
173329 (4.07 %)CSS
183254 (3.98 %)ASP.NET
192878 (3.52 %)Middleware
202788 (3.41 %)Spring Framework
Application Platforms
16423 (7.85 %)WebLogic
25021 (6.14 %)Tomcat
34257 (5.20 %)JBoss
43865 (4.72 %)Apache
51539 (1.88 %)WebSphere Appl...
61316 (1.61 %)IIS
71284 (1.57 %)MQSeries
8878 (1.07 %)CMS
9635 (0.78 %)WebLogic Portal
10617 (0.75 %)WebSphere MQ
11572 (0.70 %)Documentum
12431 (0.53 %)ColdFusion
13391 (0.48 %)SharePoint
14380 (0.46 %)BizTalk Server
15357 (0.44 %)NetWeaver
16340 (0.42 %)Lotus Notes
17316 (0.39 %)Oracle Workflow
18309 (0.38 %)Oracle Applica...
19216 (0.26 %)ATG Dynamo
20201 (0.25 %)Lotus Domino


it shows that Weblogic is the most popular Application platform (well the most popular mentioned) although Websphere is number 6 application development which would indicate it was perhaps more popular. I was interested that .NET featured so highly with Struts and Servlets still high up there.

Finally it has a section on what development applications. I was very surprised that Junit was above Ant. This data must be a bit old I am thinking because Eclipse is mentioned but there is no sign of NetBeans. Subversion seems to be the most popular version control although CVS isn't mentioned whilst Visual SourceSafe is.

Where are all the Java developers working, mainly in Finance and Banking (if the figures are to be believed)


Development Applications
13746 (4.58 %)JUnit
23487 (4.26 %)Ant
33078 (3.76 %)Eclipse
41206 (1.47 %)ClearCase
5944 (1.15 %)Flash
6676 (0.83 %)Oracle Forms
7639 (0.78 %)Rational Rose
8581 (0.71 %)TestDirector
9577 (0.71 %)WebSphere Stud...
10560 (0.68 %)Visual Studio
11525 (0.64 %)Subversion
12506 (0.62 %)WinRunner
13439 (0.54 %)LoadRunner
14397 (0.49 %)VSS/SourceSafe
15360 (0.44 %)Dreamweaver
16313 (0.38 %)PowerBuilder
17312 (0.38 %)PVCS
18251 (0.31 %)JDeveloper
19241 (0.29 %)QuickTest Pro
20216 (0.26 %)NUnit
General
120439 (24.98 %)Finance
218480 (22.59 %)Banking
38694 (10.63 %)Front Office
48300 (10.15 %)Investment Ban...
53660 (4.47 %)Telecoms
62241 (2.74 %)Electronics
72176 (2.66 %)Education
82012 (2.46 %)Retail
91692 (2.07 %)Insurance
101581 (1.93 %)Back Office
111482 (1.81 %)Pensions
121464 (1.79 %)Government
131372 (1.68 %)Games
141360 (1.66 %)Health
151147 (1.40 %)Financial Inst...
161034 (1.26 %)Marketing
17723 (0.88 %)Publishing
18562 (0.69 %)Billing
19529 (0.65 %)Retail Banking
20500 (0.61 %)Multimedia


So in the end what can you make of it all, Don't trust statistics.


If you like this blog or and fancy something a bit less technical with some laughing thrown in then check out my other blog Amusing IT Stories. Which is a blog about funny and amusing stories from the IT environment and the office. It is a mix of news, office humour, IT stories, links, cartoons and anything that I find funny

Monday, November 20, 2006

The Average Salary for Java Developers

Every now and then I like to have a look at what the average wage is for a Java developer, I found quite an interesting site with a lot of statistics on. I am like everyone else and love statistics to look at, although every time I look at these statistics they seem quite high, especially considering they have another section for contract work. here is the link

and below are the more interesting statistics taken from the website link above.


Java

This section looks at the demand for Java skills across the UK with a comparison to our Programming Languages category. Included is a guide to the average salaries offered in IT job ads that have cited Java over the last 3 month to 20 November 2006 with a comparison to the same period last year.

Java


3 Months to
20 November 2006
Same Period
Last Year
Rank58
Rank Change on Same Period Last Year+3
Matching Permanent IT Job Ads3329629274
As % of All UK Permanent IT Job Ads Sampled15.51 %14.02 %
As % of Category35.23 %32.64 %
Salaries Quoted2358922104
Average Minimum Salary£43,726£43,695
Average Salary
% Change on Same Period Last Year
£48,313£48,014
+0.62 %
Average Maximum Salary£52,900£52,334

Programming Languages
UK

Matching Permanent IT Job Ads9451089675
As % of All UK Permanent IT Job Ads Sampled44.02 %42.95 %
Salaries Quoted6759669274
Average Minimum Salary£38,633£38,861
Average Salary
% Change on Same Period Last Year
£42,360£42,423
-0.14 %
Average Maximum Salary£46,087£45,986


Java Average Salaries

This section looks at the demand and provides a guide to the average salaries quoted in IT job ads citing Java within the UK region over the last 3 months to 20 November 2006.

RCJAASSC
England +331928£48,628+0.44 %
Scotland -1696£34,642+5.48 %
Wales +2281£31,472-17.28 %
Northern Ireland -443£35,797+10.30 %
Isle of Man +76£39,200+35.17 %
Channel Islands -151--
RCRank change on same period last yearSCAverage salary % change on same period last year
JAMatching permanent IT job adsASAverage salary


Java Related IT Skills
Top 20

Over the last 6 months permanent IT job ads across the UK citing Java also mentioned the following IT skills in order of popularity. The figures indicate the number of IT job ads and their proportion against the total number of ads sampled citing Java.
131498 (38.50 %)J2EE
222217 (27.16 %)SQL
321498 (26.28 %)UNIX
421368 (26.12 %)XML
521023 (25.70 %)Oracle
620439 (24.98 %)Finance
718660 (22.81 %)C++
818480 (22.59 %)Banking
916815 (20.55 %)Degree
1014833 (18.13 %)OO
1113380 (16.35 %).NET
1213159 (16.08 %)C#
1311514 (14.07 %)JSP
149895 (12.09 %)HTML
159510 (11.62 %)Sybase
169481 (11.59 %)UML
179222 (11.27 %)Linux
189125 (11.15 %)SQL Server
198823 (10.78 %)Windows
208694 (10.63 %)Front Office



If you like this blog or and fancy something a bit less technical with some laughing thrown in then check out my other blog Amusing IT Stories. Which is a blog about funny and amusing stories from the IT environment and the office. It is a mix of news, office humour, IT stories, links, cartoons and anything that I find funny


Friday, November 17, 2006

IT candidates offered "flexible employment"

I get this email from Jobserve now and again and it often has interesting articles about the employment conditions in the UK. The article IT candidates offered "flexible employment"
is there if you want to read it in full.

It has a couple of interesting quotes

"The IT skills shortage has resulted in employers offering flexible employment packages to attract workers, according to new research.

Hays Information Technology specialist recruitment agency has claimed that candidates now have the opportunity to "pick and choose" their career path, as employers adjust to give workers a work-life balance."
and
"Hays' quarterly forecast for October to December has also shown that candidates tend to seek employers that offer training programmes and the chance to update their skills.

The group stated in a report last year that candidates with "good communications skills" are being sought for the IT industry as it attempts to enhance customer experience."
I often wondered why employers seem quite reluctant to offer flexible working hours, I know there is benefit for everyone to be in the office at the same time but you don't all need to be in the office at the same time. This has changed a bit over the years, there didn't seem to be any "working from home" about 5 years plus ago. This has been helped by technology improving with broadband and software enabling this. Still in my experience (which is limited I admit) it is usually only special cases and people who are considered more important than the general rank and file who get such flexible working times.

I keep seeing more articles about IT shortages and employers concentrating on keeping employees. I wonder if a flexible hours is something that will come more common place. The reluctance of employers to offer flexible working hours seems to me to be linked to a sort of lack of trust and maybe they feel they won't be able to monitor them if they all come in different times. Obviously flexible working hours would definitely mean it would be harder to police people's hours worked and I can think of a few people who would abuse this.

Overall I think employers should do it because if you don't trust your workers then surely you should think about replacing them and if you do trust them to do their work and hours then you should offer flexible working hours.

The article also makes an interesting point about employee's choosing companies who offer training so they can update their skills. I saw this article on the BBC

UK staff 'need time off to train'


Which is basically saying you should train your employers so they have the right skills to do their job. Although this isn't directly relevant it is a good reason why people are looking to get jobs where they will get training. Training offers skills which you wouldn't learn by just doing your job and it's important to keep developing employees workers and giving them the skills needed to do their job.




today is the new issue of the 4th Edition of Amusing IT Stories -
Amusing IT Stories - 4th Edition - Awooga is leading us to higher standards check it out if want to read something funny this afternoon, It is a mix of news, office humour, IT stories, links, cartoons and anything that I find funny

How to find out if people are copying your blog

I found this interesting website it searches the web for copies of your articles/blog entries to defend you site agaisn't plagiarism

http://copyscape.com/
Publish
The blurb on the site says

"Copyscape is dedicated to defending your rights online, helping you fight against online plagiarism and content theft. Copyscape finds sites that have copied your content without permission, as well as those that have quoted you.

Choose the service that best meets your needs:

  • The free Copyscape service makes it easy to find copies of your content on the Web. Simply type in the address of your original web page, and Copyscape does the rest."
this happened to me once and the person was copying lots of peoples articles in full without giving credit.

here is the blog entry Blog Copyists do not prosper

I like the comment somebody left to the blog article above
"A blogger plagiarizing your posts would be like a body-builder who tries to look like Rosie Odonnel."


today is the new issue of the 4th Edition of Amusing IT Stories -
Amusing IT Stories - 4th Edition - Awooga is leading us to higher standards check it out if want to read something funny this afternoon, It is a mix of news, office humour, IT stories, links, cartoons and anything that I find funny

Thursday, November 16, 2006

A Programmers life in code

I raised a question on a JavaLobby forum the other day about

Favouring composition over inheritance is a sign of a maturing programmer

yesI know very nerdy of me, I basically asked the question what is the next stage of development in a programmers life. I was quite amused by this reply

Re: Favouring composition over inheritance is a sign of a maturing programm

getALife();

Sex partnerSex = null;

if(programmer.getSexualOrientation() == SexualOrientation.HOMO) {
if ("US".equals(programmer.getCountryCode())) moveToHolland();
partnerSex = Sex.getTheSame(programmer.getSex());
} else {
partnerSex = Sex.getTheOpposite(programmer.getSex());
}

Human partner = findPartner(partnerSex, programmer.getSexualOrientation(), "http://www.personals.com/webservice");

programmer.marry(partner);
if (programmer.getSexualOrientation() == SexualOrientation.HETERO) {
programmer.makeKids();
}

throw new DieException();




If you like this blog or and fancy something a bit less technical with some laughing thrown in then check out my other blog Amusing IT Stories. Which is a blog about funny and amusing stories from the IT environment and the office. It is a mix of news, office humour, IT stories, links, cartoons and anything that I find funny

Wednesday, November 15, 2006

Essential Skills for Agile Development - free ebook

I found this link which has basically a whole books worth of Agile Skills

http://www.agileskills.org/download.html.en

I actually read this before but then found it again this week but I still read a few of the more interesting sections. What I like a lot about this book/tutorial is that is free and secondly it
uses examples to explain the concepts. The examples are pretty good, I usually get a bit bored reading code in books but these were straight forward and emphasised the points very well. The categories in the book are very useful for every day programming. Unlike other free books on the web this one is legal, as long as you don't print it or use it for commercial use.

These are the sections in the book

Chapter 1. Removing duplicate code
Chapter 2. Turning comments into code
Chapter 3. Removing code smells
Chapter 4. Keeping code fit
Chapter 5. Take care to inherit
Chapter 6. Handling inappropriate references
Chapter 7. Separate database, user interface and domain logic
Chapter 8. Managing software projects with user stories
Chapter 9. OO design with CRC cards
Chapter 10. Acceptance test
Chapter 11. How to acceptance test a user interface
Chapter 12. Unit test
Chapter 13. Test driven development
Chapter 14. Team development with CVS
Chapter 15. Essential skills for communications
Chapter 16. Pair programming




If you like this blog or and fancy something a bit less technical with some laughing thrown in then check out my other blog Amusing IT Stories. Which is a blog about funny and amusing stories from the IT environment and the office. It is a mix of news, office humour, IT stories, links, cartoons and anything that I find funny

Tuesday, November 14, 2006

Who is Robert C Martin and what is he famous for

I thought I would post about famous programmers now and again because there are some names which keep on popping up as you read about programming.

The real reason I am posting is because Robert C Martin or Uncle Bob as he is known posted a comment on my blog entry "are the principles of OOD going out of fashion" . When I saw the comment I was literally taken a back, not the Robert C Martin. It seemed bizare, I have read 100's of his articles and read some of his books and there he is reading my blog. The real comedy of the situation is there isn't any I can really tell without looking very sad.

Back to the topic at hand, who is Robert C Martin, well the reason I have read many of his articles on OO. When I read the article they blew me away, the ideas were fascinating to me. Anyway this is what Wiki says

Known colloquially as "Uncle Bob", Robert Cecil Martin has been a software professional since 1970 and an international software consultant since 1990.

He is founder and president of Object Mentor Inc., a team of consultants who mentor their clients in C++, Java, OOP, Patterns, UML, Agile Methodologies, and Extreme Programming.

From 1996 to 1999 he was the editor-in-chief of the C++ Report. In 2002 he wrote the Agile Software Development: Principles, Patterns, and Practices which gives pragmatic advice on object oriented design and development in an agile team. He has also published a truckload of articles on programming and software methodologies.

He has wrote many many articles but the one's I found so interesting one are under Design Principles

http://www.objectmentor.com/resources/publishedArticles.html


and I think one of my all time favourite articles (yes I know it's sad) is the Open Closed Principle
the beauty of these articles are they are pdf's which means you can download them and read them later. This article Patterns and Design Principles is worth a read although it is pretty long, (30 pages) so don't be expected a quick read.

Uncle Bob does have a blog if you would care to read his more up to date musings.

The one thing which does make me laugh though is the Craftsman articles and I have blogged about this before they just are funny, it's a funny idea but saying that I still enjoyed them.

He has also written some books

  • Martin, Robert Cecil (1995). Designing Object-Oriented C++ Applications using the Booch Method. Prentice-Hall. ISBN 0-13-203837-4.
  • Martin, Robert Cecil (2002). Agile Software Development: Principles, Patterns and Practices. Pearson Education. ISBN 0-13-597444-5.
  • Martin, Robert Cecil (2003). UML for Java Programmers. Prentice Hall. ISBN 0-13-142848-9.
  • Martin, Robert Cecil (2006). Agile Principles, Patterns, and Practices in C#. Prentice Hall. ISBN 0-13-185725-8.

of course what he is most famous for now is leaving a comment on my blog



If you like this blog or and fancy something a bit less technical with some laughing thrown in then check out my other blog Amusing IT Stories. Which is a blog about funny and amusing stories from the IT environment and the office. It is a mix of news, office humour, IT stories, links, cartoons and anything that I find funny

Monday, November 13, 2006

Should I be more excited about Java going GPL/open source

I think this is probably just my opinion but all the fuss about Java going open source filling up Java websites (although surely I am now contributing to it as well), Not to mention all the talk leading up today the announcement. Personally I am not to sure if I should be that excited about it or should I say in a more selfish way how is this going to change how I work with Java.

I wonder how this will effect every day Java users, will it mean there are loads of different versions. I recently blogged about version of Java people were using and the fact that commercial businesses were slow and reluctant to change to new versions because they like to stick with what works and what is safe. How is this going to effect them.

As a commercial developer I won't really have any time to muck about with the Java code but I suppose I will benefit from other people's tinkerings. I'm not really sure how it will all work in the future, will there be different flavours of Java appearing like Linux and each company signs up to one flavour and how will this effect compatibility of other software products.

At the moment I'm not sure I see that many benefits but I think this is because I haven't worked with open source products that often and am conditioned in that way. It does seem exciting in some ways harnessing the power and enthusiasm of the Java community, it could be a very powerful movement but what direction will it go.

I don't think I have thought about this properly yet but this is why I am posting this so to get a response by someone better informed but all I can think of is Linux and it's different flavours, too which now big companies are taking sides.

Will much change? if so what and how?

You have to take you hat off to Sun, they certainly aren't afraid to give stuff away.



If you like this blog or and fancy something a bit less technical with some laughing thrown in then check out my other blog Amusing IT Stories. Which is a blog about funny and amusing stories from the IT environment and the office. It is a mix of news, office humour, IT stories, links, cartoons and anything that I find funny

Sunday, November 12, 2006

Favouring composition over inheritance is a sign of a maturing programmer

I'm not entirely sure what I am basing this theory on but I believe that favouring composition over inheritance is when a programmer/developer is maturing into a better programmer who creates code that is easier to maintain and extend, along with solving the problem you are writing the code for the two main goals of my coding.

I wrote an article about why you should use Composition instead of inheritance and as always the comments for this post were very interesting.

It's just a personal opinion of course but initially I use to think first of using inheritance because it seems easy and you can use code in the base class in all the classes that inherit this class. I think this is why people favour inheritance.

I think the next step of evolution as a programmer is using interfaces as a way to protect against change in the future.

The next stage that perhaps I am at (what I like to think, my work colleagues may disagree) is that you start to use composition. I have stopped thinking that the best code is the least amount of code written, which was one of the reason I use to use inheritance. I now think of good code as code that has loose coupling and that does one thing i.e has high cohesion. This type of code can easily be reused and change in any part of the code will hopefully affect a small part of the code base. Code should be DRY and many other things but I am not talking about that kind of code intricacies but sort of looking at the code at a more holistic view.

I believe that favouring composition is way to achieve the code above. I would like to get it clear that I am not against using inheritance and there is a time and place for using it when it's the best option etc. What I am trying to say is that there was a stage where I would try to use inheritance a lot but then over time I have stopped doing this and the reason for this is because I think my coding has matured and the goals of code I am trying to create have changed.

I'm not really sure when the change of thought process occurred but I will now spend a bit more time creating code like the above to try and manage the complexity of the code and the effect of change on the code. Of course this can also be abused with the creation of a million to many classes, as with everything there is a balance to achieved but more classes maybe better than too few because at least change is more likely to be isolated then.

I would like to know what other people think about this and what's the next stage of development of a programmer



If you like this blog or and fancy something a bit less technical with some laughing thrown in then check out my other blog Amusing IT Stories. Which is a blog about funny and amusing stories from the IT environment and the office. It is a mix of news, office humour, IT stories, links, cartoons and anything that I find funny



Tuesday, November 07, 2006

Is certification becoming less popular as developer retention becomes more important?

I read this article today with the title

Another Nail in the Coffin of IT Certification

A nice dramatic title if ever I saw one. Still it is an interesting point and I love this quote

IT certifications are worth less than ever, and the value of non-certified technology skills has surged, according to the third-quarter edition of the "Hot Technical Skills and Certifications Pay Index" from Foote Partners, a New Canaan, Conn., IT workforce research firm, on Nov. 1.

"Certified skills pay has not just flat lined, it's in the negative. This is big news if you're certified and you're thinking about getting recertified," said Foote.

not only are they worth less but it almost seems that if you get one you pay will drop with the negative effect of getting certified. Wow indeed, it reminds me of the quote form Benjamin Disrali
There are three kinds of lies: lies, damn lies, and statistics.
Earlier this year I passed my SCJP 5 sun exam so I better not show this article to my boss. Of course I'm sure there are other studies and facts which show why getting certified is good for you, I blogged about one earlier this year, although the figures are for 2005.

Personally one of the main points from the article that states certified training isn't as valuable as other training courses to me seems a fairly obvious one. Training to pass an exam is going to focus on knowing the facts to pass an exam and some of the course will probably be practicing exam conditions. Where as I would imagine other courses will focus on use of the software/skill in a business environment.

I imagined most people who just study for certification by themselves rather than go on training courses because becoming certified in a subject isn't usually about something you don't know how to use, you just need to learn it in minute detail in order to pass an exam in it.

I still think becoming certified in things you aren't familiar with can be very useful because you learn the subject in great detail, although in some cases this might seem in overlearning perhaps, like do you really need to detailed knowledge of Java API's and if the compiler would compile everything, this stuff is done by the compiler and the API's are there for you too look at.

What interests me in this article in one part is has focuses "Growing Talent in-house" this I find an interesting topic and it often seems that employers of software developers don't always consider this. I have seen many times developers leaving for better paid jobs, jobs with more training, jobs with better career opportunities. I have often wondered the cost of replacing that developer, not only with another developer (who rarely seems to come in on less money) but also the particular skills that developer had to do his job.

It seems often that employers don't seem that worried about retaining employees and rarely tackle problems until people actually say they are leaving. In fact many employees seem reluctant to invest in training courses for employees. The above factors can often result in people moving which makes training people in house very difficult.

I have read a few articles now which have hinted at a skills shortage, so I wonder if this attitude will change in the future and maybe employees will work harder to retain the software developers they have. I think the words I am actually looking for is dreaming not thinking.

The one thing I would say about certification is that it is much more highly regarded by management than it is developers and this may because it doesn't give you as many skills as training courses in a different area and I would say it doesn't give you as many skills relevant to your daily work.

If training courses in certification are down then maybe power of choice of training is moving towards the employee in a bid to retain the developer. Are Developers having more say in what training courses they are going on. Still I can't imagine any person complaining about going on a certification training course or any other training course.

As manager will be the one's signing off the training and managers like certificates to put on the wall then I don't think certification is going to go away any time soon.


If you like this blog or and fancy something a bit less technical with some laughing thrown in then check out my other blog Amusing IT Stories. Which is a blog about funny and amusing stories from the IT environment and the office. It is a mix of news, office humour, IT stories, links, cartoons and anything that I find funny

They were using Java 5 but they weren't using Java 5

Recently the developers where I work moved up to using Java 5 from Java 1.4. I was the last to know which was ironic because I had to learn about all the new features to pass the SCJP 5 exam and was eager to use them. By the way there is lots of information on Java 5 new features and SCJP 5 stuff on this site, just search the blog for whatever you are looking for and it will point you to free sample chapters, my ramblings and other sources of information, I even use it myself.

I wasn't sure about jumping up to Java 5 so quickly (our there any side effects), would it have any effect asking all our customers to make sure they are using Java 5, well the ones who wanted the upgrade. Like many things installing Java 5 is very simple and it seems more scary than it is, so all in all I think it's a good thing. The main reason we did this was so we could use Tomcat 5. It isn't always easy to explain this to customers but most of the time they just say install it or we do it quickly before the IT Admin comes over to see what we are doing to his precious server.

Anyway we recently installed it, so then I started adding in Java 5 stuff, like generics and my favourites the new For loop. It all worked well in Eclipse because I was pointing to Java 5. Troubles occurred when I tried to get ant to build me a jar file. It took me ages of wrestling and mucking about with it. I found that the source element was still set to use 1.4 and then when I changed it, it plain blank refused to even admit there was such a thing as Java 5. After googling about for a morning I finally found that (going back to find it again) that in my Eclipse preferences, in the Ant/Runtime section they had these global variables and I think that in here it was pointing to an old Java 1.4 tools.jar. So I swapped this to use a Java 5 version and wahay I was compiling and jarring up like a good un.

The funny point came recently when one of the other developers practically yelled in shock when he came face to face with a generic angled bracket - "what's that, how does it compile, what does it do" he shouted. You see they were using Java 5 but they weren't USING java 5. At last my hours of study finally have some benefit. Has anyone else suddenly come across some new code, new features that appeared out of now where and scared the life out of you.


If you like this blog or and fancy something a bit less technical with some laughing thrown in then check out my other blog Amusing IT Stories. Which is a blog about funny and amusing stories from the IT environment and the office. It is a mix of news, office humour, IT stories, links, cartoons and anything that I find funny

Sorting a Properties object and Utility classes

I was trying to think of how to sort a Properties object today. I was baffled for a while to find a simple away it was at the end of the day so I went home. Then sometime during the night I remembered the Collections utility class, aha surely this will help sort it. There probably is an easier way to do it but I just couldn't think of one when I was trying but if you know of a better way than I did please add it in the comments.

I sometimes have exactly the same problem using the utility classes at work, I forget to look at them. I think it is a sort developer blind spot, you want some code to do something but its usually one method which wouldn't really fit in a class. I had a similar problem where I wanted to remove a section of text, I started writing a method thinking it would be quick and easy then I realised I had already written a method in a StringsUtils class to do exactly what I wanted and it was tested and working.

I had to do a little bit of tinkering to sort the Properties. In the end I choose to read the keys into a List and then do a Collections.sort. I read this interesting discussion after I googled sorting Properties

here is the code that I came up with. I only sorted the keys because I can then use this to retreive the data from the properties code with it.


Enumeration
<Object> keys = properties.keys();
List <String> elementList = new ArrayList();
while (keys.hasMoreElements()) {
elementList.add((String)keys.nextElement());
}

Collections.sort(elementList);


if like me you have trouble putting in examples of the new Java 5 angled brackets into html then I have found use & lt; without the space for opening angled bracket and & gt; without htespace between the & and the gt; will put the closeing bracket it.

Interestingly this is another time that passing the SCJP exam has helped me out during work, albeit not straight away. This was one of the exam gotcha's what does each of the collection words mean because there are three

collections - the term used when talking about collections
Collections - the utility class to sort and do other things to collections
Collection - the interface a lot but not all (Map)

Could that be any more confusing!

If you like laughing then check out my funny blog Amusing IT Stories. which is A blog about funny and amusing stories from the IT environment and the office. It is a mix of news, office humour, IT stories, links, cartoons and anything that I find funny