If humans do stuff that computers can do, computers gather at night and laugh at the human

If humans do stuff that computers can do, computers gather at night and laugh at the human Published: Feb 10, 2021 Source: https://khebbie.dk/if-humans-do-stuff-that-computers-can-do-computers-gather-at-night-and-laugh-at-the-human/ Sometimes we have to do really boring work as software developers. For instance today we are working on moving a domain from our internal DNS servers to AWS route53. This domain has been in our hands for 25 years - we have a lot of DNS records. We naturally have to make sure every record exists in the new DNS - otherwise people can’t receive mails or other important stuff. ...

February 10, 2021 · Klaus Hebsgaard

How should I do error handling?

How should I do error handling? Published: Feb 7, 2021 Source: https://khebbie.dk/how-should-i-do-error-handling/ In my last post I told you not to do generic error handling. The natural next question is then “How should I do error handling?”. That question can be hard to answer, and as always in software development the answer is: “It depends”. First of all error handling in every language is different, and you should certainly do what is idiomatic in your specific programming language. ...

February 7, 2021 · Klaus Hebsgaard

Don't do generic error handling

Don’t do generic error handling Published: Feb 6, 2021 Source: https://khebbie.dk/dont-do-generic-error-handling/ So I just had a look at a fairly new restful api, written in kotlin. The developers who made the api decided to be smart about error handling - instead of doing error handling in every api endpoint - why not just do some generic error handling. The error handling exists in ControllerExceptionHandler.kt The code would look something like: @ExceptionHandler(WebClientResponseException::class) fun handleWebClientResponseException(e: WebClientResponseException): ResponseEntity<Any> { logger().error("Error from WebClient - Status {}: {}", e.rawStatusCode, e.statusText, e) return ResponseEntity(mapOf("error" to "Error in external service"), HttpStatus.BAD_GATEWAY) } That really seems like a smart thing to do - right! ...

February 6, 2021 · Klaus Hebsgaard

Are you smart enough to debug your code?

Are you smart enough to debug your code? Published: Dec 26, 2017 Source: https://khebbie.dk/if-you-write-your-code-so/ Everyone knows that debugging is twice as hard as writing a program in the first place. So if you’re as clever as you can be when you write it, how will you ever debug it? Brian Kernighan from The Elements of Programming Style, 2nd edition, chapter 2 “Simple doesn’t mean stupid. Thinking that it does, does.” - Paul Krugman ...

December 26, 2017 · Klaus Hebsgaard

One of the best programming skills you can have is knowing when to walk away for awhile.

One of the best programming skills you can have is knowing when to walk away for awhile. Published: Dec 20, 2017 Source: https://khebbie.dk/one-of-the-best-programming-skills-you-can-have-is-knowing-when-to-walk-away-for-awhile/ “One of the best programming skills you can have is knowing when to walk away for awhile.” - Oscar Godson “Sometimes it’s better to leave something alone, to pause, and that’s very true of programming.” - Joyce Wheeler “Best ergonomics advice is ‘stay hydrated’” Michael Feathers When working in a factory it is pretty easy to see if you are doing work if you are standing by the assembly line and do manual work of some sort - you are probably working. Many people, even software developers, believe that writing code is what we do. But I would state that thinking is what we do. ...

December 20, 2017 · Klaus Hebsgaard

Series on wise software catchphrases

Series on wise software catchphrases Published: Dec 18, 2017 Source: https://khebbie.dk/series-on-wise-software-catchphrases/ So I follow Code Wisdom on twitter: https://twitter.com/CodeWisdom What the account basically does is tweet quotations by famous and not so famous software developers. The quotes are wisdom gathered through many years of working with software development. In my day to day job, I work with quite a few junior developers. As a senior developer, it is my job to teach them the ways of software development; one of the things that I find most important for is to pass on some of the stuff I have learned. ...

December 18, 2017 · Klaus Hebsgaard

We value code that is easy to maintain over code that is easy to write

We value code that is easy to maintain over code that is easy to write Published: Dec 18, 2017 Source: https://khebbie.dk/we-value-code-that-is-easy-to-maintain-over-code-that-is-easy-to-write/ “We value code that is easy to maintain over code that is easy to write” from Growing object-oriented software guided by tests. “Quick becomes quicksand” Uncle Bob. This is the first post in the Series on wise software catchphrases This is probably one of the most overarching catchphrases in this series, I have often mentioned it to a junior developer while working on a task. ...

December 18, 2017 · Klaus Hebsgaard

Serverless Monitoring heat remotely

Serverless Monitoring heat remotely Published: Dec 17, 2017 Source: https://khebbie.dk/monitoring-heat-remotely/ So I attend a small church and I am responsible for the heating system. That should be a simple task, but sometimes people fiddle with the heating system and sometimes the furnace simply stops. And even though I live pretty close to the church I don’t want to go there all the time to check the heat. So I decided to setup remote heat monitoring in our church. ...

December 17, 2017 · Klaus Hebsgaard

Docker vs binary packages

Docker vs binary packages Published: Oct 21, 2017 Source: https://khebbie.dk/docker-vs-binary-packages/ The other day I had a conversation with a Operations Engineer who made a bold statement: “Sending us a docker container is not different from sending us a .deb package” I do not agree with that statement at all but didn’t have the time to counter it, so instead I will write this blog post. So what really is the difference between a deb package and a docker container? Just a sidenote that .deb is just one example of a binary package, rpms and packages for other linux systems, could be another example. And I suppose the Windows term would be a msi package. ...

October 21, 2017 · Klaus Hebsgaard

Exception handling for junior devs

Exception handling for junior devs Published: Sep 5, 2017 Source: https://khebbie.dk/exception-handling-for-junior-devs/ Exception handling is a very important thing for creating production ready code. When you are a brand new developer you might not know how to do exception handling properly. Here I will try to describe a few basic rules that should be followed when coding. Please note that as always there might be reasons for breaking these rules, but they are a sane default. ...

September 5, 2017 · Klaus Hebsgaard