Making Code Faster
The basic idea behind optimising code is to make what it does today by doing “less”. When you do less, it takes shorter time. That doesn’t mean less code however.
- Figure out what takes the most time.
- Start at the top and find ways to make it go faster.
- Change one thing and test.
Things like writing to disk, output (like printing) or committing write queries to databases are slow. When I write code I often first focus on getting it to work, and then I try to make it fast later. One of the first things I always do is to limit how often I commit transactions to the database. With complicated background jobs, you can take it from hours (with large data sets) to minutes if you limit how often you write to the database. By using transactions. The ideal is once.
Everything on GitHub
If you are a software developer, you probably have a lot of code laying around. Because you needed something or wanted to learn something. But having something that you can use and having something other people can use are two different things. Because you have to make sure it is at least kind of easy to install it, run it, configure it etc.
One thing I have focused on doing since the start of 2017 is to put as much as possible on GitHub. I’ve had a rule: either I start making money on it, or it goes up on GitHub. If it is something I coded on my spare time.
There are many reasons for it, but the two most important ones are: if I put it up on GitHub, I make sure that it is easy “enough” to install and get started with it, that means that I don’t have to study the source code to figure out how it works between each time I use it. And it is awesome if someone else finds it either useful or can learn something from it.
Review: Kaweco Perkeo
I got a Kaweco Perkeo from Tudos in the same package as I got the pencil stuff I purchased.
This is the first Kaweco pen I have used. And I really like it. The nib is very firm, with soft.
I’m not sure how I should describe the pen. Because it is basically a competitor to the Pilot Metropolitan or the Lamy Safari. But it is much lighter, and much more fun. It looks more like something a kid would use, than the boring design of the Metro. or Safari. It also comes with a moulded grip section, but it s not like the one of the Safari. It is much less prominent and I did not find it uncomfortable to use in any way.
One thing though. I keep unscrewing the pen instead of uncapping it. I’m not sure why. Probably because I’m so used to pens you have to unscrew when you uncap them.
I think this pen is better than both the Safari and the Metropolitan because the grip section should work for everyone, and it doesn’t have a uncomfortable edge like the Metropolitan does. And I think this will be my new recommendation as the first fountain pen.
The keybase logo is too cute
Seems like Spacemacs is much less of a dumpster fire since the last time I checked it out.
I’d love it if micro.blog sent out some follow recommendation once a week, based on who those I follow follow that I don’t follow
Optimise for the problems you have.
It is important to know what kind of problems you will get in the future. But remember: don’t spend a lot of time optimising for problems that you might get. But rather design your software in a way where it is as easy as possible to deal with those problems as you can see the signs of them becoming a problem.
Seeing how your users use your software is important to understand how you should optimise your database and code. For example, if you have a CMS with tags. There is no point in optimising it for a shit load of tags, if none of your users use more than five per post. Or have more than 50 different ones on their site.
Not to confuse my earlier advice about meditation apps, I still consider Headspace to be the best place to start, but I have enjoyed the built in breathe app on the watch a lot lately.
Edit for iOS is better than I hoped.