So I'm trying to turn things around. Well, maybe not turn things around as much as shifting them around a little bit. I've noticed that my little hobby projects of programming don't really have the same appeal anymore, and simultaneously that my interest in Clean Coding and, quite possibly, do more lecturing and blogging about the … Continue reading On habits
Category: Almost bloggishy stuff
Should millennium bug fixes be cleared out?
At a talk earlier in the week I was asked if the millennium bug fixes should be cleared out. The question was asked while talking about clearing out dead and commented out code. My response off the top of my head was yes, but I've since reconsidered. The answer, of course, is not that simple. … Continue reading Should millennium bug fixes be cleared out?
The world gets a little bit worse for every new AutoInc column
After participating in a Facebook discussion on the topic of how to generate autoinc values for a primary key column, I feel strongly obligated to write this blog post about my point on the matter. My underlying theses is that no modern database should ever be designed to use autoinc values as its tables' primary … Continue reading The world gets a little bit worse for every new AutoInc column
Clean Coding talk
Yesterday I had a talk on Clean Coding for colleagues at the bank. It's been a while since I've held any kind of talk to anyone, so I was a little bit nervous. That nervousness quickly turned to adrenalin and, I hope, positive energy for the crowd. 40 or so developers and stakeholders. I only … Continue reading Clean Coding talk
A thing about typecasting
I had a problem with typecasting the other day and had the workings of typecasting explained to me on Facebook. Consider this code: var MyFrame : TAbstractFrame; begin MyFrame := GetSomeFrame() as TAbstractFrame; MyFrame := TAbstractFame( GetSomeFrame() ); end; GetSomeFrame returns a frame of TFrame. So I typecast that result into TAbstractFrame (for whatever reason). … Continue reading A thing about typecasting
How to get SSL working with Indy components
I like using the Indy components when working with all sorts of internet things, but unfortunately documentation is scarce at best. So I spend hours on hours trying to find some hint as how to do things. Just lately I needed to get SSL working with my REST server for a specific service I offer. … Continue reading How to get SSL working with Indy components
Recycling is for garbage. Don’t recycle code!
I'm currently working on a bit of legacy code. Good code, to be sure, with a rather low technical debt due to the care and hard work by previous programmers. But of course, there are things that stick out. An hour or so ago, I started to refactor an old method that was populating various … Continue reading Recycling is for garbage. Don’t recycle code!
Frame inheritance
Using frame inheritance, possibly in combination with the frame factory pattern (although that is out of scope for this post) can considerably help you limit dependencies, reduce the number of forms and separate concerns of your application. What's the difference between forms and frames? Many Delphi programmers use nested forms to structure their applications, and … Continue reading Frame inheritance
The Factory
Quite a few years ago I landed a Delphi assignment to, among other things, develop a media injector application for a Swedish television broadcaster. It would be part of a much larger system, and its responsibility was to move different clips of mp4 files from one place to another according to a time schedule that … Continue reading The Factory
A comment on comments
Which code is more readable? implementation uses // Delphi units SysUtils, Windows, Classes, // Libraries Lib.Utils, Lib.Settings, Lib.JSON, MainFormU, // Main form unit Settings; // Settings unit procedure TForm.OnButton1Click( ASender: TObject ); var Humpty: THumptyDumpty; begin // Set up a humpty dumpty class and execute it, passing it the personal id, name and what looking … Continue reading A comment on comments