Pencils Down

This weblog is about my experiences in software development

A new company, another set of random values for serialVersionUID.

Not sure why most programmers have the urge to put in some huge, ‘random’ number here. The objective is to match versions during serialization. Can’t imagine using a random number is a good idea.  Even better, the numbers entered are not random.

Sorry, this is just a pet peeve. There is much written up on using this correctly if you are truly serializing objects. I think I have seen this at every company I ever worked.

Share

Would you work where the programmers had to pass a personality test?

  • Yes (50%, 2 Votes)
  • No (50%, 2 Votes)
  • Have to be a lot of money (0%, 0 Votes)
  • Could I see the people that passed? (0%, 0 Votes)

Total Voters: 4

Guess this is a little to close to the PC line for people to express their opinion.  Too bad.

Share

I have grown to really hate eclipse. Seems like every keystroke now starts an “update maven dependencies” task.

Have tried several of the options that supposedly stop this to no avail.

Doing most actual builds from the command line using mvn commands.

Starting to use notepad+ for editing files lest I start another update process.

Even worse, in many cases when this is happening I am changing very few lines of code.

Last bit was doing a search, clicking on the search result to pull in the file into the editor started maven off and running.

Maybe switch to intellij. Someone here was using that, but they left. Kind of hard to push yet-another-tool upon the team or be an outlier using a non-standard.

Share

Went to meetup given by Phillip Tellis from Soasta/log normal

Some notes I took:

  • Gzip static
  • Image optimize, reformat png with lesser bits
  • Cache control public max age
  • Turn off last mod header
  • Turn off etags
  • Serve root domain thu CDN
  • Css on same domain
  • Include js critical in head; load enhancements js async (use attribute on script tag)
  • Chrome audit css – excellent tool for evaluating css usage
  • Parallelize downloads
  • Flush early, often
  • Gzip chunking
  • Add Mod_pagespeed
  • Parallelize, predict, cache
  • Prefetch next page
  • Anon iframe fir css and js
  • Link rel dns-prefetch, sunresource, prerender

His slides are here

Share

We have a case where people can submit multiple changes to their database records. Each change is handled separately with code like:
- from table where attribute=value
- object.setChangedValue(updatedValue)
- hibernate.flush()

However, if the user happened to submit two changes to the same record the initial query will return the initially obtained object – NOT the updated value.

We fixed this by performing a refresh() once we get the object back from the hql query.

Share

Met someone that works at a cloud software company. The company promise is that your infrastructure xxxx problems are handled by us in the cloud. Nice premise.

Reality is they are hobbling together a bunch of non-scalable apps written in a variety of languages together as a solution. The various pieces are re-developed (daily) into Java so that some kind of architecture can be established.

Yes, the original silo solutions are still being developed in their native language.

Yes, the amalgamating team has a daily run around to see what happened and ‘fix’ it.

Yes, there is an architect overseeing the lot and trying to herd these various individual teams into the same direction. (What’s that old joke about trying to herd a bunch of somethings?)

And, did I mention they are scattered across Europe so not in the same time zone or language.

Sign me up!

Share

Ran for a few months. 18 responses:

c3po 10 votes (56%)
dbcp 4 votes (22%)
oracle 3 votes (17%)
other 1 vote (6%)

I was curious. Current employer had been a big Oracle/Forms shop and naturally acclimated to using Oracle. Prior several employers had used c3po.

Share

Joel Test

No comments

Saw this used on a job site to evaluate a position. Neat quick-and-dirty evaluation of a new position: A good company gets a 12.

The Joel Test

  1. Do you use source control?
  2. Can you make a build in one step?
  3. Do you make daily builds?
  4. Do you have a bug database?
  5. Do you fix bugs before writing new code?
  6. Do you have an up-to-date schedule?
  7. Do you have a spec?
  8. Do programmers have quiet working conditions?
  9. Do you use the best tools money can buy?
  10. Do you have testers?
  11. Do new candidates write code during their interview?
  12. Do you do hallway usability testing?

http://www.joelonsoftware.com/articles/fog0000000043.html

Share

We have a fairly large database with years of stored procedures and views and the like.

Recently we tried to access a view to get a count of items right after we update the items list. Seemed simple enough: just flush so that all the ducks are in a row. Wrong.

Turns out the view is based on an indirect access to the item list we changed, so as far as Hibernate is concerned – nothing changed.

Another engineer had the breakthrough: evict the view thereby forcing Hibernate to re-establish the values. Ta Da!

Alternatively we could have mapped that indirect set that the view uses.

Share

FindBugs is a program which uses static analysis to look for bugs in Java code.

It is offered as an Eclipse plugin. So, just like any other plugin:

  • right click on the item(s) you want to check,
  • click on “FindBugs” and
  • off you go.

Some of the issues that have come up for me:

  • use of static SimpleDateFormat – it’s not thread safe – who knew?
  • new coding did not have a setter for a dao – hopefully testing would have shown the error
  • compares on different object types – the code looked correct, but oh oh…

I love things that just work

Just saw that Java 8 fixes the date problem – http://www.oracle.com/technetwork/articles/java/jf14-date-time-2125367.html

Share