#4: Code never lies, comments sometimes do

Image for post
Image for post
Photo by Austin Distel on Unsplash

Some things you don’t learn from books and schools. These lessons come right from the work floor; I learned them the hard way!

1. Cheap, fast, reliable — Pick two

I love this one because it makes the ones hearing it (your manager) think for themselves:

  • Cheap and fast? Sure, but don’t expect it to be reliable! In fact, this is the recipe for creating technical debt.
  • Reliable and cheap? Maybe, if you’re lucky. But it will take some time to find someone who can do it for cheap, or it will require a lot of iterations to get it right (or both). …

From forcing keyword arguments to anonymous functions

Time lapse of a road by the forest
Time lapse of a road by the forest
Photo by Jake Leonard on Unsplash.

Do you know how to force keyword arguments, create a function decorator, create anonymous functions, or unpack an array or dictionary into a function's arguments? Here are four advanced tricks regarding Python functions.

1. Forced Keyword Arguments

Keyword arguments have a number of advantages:

  • Keyword arguments provide clarity. Without looking up the function itself, you can often guess what the argument is used for by looking at the names.

That’s nice, but you probably already knew these things. What you might not know is that you can also force keyword arguments. The details are described in PEP 3202, but it comes down to using an asterisk before the arguments you want to force as keyword arguments. …

Everything you ever need to know about Python dictionaries

Old books
Old books
Photo by Syd Wachs on Unsplash.

The dictionary is one of Python’s most powerful data types. In other programming languages and computer science in general, dictionaries are also known as associative arrays. They allow you to associate keys to values.

Creating a Dictionary

Let’s look at how we can create and use a dictionary in the Python REPL:

>>> phone_nrs = { 'Jack': '070-02222748', 'Pete': '010-2488634' }
>>> an_empty_dict = { }
>>> phone_nrs['Jack']

The first dictionary associates keys (names like Jack and Pete) with values (their phone numbers). The second dictionary is an empty one.

Now that you’ve seen how to initialize a dictionary, let’s see how we can add and remove entries to an already existing…

Senior developers might learn a thing or two as well

Image for post
Image for post
Photo by Frame Harirak on Unsplash

This advice is useful for both beginning and seasoned software developers. There are some jokes intertwined here, too, so you might want to put down that coffee mug.

1. Java is to Javascript like car is to carpet

Hopefully, you know that Java and Javascript are two entirely different things, despite their names. If you didn’t, don’t sweat it; many beginners get confused by it.

So why are they named so similarly?

This is a quote from an interview with JavaScript creator Brendan Eich:

InfoWorld: As I understand it, JavaScript started out as Mocha, then became LiveScript and then became JavaScript when Netscape and Sun got together. …

Even though I’m a Linux junkie, I’m now also a full-time Windows desktop user

Image for post
Image for post
Windows running Ubuntu Linux, with VSCode connected too it (image by author)

Although I’ve been a big fan of Apple’s Macbook Air and Macbook Pro, I’ve recently made the switch to a Dell XPS laptop with Windows on it.

I initially planned on wiping the Dell hard drive to install Linux on it, but since the beast has a 2 TB SSD disk, I changed my mind and decided to create a dual boot setup and keep Windows.

Read on to see how I came to embrace Windows, after years of Linux and MacOS use!

The new Microsoft?

Now that I had Windows at my disposal again, I started experimenting with it. Although there have been cosmetic changes and improvements, there’s also a lot of stuff from the old days that seems pretty much unchanged. For example, there’s still that dreadful registry. Most shortcuts are unchanged, the look and feel are mostly the same, and the hardware support is still excellent. …

Say goodbye to those hard-to-build software projects by containerizing them

Image for post
Image for post
Photo by Lucas van Oort on Unsplash

More often than not, software projects are difficult to build from source. This can have multiple reasons, here are just a few:

  • The project requires outdated libraries. Once you install those, other projects might break in turn.
  • You’re running Windows or a Mac, but the software is designed to build and run on Linux.

For similar reasons, it can also be hard to run your software in production!

If you’re facing these problems, it’s good to know that there’s an easy fix. It doesn’t require virtualization but instead uses a principle called containerization.

What is a container?

A container is an entity that has everything required to run your software. It…

It’s an unstoppable train coming towards us, and you’d better hop on early

Image for post
Image for post
Photo by Ankush Minda on Unsplash.

Last week, Michael Long wrote an article explaining in detail why Flutter won’t be the “next big thing.” It evoked some passionate reactions from readers, most of them disagreeing with what he wrote. Because I strongly disagree as well, I wrote this article to explain exactly why Flutter will, in fact, be the next big thing!

What Is Flutter?

Flutter is a cross-platform toolkit for developing GUI applications developed by Google. A Flutter app natively compiles to:

  • Windows, Linux, and macOS
  • The web

Many developers have already discovered Flutter and consider it to be a fresh breeze compared to traditional app development frameworks. …

Increase your productivity and development speed today

Image for post
Image for post
Illustration by author

Flutter is “Google’s UI toolkit for building beautiful, natively compiled applications for mobile, web, and desktop from a single codebase.”

Flutter is based on the Dart programming language. It has a large and lively community on Dart.dev, offering both officially supported and third-party packages to make Flutter development even more productive.

This article lists the most promising and most popular packages to give you an idea of Flutter’s maturity as a platform.

If you haven’t done so already, read my introductory article first. It will get you set up and running with a basic Flutter project in no time. …

A quick overview for those already familiar with similar languages, like Java, Kotlin, C++, and C#

Image for post
Image for post
Photo by Silvan Arnet on Unsplash

Dart is primarily known as the programming language for Flutter, Google’s UI toolkit for building natively compiled mobile, web, and desktop apps from a single codebase. It’s optimized for building user-interfaces and developed by Google. It’s used to build mobile, desktop, server, and web applications. Dart can compile to native code and JavaScript.

If you want to follow along with this article, which I highly recommend, you can do so without installing anything on DartPad.dev.

Image for post
Image for post
Dartpad.dev allows you to experiment with Dart from the browser —screenshot by author

Hello World

Let’s start with the obligatory “Hello world”:

void main() {
print('Hello World!');

A few conclusions that can already be drawn:

One way or another, you’ll stumble upon these

Image for post
Image for post
Photo by mari lezhava on Unsplash.

In programming, there are many lessons to be learned from experience. I had to learn the following nine lessons the hard way!

1. The Cheapest, Fastest, and Most Reliable Components Are Those That Aren’t There

This was once said by Gordon Bell. The lesson to draw here is that you should keep a system or piece of software as simple as you possibly can. Reduce complexity to reduce the number of bugs.

2. Voodoo Coding

Sometimes, you manage to fix a bug but don’t understand why. Most programmers have been there, but never, ever leave it at that. Always make sure you understand your code. Find out why this change did the trick.

This mindset will teach you more than books ever could. Don’t be ashamed and ask someone else if you need to. At some point, you’ll notice you’ve become the one people turn to instead. …


Erik van Baaren

Software developer by day, writer at night. Author of python3.guide, where you can start learning Python today

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store