A week ago I was in the unenviable situation of having to dig through a large number of legacy apps and libraries in Java, C and VB to find references to a database attribute that was going to be retired. Examining just one file took a long time, since a file containing a dangerous reference might have been imported as a helper lib in other projects - and to make things worse, I couldn't immediately see if these projects were obsolete or not.
In my current project, my fellow employees have a very good overview of which systems are used where, and which versions are deployed, so when I am unsure I can always ask them. However, had they quit and taken that knowledge with them, I would have faced a combinatorial explosion of repository source versions, deployed versions, and production environments that would have made my task impossible; not just very hard and time-consuming as it was now.
For clarity and maintainability, if a system is obsolete you should always at the very minimum comment database tables, tag repositories and check in README files to the repositories that clearly show that these things are no longer used. Even better would be to move the data to separate "graveyard" branches/databases. I think the best of all would be to delete the obsolete files, since you can always reconstruct them from the repositories and backups in the extremely unlikely case that you would need them again. I understand if some people are reluctant to do that, the human urge to hang on to things "just in case" is strong.
It is a project management anti-pattern to keep obsolete projects and modules in your source repositories, and obsolete database tables on your servers. You will soon accumulate a technical debt which, like the debts in your bank accounts, will keep growing over time. Keeping track of possible dependencies between systems and components becomes progressively harder, and it will becomes increasingly difficult for new developers to get an overview of the architecture. More and more valuable development time will be spent on "the debt" instead of useful tasks. Developers will not have the courage to refactor, and this will feed the negative habits of adding stuff but never removing - not very agile.
Luckily the managers at my current company have been convinced to set aside developer time during the summer to clean up the source repository and move obsolete code to a separate view. At this particular company, I won't have the tedious task of searching through obsolete code again. For all our sakes, I urge you to do the same. :)
Thursday, June 19, 2008
Monday, June 16, 2008
Hudson and ClearCase
If you want your company to be more agile and want to install a Continuous Integration system, but are stuck on Clear Case, here is a little howto. I am normally a Linux/Unix boy, but Windows was mandated.
Download and install a servlet container such as Tomcat. Secondly, download the Hudson war file. You can (should) define a HUDSON_HOME environment variable. Start Tomcat, deploy the Hudson war to the webapps dir, the "jobs" and "plugins" directories should be created in your HUDSON_HOME directory.
Either use the builtin plugin manager page, or if like me you can't get it to work, download the Clear Case plugin manually and put it in the HUDSON_HOME/plugin directory and restart Tomcat.
Go to http://localhost:8080/hudson/ and choose "Manage Hudson" -> "Configure System". Configure the Cleartool executable home (usually c:\program files\rational\clearcase\bin\cleartool), and other tools/services you might use for your projects (Ant, Maven, SMTP server etc)
Select "New job" -> "Build a free-style software project" and select a name, press "ok".
How to configure stuff here depends on how your Clear Case administrator has set up your system, but this is what worked for me.
Select the "UCM ClearCase" radio button and configure the following fields:
View name - select a new unique view name, for instance "hudson_myproject". This is the view that Hudson will create for you.
Stream selector - this is very project dependent, this is how I figured out my stream name: If you have the ClearCase Explorer tool, select "Toolbox" tab -> "UCM" dropdown -> "Join project" link -> select your project -> "Properties" button. Now directly under the project name you see a string somewhat like the following:
project:myproject_1.0@\servername
Then the following should be your stream name:
myproject_1.0@\servername
If you have checked out a project view before with CC Explorer manually to the default drive (usually M:) you can go to M: with Windows Explorer and rightclick on the directory there and select ClearCase tab, then properties. You should be able to get the Stream string from there too.
Load rules - Backslash + the path to a VOB (database file containing the project) just under the root of the project view. Again, if you have previously created a view using ClearCase explorer and mapped it to drive M:, go to M: and open the view directory there. Select one of the subdirs there as your "load rule". For example, I had
M:\myproject\src
so my "load rule" became
\src
Now press "advanced" button in Hudson config, and configure the following:
Additional mkview arguments - Here I had to use the -vws parameter to the mkview command, plus a UNC name. Something like this:
-vws \\companynetwork\clearcaseviewsserver\AD\myusername\
This is where Hudson will create the view directory, but the source itself will be checked out to, and built from, your HUDSON_HOME/jobs/jobname/builds/ directories.
Download and install a servlet container such as Tomcat. Secondly, download the Hudson war file. You can (should) define a HUDSON_HOME environment variable. Start Tomcat, deploy the Hudson war to the webapps dir, the "jobs" and "plugins" directories should be created in your HUDSON_HOME directory.
Either use the builtin plugin manager page, or if like me you can't get it to work, download the Clear Case plugin manually and put it in the HUDSON_HOME/plugin directory and restart Tomcat.
Go to http://localhost:8080/hudson/ and choose "Manage Hudson" -> "Configure System". Configure the Cleartool executable home (usually c:\program files\rational\clearcase\bin\cleartool), and other tools/services you might use for your projects (Ant, Maven, SMTP server etc)
Select "New job" -> "Build a free-style software project" and select a name, press "ok".
How to configure stuff here depends on how your Clear Case administrator has set up your system, but this is what worked for me.
Select the "UCM ClearCase" radio button and configure the following fields:
View name - select a new unique view name, for instance "hudson_myproject". This is the view that Hudson will create for you.
Stream selector - this is very project dependent, this is how I figured out my stream name: If you have the ClearCase Explorer tool, select "Toolbox" tab -> "UCM" dropdown -> "Join project" link -> select your project -> "Properties" button. Now directly under the project name you see a string somewhat like the following:
project:myproject_1.0@\servername
Then the following should be your stream name:
myproject_1.0@\servername
If you have checked out a project view before with CC Explorer manually to the default drive (usually M:) you can go to M: with Windows Explorer and rightclick on the directory there and select ClearCase tab, then properties. You should be able to get the Stream string from there too.
Load rules - Backslash + the path to a VOB (database file containing the project) just under the root of the project view. Again, if you have previously created a view using ClearCase explorer and mapped it to drive M:, go to M: and open the view directory there. Select one of the subdirs there as your "load rule". For example, I had
M:\myproject\src
so my "load rule" became
\src
Now press "advanced" button in Hudson config, and configure the following:
Additional mkview arguments - Here I had to use the -vws parameter to the mkview command, plus a UNC name. Something like this:
-vws \\companynetwork\clearcaseviewsserver\AD\myusername\
This is where Hudson will create the view directory, but the source itself will be checked out to, and built from, your HUDSON_HOME/jobs/jobname/builds/ directories.
Wednesday, May 14, 2008
Type inference thoughts
I have been wondering about one thing and throw out this question just in case someone possibly reads my blog - does type inference bring any benefits apart from less typing?
I know proponents of dynamic typing consider declaring variable types "noise" because it is the antithesis of their style of coding, and they say the compiler can usually infer the type for you anyway. Scala for instance is designed this way:
var x = "Hello"
The compiler will infer that x is of type String. You can reassign it (just like you can in Java) to a new String, but if you try to reassign an object which is not a String compile will fail.
Map<Integer, Office> offMap = ....
for instance, is more to type, that is true. In my opinion that can be an acceptable tradeoff. If I have the code in an IDE mouseover could tell me the return type of the right hand side method, true, but I often look at code through other interfaces than an IDE (online, books, a shell). Note that I'm not saying I think type inference is bad... sometimes it is a relief. But I don't think it is terrible that Java lacks it, either. For me it is just a matter of style.
But just in case I have missed anything, my question is again: does type inference bring any other possible benefits? Compiler optimization...?
I know proponents of dynamic typing consider declaring variable types "noise" because it is the antithesis of their style of coding, and they say the compiler can usually infer the type for you anyway. Scala for instance is designed this way:
var x = "Hello"
The compiler will infer that x is of type String. You can reassign it (just like you can in Java) to a new String, but if you try to reassign an object which is not a String compile will fail.
Map<Integer, Office> offMap = ....
for instance, is more to type, that is true. In my opinion that can be an acceptable tradeoff. If I have the code in an IDE mouseover could tell me the return type of the right hand side method, true, but I often look at code through other interfaces than an IDE (online, books, a shell). Note that I'm not saying I think type inference is bad... sometimes it is a relief. But I don't think it is terrible that Java lacks it, either. For me it is just a matter of style.
But just in case I have missed anything, my question is again: does type inference bring any other possible benefits? Compiler optimization...?
Tuesday, April 22, 2008
Mobilt bredband med Kubuntu Linux, Tre och Huawei E220
Enklaste sättet att få mobilt bredband från 3 med Huawei E220 ("ovala pucken") att fungera under Kubuntu Linux:
- Ladda ner och installera Vodafone Mobile Connect Card driver
- Plugga in modemet med singelsladden (sladden med dubbla USB pluggar är för datorer med USB portar som inte ger tillräckligt med ström tydligen, men för mig fungerade det inte bra med den sladden) och vänta några sekunder. Om allt är ok ska du se följande rad i dmesg: "GSM modem (1-port) converter now attached to ttyUSB0". Du kan få en hel radda ttyUSB kopplingar, men det gör inget.
- Starta Vodafone klienten, den bör detektera modemet, du får skriva in den PIN kod som kom med SIM kortet. Skriv i ett fejkat användarnamn och lösenord (typ "username" och "password"). Dessa MÅSTE vara med även fast de inte används, annars blir det fel när du kopplar upp dig.... Skriv i bredband.tre.se i fältet "APN".
- Om du stavat fel någonstans i de tre fälten ovan måste du radera profilen och skapa en ny, eftersom en bugg (i alla fall i Beta 2 versionen som jag använder) gör att ändringar gjorda i "edit" mode inte sparas korrekt.
- Klienten fungerar även bra efter uppgradering till Kubuntu 8.04, men du måste då lägga till "airprime" modulen i /etc/modprobe.d/blacklist filen, då dom drivrutinerna försöker ta över modemet men misslyckas. Du måste också antagligen radera din dolda katalog med inställningar (.vmc2) i hemkatalogen.
Tuesday, January 15, 2008
Facebook scepticism
Interesting read....
The only REALLY useful thing I personally get out of Facebook is an easy place to look up contact information of friends, and seeing what my friends are reading. But I agree with the article - you can only add books that you can buy from large US companies such as Amazon. You can't add books from Swedish bookstores for instance, or classics that are out of print... nor can you add open source games, or games bought online.
Facebook is not the product, YOU are the product, and you are being sold to the real customers - the advertisers.
The only REALLY useful thing I personally get out of Facebook is an easy place to look up contact information of friends, and seeing what my friends are reading. But I agree with the article - you can only add books that you can buy from large US companies such as Amazon. You can't add books from Swedish bookstores for instance, or classics that are out of print... nor can you add open source games, or games bought online.
Facebook is not the product, YOU are the product, and you are being sold to the real customers - the advertisers.
Sunday, December 30, 2007
Blogger.com online editing is awful
I have just spend some VERY frustrating days fighting with Blogspot/Bloggers online editing, as I was finishing my "Guide to OpenJDK" article. Avoid using the "a name" tag at all cost, it is normally used to create internal links to chapters in a webpage. When you switch to the preview or compose page, Blogger scripts automatically duplicate this tag EVERYWHERE throughout the text for some bloody reason. Before header tags, inside header tags, after header tags, before links, before images, before every paragraph, before lists, inside every list item.... You will have to spend hours removing them... and if you miss one, like I did, it will metatasize like a cancer all over your text if you switch editing mode again! Fun!!
Also it doesn't save your original hand edited HTML. If you use the "lesser than"/"greater than" html elements to show, for instance, an email address, when you go to compose window everything looks ok, but when you switch back to editing html it will try to parse what is inside the "tag" characters, fail and delete your text.
Also it doesn't save your original hand edited HTML. If you use the "lesser than"/"greater than" html elements to show, for instance, an email address, when you go to compose window everything looks ok, but when you switch back to editing html it will try to parse what is inside the "tag" characters, fail and delete your text.
Friday, December 28, 2007
The LG DBRH198
Our Samsung digital TV decoder broke down recently, and when looking for a replacement I found the LG DBRH198 - a combined DVD/CD/DivX/WM/jpg player, digital decoder, cd/dvd burner and 120GB media recorder. After spending a very frustrating day and a half trying to get it to work, I am now returning it.
Pros:
Pros:
- Would have replaced four machines (VHS, DVD, CD, decoder) with one, if it had worked. Compact living, and saves energy!
- Image was sharp, at least on our small LCD TV.
- Refused to read our Boxer smartcard connected through a CAD adapter, only the free channels worked.
- Text TV fonts were ugly, an eyestrain to read.
- When going through menus it kept "locking up" randomly so we had to pull the plug repeatedly.
- If we accidentally pushed the AV button on the remote we lost the decoder image. It got to AV4 and then refused to cycle back to the beginning no matter what buttons we pushed and we had to do a "reset to factory settings" to get it to read from AV1 (antenna) again. Perhaps there is a better way, but the manual didn't say. I don't know if this is a bug or just really poor user interface design
- Poor interface design in general. We are two engineers in the household, and if we were having problems finding out how the menus work... not a good present for grandma.
- Poorly translated menus. Unlike some machines I've owned, this time it wasn't so bad that it made understanding difficult, but it was still distracting. Manual was ok though.
- Felt slow and sluggish - slow on startup, slow to change channels, slow to read the DVDs.
- We could not get sound to work through the decoder. It generally worked when playing DVDs (see below), and once we stumbled into playing back a recording from the hard drive and then it worked, but we never got it to work when watching TV directly through the decoder for some reason. Perhaps there was some setting hidden somewhere, or we should have used another audio cable, but this is something I think should just work out of the box and not something you have to fiddle around with for hours trying to get to work.
- Once when playing a DVD the sound was suddenly just roaring white noise. The same DVD had worked fine 10 minutes before on the same machine...
Subscribe to:
Posts (Atom)
