In this post I am going to talk about the Suckless software tools and how I have integrated them into my workflow and daily use. Suckless tools are interesting because they are a little different from the mainstream in terms of how their software is built, configured, packaged and delivered. Their websites summarizes their mission statement as quality software with a focus on simplicity, clarity, and frugality. Lets dig a little deeper into what makes Suckless software unique.
This is a summary post of different programming languages as well as my personal experiences and opinions about them. I have written code in many languages over the years. Some languages I have tried only briefly while others I have used daily for many years. Additionally there are many interesting languages that I still look forward to learning. I have written before about what makes a good programming language which is closely related to this post. This post is very long, so if you just want to know which programming language you should be learning, skip to the very end where I give some recommendations for different career paths.
I have decided to move my public Git repositories to GitHub from Bitbucket. There is no denying it: GitHub is the place to be if you want to have a public profile as a software engineer. I have had my code hosted on Bitbucket for years and have been kind of waiting that it would be developed more to be a serious competitor for GitHub. But while Atlassian is a great company in my opinion, their focus seems to be on serving enterprise customers, rather than helping individual developers to have a public profile for their code that looks attractive. GitHub just looks good. Bitbucket kind of gets the job done in terms of storing your code, but the appearance does not give you confidence in sharing the links to your repositories with others.
Most people tend to associate PHP with web programming. They might be unaware that PHP is actually great language for shell scripts and command-line use as well. The syntax is relatively expressive so you can do a lot in just a few lines of code. And like Bash, you can just write a script and run it. This is ideal for quickly writing small scripts and leads to faster development than compiled or strictly-typed languages like Go and C#. PHP is also faster than Python which is apparently commonly used for shell scripting.
Since the beginning of internet, when first bytes began to flow between networked computers, script kiddies have been asking the age-old question on message boards, forums and mailing lists: "What is the best programming language?" Much to their disappointment, even after vigorous debate lasting many decades, this question still does not seem to have a definite answer. Of course, those with a little more experience have figured out that there is no such thing as one language that is best for all situations. So why do people ask it? It takes a lot of time and effort to become proficient with even one language. So they don't want to hear that they need to learn three or four languages, especially when they are just starting their career and it can feel overwhelming.
A while ago I decided the learn the basics of the Assembly language for my x64 processor. Assembly has a reputation for being difficult and elitist which is keeping many people from trying it out. But once you learn the basics, it is actually really simple. In fact, in many ways it is much simpler than other programming languages. Using Linux as our host system, we can make system calls to the kernel for many operations like reading and writing standard input/output and files. Also the x86 instruction set allows us to perform string operations and "loops" directly with a single instruction, condensing many common operations into just a few lines of code.
I have not been updating my website and blog in a while. Part of the reason is that I was not fully satisfied with the software powering the site. The site was running on Grav CMS, and don't get me wrong, it is a great piece of software for hosting a website. With Grav all the content of the website is stored in Markdown files and having a database is not required. I much prefer Markdown files since they are a joy to edit and can be stored in a Git repository to keep version history. It suited my preferences much more than something like Wordpress and it was more lightweight also.
There comes a time in the life of a serious software engineer when he wants to implement a custom programming language. Not with the goal of creating a language that gains widespread adoption (there are enough programming languages already), but as an exercise to gain deeper insight into how programming languages work.
In the previous post we examined the potential performance issues with nested for-loops and how they can be improved using array lookups instead. Another common pitfall in terms of performance can be sorting when done incorrectly which we will examine here.
One of the most common issues that I see almost daily when reviewing code is nested loops where they aren't required. They are particularly tricky because they are not slow with small data sets (which developers often use for testing), but become slow in production environment where data sets are larger. Of course, testing with too small data sets is a separate problem which should be fixed as well.
On this post I would like to introduce some generic utility functions for PHP. I often keep these in the global namespace because they are so useful. You may wish to wrap them in a namespace, or even a class, depending on your use case. They follow similar naming convention as the built-in functions of PHP because I view them almost like extensions to the standard library.
Have you ever encountered a situation where the performance of your PHP script is not great, but you are not sure where the problem is? Then you try to guess and change some part blindly just to see if that would help?