Archive for Development

Options

I don’t like WordPress. This has been documented somewhere in this blog. I’m too lazy to link it.

Some other people don’t like WordPress either sometimes. I was just bitten by that same caching issue.

You see, I had made the mistake of thinking that enabling the WP-Cache plugin would actually enable caching on my system. I always thought “Man WordPress sucks! My blog is so slow! And nobody reads it anyway so it can’t be because people actually care about what I’m writing!”

But I digress. I enabled the WP-Cache plugin, and it was still slow. I looked a bit further, and the default options of an enabled WP-Cache plugin explicitly disables caching. You have to go into the plugin’s settings page and click “Enable”.

What the hell is that?! You know what that is? That’s a programmer right there. We love options. “Oh well if my toaster could turn inside out I could use it as a space heater in my bathroom.” Nobody wants to do that, but we love the fact that we could. We end up designing software for ourselves instead of our customers.

This is bad! Bad, I tell you! Bad! If i could hit you on the nose with a rolled up newspaper I would! Twice!

Users don’t want options, nerds want options. If you have a techy audience, then consider piling in options. R# has a million, and I think each and every one is delicious.

However, if your users are Johnny down on the warehouse floor, he doesn’t want to know about transactions, offline/online operation, or whether or not the circuit breaker is tripped or not. He wants to do work so he can get home and play with his kids.

And remember, DON’T LISTEN TO YOUR USERS. I love this quote:

Definitely don’t believe what people predict they may do in the future.

Leave a Comment

External Dependencies and You

I’m having a lot of problems with external dependencies lately. Especially with Castle Project. It’s not because Castle Project is bad. I think it’s more because Visual Studio is stupid.

Visual Studio basically encourages people to put all their external dependencies in the GAC. The problem with this is that when you go to build it on your build server or some other dev’s machine, you have incredibly annoying task of downloading and installing all the MSI’s for all those libraries you used.

My solution, according to “SVN Best Practices” (Best practices rarely are ‘best’), is to have an Externals directory at the root of my SVN, with binaries of the libraries I use in it, in a folder hierarchy like so: http://server/Externals/LibraryName/VersionNumber/*.dll

Then, to each project I add a “/lib” folder in the project path, and add an svn:externals property to that lib directory for each library I need.

You probably already know this. Almost everyone does this (or should do some variant on this). The problem? It’s a damn pain in the ass!

Every single project has to have this lib folder, which is maintained to only include relevant libraries, is a pain in the ass to add. Maybe it’s because there is a lack of tooling. Imagine if VisualSVN or some other too understood this hierarchy and just let you select libraries to add to your lib folder. Wouldn’t that be nice?

I’m annoyed. It’s very annoying. Any thoughts?

I just had a semi-obvious thought: Maybe I should put my lib folder at the solution level in the folder hierarchy. At least at that point I don’t have to maintain 50 different lib folders and their external dependencies. But I hate that too, I hate dependencies above my project file.

Comments off

ALT.NET Seattle

So, I know ALT.NET Seattle closed 2 day ago, which, in “Internet/Blogger Time” is approximately 1.5 million years ago, but I want to blog about it anyway. Warning: rambling ahead.

Passion.

That sums up a great deal of what the conference was about. People were insanely passionate about the things they were doing, which seems simple enough, but sometimes I feel like nobody really gives a crap. These people loved what they do. They see that there’s a better way to develop software, and they want to show the world how well it works. Since I tend to hop around and wave my hands all over the place when I get excited about software related things, being around people who show such passion (maybe not by hopping around) was really refreshing.

Sessions.

I really enjoyed the session by John Lam on IronRuby. I’m very much not “in the know” on IronRuby, so I had a couple months ago gotten the mistaken impression that nothing really was going on. That was immediately dispelled, and I realize now that I got that impression because there are no binary releases of IronRuby. It’s a sort of implicit warning sign along the lines of “There be dragons here.” This was a theme throughout the conference. I need to get over it I guess. We’ll revisit that.

Anyway, the IronRuby talk was good, although it was a bit deeper than I would have liked to see, personally. Of course everyone else knows about 50 times more about IronRuby and Ruby in general than I do, so I don’t feel personally slighted in the least. It was still really interesting, and I plan on stealing John’s setup of using Vim inside Visual Studio (ViEmu) and FireFox (Vimperator). I’m less convinced about Vimperator, but ViEmu sounds pretty sexalicious.

Agile Coaching

The two sessions that had the most profound influence on me personally was the session “Coaching Agile Teams” hosted by Jim Shore. I have inherited a team, and I am trying very hard to incorporate new technologies and techniques into our development practices while at the same time not overpowering them. It’s a little overwhelming at times, being fresh out of school and suddenly finding myself in charge of our daily software development efforts. It was great to talk to these guys though, and get a few ideas (well 4 pages of ideas) and a little confirmation that I haven’t just completely screwed it all up, heh.

The ideas we talked about, empowering the team, investing in the team’s long term functionality, and similar things, were echoed throughout the second day of the conference in a session (I think by Oren Eini, the wiki is throwing me errors for some reason right now, I can’t confirm) discussing how to convince your team that using these advanced programming practices (IoC, AOP, SOC, TDD, SRP, etc.) is beneficial.

There was a lot of discussion about how frustrating it can by trying to convince someone that there is a better way when they aren’t interested in learning a better way. Of having people in technological positions who are not interested in technology. The frustration was palpable, but I personally got the feeling that all of the frustration is rooted in the tension of people resisting an effort along the lines of: “I want to make your life better by making your work easier in the long run.”

Em-Vee-See

The session on MS’s MVC offering was pretty good. I’m just getting into the whole MVC shebang, and what I was personally interested in coming away with was that if I choose Monorail over MVC, or MVC over Monorail, I wouldn’t get horribly screwed. A comment was made concerning MSMVC’s better integration into the IDE versus Monorail, and Chris Ortman made a comment during the session about how his personal experience was a bit of the opposite with a developer he had bringing him up to speed on MVC.

I approached him afterward for a little elaboration, as we have a web project coming up soon and I’m pretty convinced this is the way to go. His comments were very reassuring, and I came away with the thought that, if anything, the Castle Project may be the *more* supported solution, simply because the mailing lists are so awesome, something I can attest to personally. I also learned that I should probably move away from RC3 of Castle Project (the last binary release) and just use trunk. Sort of goes back to my predisposition against using non-binary releases.

Btw- Check Chris’s Blog for an idea he and some others have for a Developer Exchange program. I love the idea.

Grassroots

I also met a gent by the name of Alan Buck. He seemed pretty cool, local to Washington, and through our discussions he asked if I’d be interested in joining a micro-community of people here in Washington we can reach out to to bounce ideas off of and so forth. I contacted him yesterday, and I’m really excited about the opportunity. I’ll update with what goes down.

Also, does anyone know of any developers in Eastern Washington (read: East of Snoqualmie Pass). There are a crapload of resources for those in Seattle, Redmond, Olympia, etc., but nothing I’ve found for us desert-folk. I’d like to connect with those out there, and I’ve been considering forming an Eastern Washington User Group of some sort. Especially since for like 3-4 months a year we’re cut off (or at least seriously discouraged by such things as avalanches and tire chains) from the west side.

Other: _________

There was a lot else going on. Like how Scott Bellware came off as kind of rude, but then by the end of the show had completely garnered my respect, all without even having to personally interact with him, and how Ben completely blew me off 2 nights in a row (Thanks ben! ;) j/k), or how Steven “Doc” List was an amazing facilitator, or how Jim Shore had this amazing style of being very soft spoken, respectful, and polite while exerting a powerful control over the session. (Doc and Jim Shore have crazy awesome people skills), and umm… yeah. stuff.

It was great. I met amazing people. I didn’t meet anyone I didn’t like (I know, right!?). I can’t wait until the next one. I think I might try to go to Austin. We’ll see.

Comments off

Design Evolution => Designer Evolution

I’ve only been working in industry on real software since about February, and I’m beginning to be aware of just how much academia stunted my growth as a software engineer/designer. A Computer Science education (at least at University of Houston) doesn’t really teach you how to design or engineer software. They teach you a lot, but I’m pretty sure I never heard the terms IoC, MVC, Dependency Injection, Static Gateway, or even Design Pattern in any of my courses. I never got the opportunity to take Venkat’s OOAD course, which is probably one of the biggest regrets of my academic career, so maybe that’s what I’m missing. Even so, it seems a bit much to entrust the wholeness of modern OO software design to a single professor’s course.

The point of this post is that I’m learning a lot of design-related stuff, and I’m learning it fast.

Fast enough that the library I started at work about 2 weeks after I started working here is already unsatisfactory to me. It’s better than what it’s replacing, but I feel like it could be even better now that I have the experience of building it.

I guess that’s experience, but I’d rather just know it all up front. :)

Comments off

Delegate Covariance

Once again I slam into a VB.NET2005 limitation I’m told is fixed in 2008. 2008 sounds pretty hot.

Again, this post derives from adventures in Newsgroupland!

Here is what I was trying to do:

Public Class Part
End Class

Public Class SpecialPart
    Inherits Part
End Class

Public Class FormManagerTest
    Public Delegate Function PartGetter(ByVal id As Integer) As Part
    Public Function GetPart(ByVal id As Integer) As Part
        Return New Part
    End Function
    Public Function GetSpecialPart(ByVal id As Integer) As SpecialPart
        Return New SpecialPart
    End Function
End Class

Public Class Test
    Sub Main()
        Dim fm As New FormManagerTest
        Dim getter1 As FormManagerTest.PartGetter
        Dim getter2 As FormManagerTest.PartGetter

        getter1 = AddressOf fm.GetPart
        getter2 = AddressOf fm.GetSpecialPart
        getter1.Invoke(1)
        getter2.Invoke(1)
    End Sub
End Class

This doesn’t work in vb.net 2005. The assignment to getter2 throws an error that the delegate does not match the specified type. The function returns a derived type of the delegate’s return type, but 2005 doesn’t give a damn about that.

Herfried K. Wagner gives me the most definitive answer (mostly because he told me the name of what I was trying to do). He basically said it’s not available in 2005 and that it’s available in 2008 and that that feature is named “Delegate Covariance”.

In software engineering, names are powerful beasts. It’s almost like some wacky D&D magic, you gain a lot of power by knowing someone’s name. A lot of people have coded various design patterns without knowing it, but until you know their names you can’t really discuss them with other people in any sort of concise fashion. Compare:

Dev1: “I coded this class for our application configuration object that is incapable of being directly instantiated and instead has a static member which ensures at runtime that a single instance exists at any given time across any number of threads.”

Dev2: “Our application configuration object is a Singleton.”

If i knew what Delegate Covariance was, I could have googled that, instead I was trying to google “delegate return type derived base” which is a far less specific query and yielded zero helpful results.

In fact one of the first results for Delegate Covariance is a blog entry by Francesco Balena from 2005(I’m so behind the times!). He even gives a psychotic workaround wherein he builds delegates via reflection at runtime. I plan on implementing this at my first convenience. :)

It ended up looking like this:Dim stockInfoFormGetterMethod As MethodInfo = formManager.GetType().GetMethod("GetStockInfoForm")
Dim stockInfoFormGetter As FormManager.FormGetter = DirectCast([Delegate].CreateDelegate(GetType(FormManager.FormGetter), formManager, stockInfoFormGetterMethod), FormManager.FormGetter)
formGetters = stockInfoFormGetter

Please note my example code and this production code have little to do with each other.

I would like to mention also that this code is insanely dense. I cannot recommend this as a technique to use commonly, simply because it’s so very gross. It’s brittle as well, since the getter is pulled by Name as a String. I use it once in my code, and once in a unit test. If it starts proliferating beyond those two instances I will reconsider my design post-haste.

Comments off

Implementing and Overriding Read Only Properties

Ok enough crazy posts about divine design beings shining down on me from up on high. That’s what too much caffeine on an empty stomach does to a person!

So I’m beginning to hate VB.NET. Yup. There, I said it.

I was trying to create a read only interface to a Part object.

Public Interface IReadOnlyPart
    ReadOnly Property PartNumber() As String
End Interface

And Have a Part Class Implement that Interface like this:

Public Class Part
    Implements IReadOnlyPart
    Public Property PartNumber As String _
        Implements IReadOnlyPart.PartNumber()
    Etc.

That doesn’t work in VB. You can’t inherit a readonly property from an interface and then make it read/write. Grr! I’m told you can do this in C#, but I haven’t confirmed this. I posted an inquiry to microsoft.public.dotnet.languages.vb and got some great responses. This is the proposed solution by Steve Gerrard which, while perverse, works wonderfully.

Public Class Class1
    Implements IReadOnlyPart

    Private PartNum As String

    Private ReadOnly Property Dummy() As String _
        Implements IReadOnlyPart.PartNumber
        Get
            Dummy = PartNum
        End Get
    End Property

    Public Property PartNumber() As String
        Get
            PartNumber = PartNum ' or Dummy
        End Get
        Set(ByVal Value As String)
            PartNum = Value
        End Set
    End Property

End Class

Sample test code:

Dim o As Class1 = New Class1
Dim p As IReadOnlyPart = o

o.PartNumber = "test 001"
Debug.WriteLine("Class1: " + o.PartNumber)
Debug.WriteLine("IReadOnlyPart: " + p.PartNumber)

I never would have figured that out. Always ask for help when in over your head. I’ve got another post brewing on that same mailing list now about delegates.

Grr @ Delegates! So sexy, but so pointy.

Comments off

On Democracy

So Visual Studio 2008 is out, and by all accounts it is pretty bling-tastic. LINQ is getting a lot of press since it’s release late last year. I just finished reading this article over at SD Times, and I wanted to comment.

Democracy is slow. Technology moves fast. I’m not sure they’re a good mating. I’ve heard it claimed that a negative part of Microsoft’s development platform is that it is constantly changing. Java hasn’t changed very much. They added some stuff in 5 and 6, but nothing like what MS is doing in every incremental revision of .NET. .NET is really impressive these days. It’s not one language that’s impressive, or one technology, or one tool, but the entire platform. There’s a lot of new technology that is put together really well.

I think this is due to the fact that there is someone, somewhere in Microsoft with “vision”. Maybe not just one person, but at least some smallish team leading development efforts. Java has implemented this sort of open democracy JSR proposal process, but I’m not convinced democracy belongs in software development. I feel that someone or a small group with a passionate vision can create new innovative things, while a large democracy oriented team just sort of takes so long that it’s always playing catch up. It’s probably “safer” to have a democracy, but taking risks is an important part of progress.

Maybe I’m wrong. What are your thoughts? Are there software projects where democracy created very innovative things that I’m not considering?

Comments off

Java Coding Conventions

I will now right the same self-righteous diatriabe about Java coding conventions that every other coder on Earth has written.

These are specific to Java, I firmly believe in modifying my coding style to fit a language.

Step 1: Class Naming

I just saw an java class named Active_object. I’m not even kidding. It was like being stabbed in the eyes. Underscores do not belong in Java. It’s that simple.

Secondly, it wasn’t even Active_Object. Proper naming: ActiveObject.

Step 2: Braces

Everyone has their braces style. Stricly speaking I should be using the Java convention, but I hate the java convention. I can never find the opening brace, so I do this:

public void method()
{
System.out.println("Donkey");
}

never do I do this:

public void method() {
System.out.println("Donkey");
}

because to me, it looks so ugly. Ugh. Of course I’m scarred by 2 years of working in the deepest inner bowels of an interpreter written for a functional programming language written in C. *shivers*

Step 3: Variable Naming

Variable names are not places in which to store metadata. Examples: mField, bConnected. Ow.

The “no underscores” argument applies here as well. properlyNamedVariable not improperly_named_variable.

Step 4: Conclusion

“Coding styles are like !#*holes, everybody has one, but nobody wants to touch anybody elses.”

Comments (2)

New Java Plugin!?

*sigh*

So there is this interview over at JavaLobby with Ken Russell discussing the new Java browser plugin. Go ahead… go read it… I’ll wait…

*waits*

Ok, they’re just now writing a new browser plugin for java? I have a friend (a user, not a programmer) who absolutely swears java is horrible because of his experience with it. Everytime I hit a webpage with a java applet, my browser freezes for like 20 seconds, and maybe 1 out of 5 times the entire thing will just crash. Unfortunately experiences such as this are many people’s primary experience with java. They see a java logo on a webpage, and their browser freezes/crashes. Great PR.

I’m excited about a new plugin, but I’m excited about it from a user perspective. I think it is personally too little too late. The idea that java inside a browser is horrible is already firmly entrenched. There would have to be some huge killer app(let) necessary to convince the world otherwise.

Imagine if they had rewritten the browser plugin back when they should have. Imagine a YouTube powered by java instead of flash.

But now? It’s already been done. Java is doing something that’s already been done by everyone else a couple generations ago. Java is behind the curve, yet again.

Leave a Comment

Light Microscopy Automation Library Needs Developers

Developers Needed:

LMAL - Light Microscopy Automation Library

LMAL is an Open Source Java library for the automation of common tasks performed on a standard light microscope including such features as slide scanning, autofocus, spectral image acquisition, Z-stack image acquisition, and time-lapse capture. It aims to provide a standard API for manipulating microscope hardware irrespective of manufacturer and provide a standard framework on top of which light microscopy applications and experiments can be designed and executed.

Leave a Comment