Monday, December 8, 2008

Questions to ask employers

After thoroughly grilling the applicant for a job/project, many interviews often end with the question - "So, do you have any questions for us?" I've read in articles by career coaches that it is a good idea to have a few questions to ask here - it shows that you are interested. But the first times I had problems coming up with any sincere and interesting questions.

After being at a number of different programming jobs now, big and small, I've come up with a list of questions. Some of these I intend to ask next time I'm in that situation. Not all of these questions require a "yes" answer from me, but at least that they know what these items are and can reason around them. If they answer "We don't know what these things are!", or "Yeah, yeah, I'm sure that's great stuff, but we don't have time for that sort of academic stuff, we have urgent deadlines to meet" that will be a strong warning signal to me to reconsider, or at least ask for decent pay to make up for the inevitable stress...

  • Do you use a version control system for your code? Which?
  • Do you use a continuous integration system? Which?
  • Development processes - none, Scrum, RUP, agile...? Would you say you follow them closely, or do you have you cherry-picked a subset of practices from them that you like/have found to work well for you?
  • Do you have an internal Wiki? Does anyone use it for project documentation, or do you generally use Word/PowerPoint/Excel files instead?
  • How do you handle incidents? Do you use a standard process such as ITIL or have you made your own? Either way, how do you integrate incident handling in development? Separate teams, or...? Branch the source often, or...?
  • How do you get things deployment ready and how do you deploy, are there many manual steps involved?
  • How are your enviroments set up, do you have separate environments for development, dev testing, integration, prod-test, production? (Or do they have a variant of the dreaded developmestuction environment?)
  • Very rough estimate, on a scale from say 1 to 5, how pleased are you with the unit test coverage of your codebase? Ever used any test coverage tools to check?
  • Has your team been required to do any all-nighters (or late-evenings) last year because of critical deadlines or major incidents? How many?
  • Do you use any code-quality checking tools such as Findbugs?
  • Are employees allowed to use work time to improve their skills? How do you handle that - do you decide what they should study, or is that up to them? Ever arrange any lectures, study groups or anything like that internally in the company? Are employees encourged to head these, or do you hire external people to lecture?

Feedback appreciated. What are your suggested questions?

Update - two good suggestions from David R. MacIver via Twitter:
  • Can you give me a coding sample? :-)
  • I also like to give them slightly bizarre questions like "Tell me why I wouldn't want to work here".

Thursday, June 19, 2008

Delete the obsolete

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. :)

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.

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...?

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.