søndag 6. desember 2009

Less coding, more... other stuff?

I just realized that I haven't done so much programming this month. I have always thought that we developers can measure our work by watching the progress in our development projects. Well, this is still right, but nowadays I am not the one in our team who does the coding. I am the one who ensures that the other team-members can concentrate on the programming and ensure progress. So what do I do now? Well, I do some programming, about 2 hours a day. The rest of the day I spend my time writing e-mails, updating project management software, ensure communication with other teams/departments, consulting other people if something needs to be clarified. And there's always support calls, of course. Mostly internal support calls, actually. At last there is always a document or two that needs to be written. Some routines must be created or updated, etc..

Although I am really fond of just programming, I kinda like these other duties too :) There's lots of other things that needs to be done when you are working in a team. So if my "new" tasks at work will help the overall status in our team and contribute to more efficiancy I will gladly continue doing this.

fredag 23. oktober 2009

Delegates and anonymous methods (by PEtter)

A little stange thing I found using delegates in vb .net 3.5

Starting with:



Public delegate Function Something(ByVal a as integer, ByVal b as integer) as boolean

Public Function doSomething(ByVal a as integer, ByVal b as integer) as boolean
  return a = b
end function



To use this you would do something like this:


 Public Function ExecuteDelegate(ByVal a As Integer, ByVal B As Integer, ByVal d As Something) As Boolean
            Return d(a, B)
        End Function


And then you can use your function with a delegate:


  ExecuteDelegate(1,2, addressOf doSomething)


In .net 3.5(vb) you could simplify this by using inline functions:


ExecuteDelegate(1,2,Function(ByVal a As Integer, ByVal B As Integer) A = B))



And so to the strange part.
If you do not need the parameters to resolve your return value you could do:


ExecuteDelegate(1,2,Function() false )


As you can see, inlining the delegate without the correct signature, but as long as you provide 'no signature' this works fine!

'Funny'?

fredag 16. oktober 2009

Gantter - web-based project management now in Norwegian (Norsk webbasert prosjektstyring)

I am a big fan of Gantter, and I use it in my work daily. So I contacted Volodymyr Mazepa and offered my services, and it resulted in a Norwegian edition of gantter. I'm not sure if it works in Firefox for the moment, but if you are norwegian and use IE then you will automatically get the norwegian version of Gantter.

Go check it out  on http://gantter.com

tirsdag 13. oktober 2009

Url routing with Asp.Net 4 webforms

Since the introduction of ASP.Net MVC this framework has gotten very popular, especially if you follow all the blogs out there writing about it. But I would really like to know how many have actually ported their applications from Webforms to MVC? I think many programmers are curious to MVC because of the url routing hype that's been going on (This is actually the main argument I hear from some developers), but they forget that changing to MVC requires (for many) a lot of new aspects in the way they code. They may have to sacrifice some habits/techniques and this takes a lot of effort.

Guess what? Url routing can be done very easily with the routing engine in ASP.Net 4 Webforms.
I recommend that everyone reads this article from Scott Guthrie.
So if url routing is your main argument for porting to MVC, maybe you don't want to convert your webforms applications after all? :)

mandag 5. oktober 2009

Buy, not build - Confessions from a Telerik junkie

Most of the developers I know don't like 3rd party controls. They like to be in the front seat, to have control. That's of course a good thing, because it shows they take responsibility for their own code, and they also have full control of future changes.

I understand why they do this, but I have a different opinion. There is no need to reinvent the wheel. If someone already has done your job then you could focus on other things. Choose a vendor! I myself use Telerik GUI Controls all the time. Telerik is a serious, professional company that has grown immensely over the last year. Their controls are fast and reliable, customizable and they always have well defined roadmaps for future changes and features in their product families.

So instead of using several weeks developing my own treeview with load on demand nodes and context menus, I can use default built-in features on the telerik treeview and use my resources to focus on other aspects of the product.

Of course, there are other 3rd controls vendors out there with less professional values that you should avoid. There's NOTHING more annoying than running into a bug that's beyond your control. You simply have to wait for the vendors to fix it. That's probably the biggest reason why developers like to build things themselves. If you have experienced this once, you would definitely not want to be there twice!

But as long as you use a professional vendor like Telerik you have nothing to fear. It's going to save you a lot of time. Check it out yourself at http://www.telerik.com

torsdag 1. oktober 2009

Code quality versus Profit

I am the first to admit that my codebase isn't exactly following the latest standards out there. It's not bad, but if someone else inspects my code I guess he would notice several things.

A completely lack of documentation and tests
Wow! What can I say? I have created 2 great web-application at work (and they sell good!), and none of them has one single line of documentation or test classes. I would probably get arrested by the coding police, but to my defence I can say that I haven't got the time. Short deadlines, and other things to do right after. I know this is the situation for many developers, but the first thing you cut out for saving time and money is - exactly - documentation and testing. In addition, I have worked alone on these web-applications so there has been no need for others to dwelve into my codebase. Good names on methods and classes have been enough documentation for me.

Workarounds
Instead of doing it the right way, I also have been tempted to write a little workaround here and there, which saves me some time. I know that I may regret this later on, but chances are good that the code works for a long time. (Maybe you refactor the whole codebase long before you have trouble with the workaround)

GUI
Since our company doesn't have its own dedicated designer we programmers often do the GUI work ourselves. I don't like GUI work. So my html and (non-)css habits may cause shock for a real designer, with his floating div's and liquid css layouts. What's wrong with a couple of tables?

"Hands against the wall! My friend, you are under arrest!"

With that being said, I can now move on to something more important. Our company makes money. A LOT of money. I have now listed many of my bad coding habits, but one of my best qualities is the fact that I work fast.  I am good at estimating, and usually finish projects within deadline. My product managers are satisfied with my work and they do certainly not care how my codebase looks like as long as I finish as soon as possible.

So what answer do you think I get if I ask them for a little more time to document my work? Or introduce a testing framework?
"'Why? Is it necessary? Can it wait? It's this other project that's really critical."
Time is money. It's not that I make ultra-fast crappy code that works for a week. My applications work fine. It's just that I may take a shortcut when offered, and I haven't had any needs for taking the time to documenting my work or writing tests. Until now....

Next time, I will be writing about big changes in our small development environment that surely will change the way I code. I do not work alone on my products anymore. I am now a part of a team. We must work together. And our team must collaborate with other teams. Routines, separation of concerns, bus-factor, ownership and readability are some of the keywords

mandag 28. september 2009

Searching a collection or list of objects

God I love those anonymous methods. Remember the time (VB.NET) when you had to implement a named function and then pass the signature in the find method of the list?

Example :
Dim dinosaurs As New List(Of String)
dinosaurs.Find(AddressOf EndsWithSaurus)

Private Shared Function EndsWithSaurus(ByVal s As String) _
As Boolean

If (s.Length > 5) AndAlso _
(s.Substring(s.Length - 6).ToLower() = "saurus") Then
Return True
Else
Return False
End If
End Function


now you can only do this

Dim dinosaurs As New List(Of String)
dinosaurs.Find(dinosaurs.Find(Function(s As String) s.EndsWith("
saurus")))

that's genius
I don't like that the programming languages are getting too dynamic, but this one is a stayer!