developers[]: Primož Gabrijelčič

Twitter: @thedelphigeek

WebSite: www.thedelphigeek.com

Primož Gabrijelčič started programming in 1983 on an HP 41 CX programmable calculator. Soon he moved to more capable machines – Sinclair ZX Spectrum, PDP 11, and VAX/VMS mainframes – and finally settled on an IBM PC AT with a HUGE 10 MB disk drive. Somewhere during those early years he felt in love with Pascal and developed a distaste for all languages C-ish. He has stayed true to the PC/Gates combo (except when he experimented with OS/2 Warp) to this day. These days he works as a developer in the broadcasting industry. During the night he writes books, blogs, and develops open-source software. He’s also delighted when people invite him to present at Delphi conferences all over the world (hint, hint, nudge, nudge).

What is your favorite programming language and why?

There are many languages I have fallen in love with. I love Forth; its simplicity and power which allows you to write code that runs at almost assembler speed but is still readable. I enjoyed learning Smalltalk; that was the first time I learned about the concept of messages. I am fascinated about Erlang; how it created the concept of failsafe microtransactions a decade before microtransactions were a thing.

Having said all that, my language of choice was always Pascal. A long time ago I decided that using a language that takes care of your stupid mistakes (range check errors!) is A Good Thing. I must say that I’m thrilled with the choice the young me made. Delphi helps me write readable code which I have no problems understanding and fixing when bugs are reported. And as the job of a programmer is 20% writing new code and 80% fixing old, that is definitely a boon.

What one piece of advice would you give to a rookie developer?

“Never stop learning.” Always experiment, always try different approaches. Nine times out of ten you’ll fail, but that precious one time you’ll make yourself better. After you get some programming ‘mileage’ you’ll learn that one out of ten is actually pretty great ratio 🙂

What is the most difficult programming challenge you’ve ever encountered?

In my job I’m mostly solving difficult problems. (We have decided a long time ago that anyone can solve simple problems but we’ll specialize on hard ones.) Still, two episodes come to mind. Case A was creating a complex real-time multithreaded application which is processing and synchronizing an internal TV broadcasting feed that can go up to 270 Mb/s. At that time I used quite some large paper sheets to design the internal workings of that app. I have also developed a habit of taking a notebook and pen to bed to record ideas and solutions that appeared in my mind during the night. Case B was solving the ABA problem when designing my own O(1), multiple writer, multiple reader, lock-free, growable queue (TOmniQueue in OmniThreadLibrary). That was probably the hardest problem I have ever solved and solution came to me during a concert I was attending.

What is your favorite open source project and why?

Chocolatey Package Manager. Because I can say choco upgrade all and all my chocolatey-installed software gets upgraded. Poof! Magic!

What would you say to the developer that was you five years ago?

“Let the code breath, man!” At that time all my code was very condensed. You could never find an empty line inside a method. These days I’m more relaxed, and I let the code breathe. I treat my methods more like short poems and I frequently split them into multiple `stanzas`, separated with empty lines.

What one book should every software developer read?

I have a ton of suggestions, but I don’t believe there is a book that would fit everyone, everywhere. Just read, people! If I had to pick one, I would recommend A Programmer’s Introduction to Mathematics by Dr. Jeremy Kun. Most programmers don’t know enough about mathematics and this book is quite a gentle introduction to the topic.

What is the worst advice that you commonly hear given to developers?

I must say that I don’t commonly hear bad advice. Either I have a carefully selected the circle of people I listen to or I’m just lucky.

Let me just give a guideline which will help developers recognize bad advice. If it tells you that you must “100% always do XXX in exactly that way”, you should ignore it. A typical example are websites that explain how to do design patterns by telling you how to name classes that take part in the pattern. You should always strive towards understanding the idea behind the advice, not to interpret the advice literally.

Describe your favorite or most memorable “aha!” moment that you’ve had as a developer.

My most memorable “aha!” will happen when I will finally understand reactive programming. Until then, the most memorable is the moment when I solved the ABA problem in my lock-free queue.

What is one weird or unusual thing you always do when you code?

I press Ctrl+S constantly, at least once every line. I have developed this habit in the eighties while programming in Turbo Pascal 3.0 on a CP/M machine. This combination had an unpleasant feature of occasionally hanging. When it hung, you lost all unsaved work, so I started pressing Ctrl+S all the time. Software and hardware are much more stable these days, but my habit is still here.

What have you done as a developer of which you are most proud?

Wrote OmniThreadLibrary, which is a quite popular multithreaded library amongst Delphi programmers.

Bonus Question: What is the question and the answer to the one thing that I should have asked you?

Q: What do you do when you are not programming?
A: I read constantly. Other than that, I enjoy working with wood. I made lots of cabinets and shelves in our house and some stuff – including a coffee table – for friends. I’m also a photographer and a runner.