Code working != Done

You know why people are so keen on MVC frameworks? Because it forces developers to separate UI, data model and business logic. Sure, I have seen people still mixing responsibilities in MVC, but I have never seen such gigantic f**kups as with ASP.NET Web Forms. I am willing to bet that if you assign random developers to Web Forms project, you will start seeing business logic, UI code and data logic all tied up in one event handler. I’ve done it for sure. I don’t have the data to prove it, but I think any developer who had something to do with Web Forms did it at least once. But why is that?

[Read the rest of this entry…]

Quick tip: Do not use CDNs in intranet applications

I am sure there are plenty of reasons to use CDNs while developing public internet application, but when you are developing intranet applications, it is better to stay off CDNs and use local resources. Specially for young developers, who have grown up with them, it is difficult to see why. Here are my four reasons as to why you should not use CDN in intranet applications:

  1. In high speed gigabit ethernet environment, there is a high chance a CDN resource will take longer to load than local resource or entire page for that matter.
  2. Even though the company uses high-speed ethernet, CDN can become slow or unresponsive due to internet provider issues. In that case, the application will most certainly break.
  3. While it is tempting to use latest and greatest resources CDN offers, it can happen that new version of CDN resource breaks your application.
  4. In extreme cases it can happen that CDN resource gets compromised and turned into super evil script. The affect that has on you and your users should be self-evident.

Be on top of your game

There is this application I wrote several years ago that is in use for planning and reporting absences and vacation (also discussed here and most likely in some other article as well). Lately, I noticed the very same application working slower and slower to the point of users complaining. I decided to investigate.

[Read the rest of this entry…]

Changing the culture

The most difficult thing in any company is to change it’s culture. You see, companies are used to operate in certain frames of mind and they do not accept change lightly. Also, people have the tendency of sticking in comfort zone. Working in standard and set ways is nice and comfy. Why on earth would I leave this place for something big and scary? Well, for starters to improve yourself. And improvement is always good. Stagnation, bad. Improvement, good. OK?

[Read the rest of this entry…]

Code review

In my 15 year career, I have yet to encounter a software company in Slovenia, where code review would be a part of work process. It is surprising how many companies just don’t care what kind of code they produce. And this is exactly the reason why most software originating from Slovenia, well, sucks.

[Read the rest of this entry…]

Opening new mail window from C# windows application

There are some things that are unreasonably difficult even in this day of age. Well, not exactly difficult. Let’s say programmer unfriendly. For instance, opening a new mail window in your default mail client from windows .NET application. Preferably with address filled in. Google for it and you will get the same answer I did. Just start a process with “mailto:email@address.xyz” command. Sounds simple enough. Right?

[Read the rest of this entry…]

Simple rules for selling software

If you want to sell software to me, you only have to follow these three simple rules:

  1. Do not lie to me.
  2. Have full featured trial version.
  3. Respect me.

 

Sounds simple right? It is. Except, there will always be that smart sales person that will say something like: “Why don’t we let users download a free trial, but when they want to actually do things with our software, we will make that impossible for them and instead cunningly remind them that they need this and this license to do that. Yeah. That surely beats time limited trial by a huge margin.”

Guess what, you just violated all three rules. Let’s analyze how?

[Read the rest of this entry…]

Unit testing

Unit testing has been around for ages (or at least since 1986, when IEEE standard on unit testing was confirmed). It still surprises me, though, how many people just won’t do unit testing. Reasons they state differ, but most of the times I hear something along the lines of: “Unit testing is too time consuming and when you are in a hurry, you don’t have time to fool around with it.”

Now, I am no unit testing evangelist (and many of my past co-workers can vouch for that), but this is wrong on so many levels, I don’t even know where to start. Let me tell you a little story.

When I first started with Unit testing (way back in 2011), I was of the same opinion as well. Then, a project came where I had to write software for storing information we obtained remotely from a stock broker company. This program had to connect to company’s API and of course, no testing environment could be established. Also, the PC used to connect to the company was constantly occupied. Thus, my only option to actually test, if my software is working was to go four flights of stairs up with my laptop, copy the software to the PC at hand and then run the software and see if it works. Much like in the days of mainframes and punch cards. That was the first time, when I thought: “Hmm… maybe if I can somehow test the logic my program uses and be confident that it works, I will only have to deal with one crisis and that is not knowing how exactly API works.”

Hence, I started to teach myself in ways of unit testing. Now, not being a very skilled unit tester at that point, I did tons of things, one should never ever do. Like, writing data in the database and then delete it later on or sending an e-mail to mail address. Still, when I was done (and way before deadline as well), I was pretty confident that my code will work and now just had to test it on that forsaken PC. It took another hour of fiddling with API implementation at the PC location and ever since then the program runs 24-7. Without a glitch. And ever since then, I consider unit testing as essential part of my projects.

You see, the thing with unit testing is, that the time you spend writing test code would be the time you would otherwise spend on testing and fixing bad code. Not to mention the time you would spend retesting and fixing bad code when new features arrive. With unit tests, you are always sure that as long as test passes, everything works as it did. It may be that you will write more code, but you will write it quicker and better than you would without tests.

Working on a project you hate

I think every developer, specially in-house one, gets once in a while assigned a project he or she hates. OK, so perhaps hate is too strong of a word. Still, if it happens too often, nobody could resent the use of word hate.

Anyway… I stumble on this sort of project once every three to four years. Projects differ as much as a kangaroo differs from a hypo. At previous gig it was working on a cloud based solution. At current gig it is a customer relationship system. It doesn’t really matter. It could be an app for counting wildebeests. The thing that matters is how you get it done. Professionally.

[Read the rest of this entry…]

Starting open source

At my current gig, it is an outright chore to get a telephone number of an employee you want to call. There are actually two ways to go about doing this task. You can open Lotus Notes client, find an news-desk application, open that, locate address book document, open the document, open excel file and then search for a person. You can also install a 3rd party application that works or not (depends on your PC configuration), remember in which department that person is employed and then look through all numbers to find the person. Granted, second way is faster, but for some odd reason, the application does not work on my PC. At all. So every time I want to find a person to call (and that is a lot of time, as I forget phone numbers constantly), it takes about 2 minutes to get it done.

Finally, I had enough of that, and took some time to write a simpleĀ  command line app that finds me all telephone numbers for a Active directory users whose names contain searched string. Got it done in an hour or so. Then, I thought: “Hmm, if I have this problem, then also some other IT guys must have too”. So, I distributed it and instantly got a moan about it being a command line application. So, it took me another 30 minutes of my spare time, to create a WPF based GUI application for Windows. Then, I also thought: “For years now, I have been looking for excuse to start an open source project, but I do not have the time to commit to an existing one. This would be a great opportunity!”

So, here you go. Entire code is posted online at GitHub. Everyone is more than welcome to contribute.