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.
I have been using Emacs the normal way for many years and I am really happy with it. By normal, I mean starting Emacs as a regular process and not using the daemon with emacsclient. This approach has been good enough because usually I start Emacs once when I start working and then just keep it running throughout the day. The startup time is not too bad, maybe around a second or two, when it happens only once per day. With the faster startup speed usually described as the main benefit of the daemon process, I had not seen the need for it in my workflow. But now I changed my system to run not one, but two, daemon processes of Emacs, and I am really glad I made the change.
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.
I have been thinking about the importance of being smart about personal finances as many people are now struggling because of the COVID-19 pandemic. Many are losing their jobs and have not saved money to prepare for something like this. It is a rude wake-up call for many, very much in the same way as the 2008 financial crisis was. The lesson is clear: unexpected events will happen to the economy that we cannot control. We must focus on what we can control, which is our personal finances. In this train of thought, I wanted to write a basic guide for personal finance. Just some best practices and common sense information that I have learned over the years. Something a person can follow and know that they will end up being comfortable with money, even in times of economic turbulence.
A nice personal financial goal to have is to own the same companies that you use, so that you will receive in dividends the same amount that you spend with them. This way you are kind of using their service for free. To do this, just calculate how much money you spend annually for a service, then see how much that company pays in annual dividends, and finally calculate how many shares you need to own to cover your expense. Lets look at some examples to illustrate this idea.
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.
One important aspect in securing a Linux system is closing any open TCP ports which don't need to be publicly accessible. This reduces the attack surface that the system exposes for malicious actors. In case a service needs to be accessed only locally, a good practice is to bind it on the local loopback IP address (127.0.0.1).
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?
I have been using Emacs as my text editor for a few years now. One of the best features about emacs is that you can customize everything. This is because of the underlying lisp interpreter that allows you to define custom functions and then bind them to keys. This is in contrast to a "normal" text editor which allows you to change keybindings, but only to pre-defined built-in functions which perform the text manipulation.
It has been a while since I updated my blog, so it is about time. I have just finished reading Rich Dad, Poor Dad by Robert Kiyosaki, arguably one of the most famous "self-help" books when it comes to money and finances. I particularly liked the blunt and straight-to-the-point writing style of the author. So here is a short review of the book.
This is a brief introduction into stock options and how they can be used by a long-term oriented investor, either to purchase shares at a discount or to generate additional income to supplement dividend payments.
I ordered Grant Cardones new book, Be Obsessed or Be Average, at the same time as The 10X Rule which I reviewed earlier. This book has a very similar tone as the first book, but it considers things from the viewpoint of obsessions. The title is provocative for sure but it is consistent with the style of the author, no doubt intended to shock people a bit.
In a previous blog post describing my investment philosophy I explained that I try to invest in companies of highest quality. But how to measure the quality of a company? There are many ways of course, such as looking at the strength of the balance sheet, competitive advantage or track record of management. There are also various equity research institutions which provide metrics and rankings to measure the quality of different companies.
I must admit, I struggle to read books. It is so easy to get distracted with other things such as YouTube. Dont get me wrong, there is plenty of valuable content in video format, but there is something special about reading which engages the brain in a different way. After hearing over and over that successful people read books I realized it is something I must do, there is just no way around it. Writing a short review of a book that I have read is a good chance to reflect on what I have learned.
There are three main decisions that any business entity must make. These apply whether we are talking about a single enterpreneur or the largest corporations on the planet. Most other business considerations usually fall under one of the three main ones. The purpose of a business entity is to create value for their shareholders and these three decisions determine whether value is created or destroyed. The situation is a little different for non-profit organizations, but not much. Just like for-profit business entities, they face the same optimization problem of how to use their resources as efficiently as possible.
Since money and investing will be one of the main themes of my blog, I think it is natural to start off with a quick introduction into my investing philosophy. If I had to sum up my investing philosophy in once sentence, it would be get rich for sure. I have tried various things over the years, but one consistent lesson has been that the get rich quick methods do not work very well. So here is a brief introduction into my thoughts regarding investing for passive income.