I though I’d do a little overview and discussion of the Medium stories I wrote this year and last year that turned out most popular:
On YouTube, I watched a Mac user who had bought an iMac last year. It was maxed out with 40 GB of RAM costing him about $4,000. He watched in disbelief how his hyperexpensive iMac was being demolished by his new M1 Mac Mini, which he had paid a measly $700 for.
In real-world test after test, the M1 Macs are not merely inching past top-of-the-line Intel Macs, they are destroying them. In disbelief, people have started asking how on earth this is possible?
If you are one of those people, you have come to the right place. Here I plan to break it down into digestible pieces exactly what it is that Apple has done with the M1. …
The C programming language is even today among the most popular languages in usage despite having been released all the way back in 1972, and having quite a number of limitations and flaws by today’s standards.
This is the key reason why C ought to be replaced. Too much critical software is written in C/C++ which has wide ranging implications. One example is bugs in libraries such as OpenSSL. C is notoriously bad at catching problems such as buffer overruns. C is a language allowing you to shoot yourself in the foot in too may ways.
This may sound strange coming from someone who is an avid fan of dynamic languages. However the issue here is type safety. Dynamic languages such as Python and Julia typically catch wrong usage of types. Such as using an integer in an if-statement. Dynamic languages may not catch problems at compilation time but if they have a strong type system, a lot of problems will be caught at runtime. That matters especially with security. Security vulnerabilities is in large part down to causing undefined behavior, rather than a controlled shutdown. …
In programming languages we frequently talk about whether variables have lexical or dynamic scope.
However for some reason lexical and dynamic scope is one of those things I keep having to look up, because I always forget it. I am sure I am not alone, so this is an attempt at coming up with examples and associations which will help you remember.
We could look up the dictionary definition of Lexical:
of or relating to the words or vocabulary of a language, especially as distinguished from its grammatical and syntactical aspects.
It may give a clue that lexical scoping is about determining scope based on body of text itself. The code as you read it. It you do not have to consider how the code is executed or how the state of your environment changes over time. …
I have had an affinity for playing around with different programming languages for over 20 years. This is an attempt at recollecting some of those experiences — ideas which really stood out in each language or which I have in retrospect seen the significance of.
This list is highly subjective. It is a list of features representing ideas that caught my attention. You will always find people who think some other feature or idea is more prominent or important, but that is fine.
In some areas, Zig almost behaves as a dynamic language despite being statically typed. With statically typed languages, no code runs until after you have compiled that code. However, in Zig, you can mark data as known at compile time. …
I have never particular liked US Senator Rand Paul, but unlike Donald Trump I have always believed him to be a person of normal ability to reason and think. Part of the sane Republican establishement. Yet watching the Republican party under Donald Trump is like watching some Alzheimer patient in rapid mental decline.
I hope I don’t offend anyone suffering from it or having a loved one who does. It is not something anyone can control. The American republican party in contrast as brought this upon themselves. …
Being such an expressive language, it is easy when programming Julia to start thinking:
Isn’t there an even more conscience and elegant way of solving this problem?
A lot of problems can be solved straightforward with approaches you are used to from other languages. However in Julia there is often an even shorter and clearer way to do things.
Partial application of a function or currying is something that was popularized by Haskell. It means by not providing all the arguments you can return a new function taking the rest of the arguments.
This may sound confusing, so let me give some examples. Normally you would do a comparison like…
There is a lot more to the command line than
find. Better graphics support and unicode support have given more possibilities to create beautiful command-line tools.
Shows a tree view of a directory.
$ tree -L 2 foobar
This shows a tree view of the
foobar directory, but only 2 levels deep.
On macOS using Homebrew install with:
$ brew install tree
bat is an alternative to the classic
cat command. Here is an example from executing
bat on a file:
$ bat examples/temperature.py
You can see a major advantage is that it gives syntax highlighting, making it easier to look at various files, especially source code files.
bat also has the ability to e.g. colorize man pages. You can read more about
bat abilities here, but if you use fish shell like me you enable
Back in 2016, most people were still convinced that Apple would never switch from intel chips, due to the superior performance of intel chips compared to ARM chips at the time.
Still I wrote a story detailing the reason why I believed Apple would make a switch in 2019.
The interesting thing about getting into the game of predictions is that it allows you to better appreciate how monumental the M1 released Macs actually are. My thoughts in 2016:
I think we will see a further differentiation between PC and Mac laptops. …
I have written about the Kakoune editor earlier, so I am not going to give much of an intro here. Kakoune is basically a significantly more user-friendly version of Vim. So if you like the concept of Vim, but find it hard to remember all the keys then Kakoune may be a better alternative.
Since last usage I have developed some slightly more effective ways of using the editor.
Instead of using left and right arrow keys for moving left and right, it may be good to get used to using
l because these can be used in many related combinations. …