The curious case of the switch statement

The curious case of the switch statement” is a nice historical perspective on the switch statement in most modern programming languages, where it come from, and how it transformed over the years.  It starts of with ALGOL 58 (yes, a programming language from 1958), and traces the history down to the modern reincarnation of the statement to BCPL (1967!), where it looked like this:

switchon EXPR into {
    ...
    ...
    case CONST:
    ...
    ...
    default:
    ...
    ...
}

Apart from the historical perspective, there is an interesting discussion about how different languages approached the statement, how it varies, and what are some of the benefits of each implementation.

O’Reilly Free Programming Ebooks

books

O’Reilly is giving away some programming ebooks for free.  Not the greatest of selections, but might still come handy, as subjects vary from Java and Python to micro-services and software architecture.  The books are available in ePub, Mobi, and PDF, but you’ll need to register / login to download them.

PHP: array_merge_recursive() vs. array_replace_recursive()

Here is a nice blog post describing the important differences between array_merge_recursive() and array_replace_recursive() functions in PHP.  These are often overlooked when testing new developments with simpler data structures.  Troubleshooting for it later is not too obvious.

Rundeck – Job Scheduler and Runbook Automation

Rundeck-EditJob

Rundeck is yet another one of those services that I want to get my hands on but haven’t yet got the time to.  The simplest way to describe it is: cron on steroids.

Rundeck allows one to define the commands and then allow for execution on those commands manually, periodically or based on a certain trigger.  Imagine, for example, a deployment command that needs to run across some servers to which you are not comfortable giving access to developers, or even non-technical users.  You can create a command in Rundeck and give access to certain users to execute it, via clicking a button or two in a user friendly web interface.

A side benefit to using Rundeck versus cron are the metrics.  Rundeck collects metrics like successful and failed executions, execution times, etc.  So it makes it easier for you to see that certain jobs are getting progressively slower or fail on specific weekdays, etc.

The best part is that Rundeck is Open Source and self-hosted, so you don’t need to give sensitive access to some external web service.

Vim 8.0 Released!

The team behind the greatest text editor of all times has release the new major version – Vim 8.0.  It’s the first major release in 10 years!  Brief overview of the changes:

  • Asynchronous I/O support, channels, JSON
  • Jobs
  • Timers
  • Partials, Lambdas and Closures
  • Packages
  • New style testing
  • Viminfo merged by timestamp
  • GTK+ 3 support
  • MS-Windows DirectX support

For a more complete list and details, have a look here.

The TL;DR summary: Vim provides a lot more power now to plugin developers, so we’ll be seeing a boost in both new functionality and old ways getting better.

Here is a mandatory Slashdot discussion with your usual Vim vs. Emacs flame.

P.S.: Emacs has recently released a major update too …