Andreas Bollig

/abollig

Andreas Bollig

I write about freelancing, solopreneurship, web dev and data science.

User Avatar

Andreas Bollig

4y ago

One common reservation people who are thinking about becoming freelancers have is that once they are self-employed they will have to spend lots of time and energy on accounting and taxes. Let me clear this out of the way for you by describing what doing taxes looks like for me as a freelance data scientist.

I spend 10 minutes per month on accounting and taxes

I have outsourced this whole topic to my tax advisor. The result is that there really isn't much to do for me. The only task I have is to upload all invoices (incoming and outgoing) to a Dropbox-like file-sharing service that we use to exchange documents. Everything else is covered by him.

He creates a monthly VAT return and an income tax return every year. The bonus here is that him doing the income tax return is much more pleasant than the situation I had before. Back when I was permanently employed, I did the tax return myself (with the help of some software).

But isn't a tax advisor expensive?

Well, of course, hiring a tax advisor isn't free. But it also doesn't necessarily break the bank. I have to work about two hours per month to pay for this service, which I find to be very reasonable for the trouble it spares me.

Get educated!

This essay describes my personal experience. Obviously, your mileage may vary as tax laws are country-specific (I live in Germany) and the circumstances of your self-employment might look very different from mine. Still, chances are that your fears about accounting and taxes are completely unfounded. I urge you to talk to a local tax advisor and find out instead of letting this topic unnecessarily determine your future career path.

User Avatar

Andreas Bollig

4y ago

The first thing most aspiring Pythonistas learn about managing Python dependencies is to run pip install <package_name> whenever they need a package that isn't present on their system, yet. This works and doesn't overcomplicate things when you're just getting started. However, when you're working on a serious project, there are a couple of things you should make sure to incorporate into your dependency management strategy as I will lay out below.

Use separate environments

When you pip install a package, the default location that package will end up in is the global Python environment on your machine. The more projects you work on, the higher the probability that this lands you in dependency hell.

Let's say you install package X and package Y and both of them depend on package Z. If the versions of package Z that package X accepts don't overlap the versions of package Z that package Y accepts, there is an unsolvable dependency conflict.

To diminish the risk of this happening, you should create a separate environment for each project you work on.

Document the dependencies

More than once, I have been onboarded to projects where only parts of the dependencies were documented or dependencies weren't documented at all. What I need to do in these cases is to run the code, wait for it to raise a "Module Not Found" exception, identify and install the corresponding dependency and repeat this until the code runs without error. As you can imagine, this is very annoying.

To make sure new project contributors can install all required dependencies before running the code, you need to write down all required dependencies in a file. This should be done in a format that can be used by a package manager to install them.

Lock direct and indirect dependencies

Direct dependencies of your project are the ones that you import into your code. Documenting these is a good first step to make sure what works on your machine also runs on your teammates' machines.

However, your direct dependencies have dependencies themselves. When you tell the package manager to install the direct dependencies, you can end up with a different set of indirect dependencies based on when you ran the installation. To make sure you, your teammates, and your production server all run the same exact code, you need to save a list of all direct and indirect dependencies including their exact version in a file and tell your package manager to install what's in the file.

Poetry makes all of this easy

There are many different package managers in the Python world. My favorite one is called Poetry. It makes all of the above points easy to achieve and automates the tedious parts. Give it a try!

You get bonus points if you add a README file to your project that describes how to install its dependencies.

User Avatar

Andreas Bollig

4y ago

Why you should immediately start using an automatic code formatter for your sake and your colleagues', too.

Code formatters like Black (Python) and Prettier (JS, HTML, CSS, ...) are tools that can automatically format your code. They come with many benefits:

  • Your code will look great.

  • You will save time and mental energy.

  • You can stop worrying about the right way to format a piece of code.

  • There will never be a discussion about code formatting with your teammates again.

And that horribly formatted code from your colleagues? Gone for good!

Once you start using one of these, you will notice how much time you used to spend on formatting. Now you can spend that time more productively.

Most code editors can be configured to run formatters every time you hit save. This way, you can forget about code formatting altogether. Go ahead and type a horribly formatted mess and at the click of a button, all you see is perfect order.

The formatters' opinionated style might not completely match your preferences, but the benefits far outweigh this.

Start using an automatic code formatter like Black or Prettier today and make code formatting a non-issue.

User Avatar

Andreas Bollig

4y ago

The most common authentication method for user-facing online services is the traditional username + password login. However, this approach is deeply flawed and puts users and their data at risk. I'll explain why this is the case and why I went with magic link authentication instead for my SaaS.

Lazy Users

If all of your users used strong passwords for your service and had a different password for each service they use, password-based authentication would be fine. But that's not the case. Most people use the same password everywhere. On top of this, many people use weak passwords like 123456. Hoping that the majority of your users will start using password managers is wishful thinking.

Due to the growing number of leaked credentials from hacked services, many of your app's user accounts are completely and utterly exposed. It's only a matter of time until a bad actor tries the right credentials on your login page and wreaks havoc to the detriment of your user.

What about MFA?

Multi-Factor Authentication is great. However, what you want when you add MFA to your app is to have TWO secure factors, not one. It is supposed to be additional security, not the sole security. With password-based authentication, the second factor is only a band-aid covering the insecure first factor.

What is magic link authentication?

Magic link auth works as follows. When logging in, your user enters only their email address (no password). Your server then generates a random token and stores it in the database. Then it sends the user an email with a link to your app containing the token. When the user clicks the link, your server validates the token and logs the user in.

That's it. No password is required and as there are no credentials stored in your database, there is nothing for hackers to steal and leak. The security of this authentication strategy lies in the fact that only your user has access to their email inbox.

But what if my user's email gets hacked?

Well, that's bad. If this happens, the hacker can log into your service, impersonating the hacked user. But your app probably has this problem already. In fact, your "reset password" flow probably looks very much like magic link authentication so this attack vector is present in your app already. Your user has to keep their email account secure no matter if you use password-based or magic link authentication.

User Avatar

Andreas Bollig

4y ago

That problem where you constantly have so many open tabs that you can't properly use your browser anymore? This essay tells you how to fix it once and for all.

50+ open tabs

You know what I'm talking about. One quick Google search and boom - you opened 10 new tabs. A little scrolling through your social media feed and boom - another 10. We can't help ourselves. There are just too many interesting things on the internet.

We keep opening one tab after the other, but we rarely ever close one. Of course. Who has the time to read all of that stuff? After all, we got more important things to do. But we also can't just close the tabs without reading them because then we would lose that invaluable information forever.

And so we keep hoarding tabs until the browser is barely usable. What do we do when that happens? Open another browser window and continue 🤣.

Calm your reptile brain with this one simple trick - no seriously!

The truth is that we will never read all of those open tabs. Not even a fraction of them. But we want to keep the option. So we need a solution that gets rid of the open tabs but keeps the option of later finding them again and reading them (which we won't ever do 😉).

This is exactly what the OneTab browser extension does. It adds a button to your browser that when clicked closes all open tabs and stores their URLs in a list that lives in one tab. You can find it at one-tab.com.

That's it. One button click and you're free: you regained your usable browser and got rid of that feeling of pressure like the one you get from a packed to-do list.

That's it - ridiculously simple, but effective

I currently have 2485 saved tabs in OneTab, none of which I will ever read. But that's fine.

Bonus: You can export all of your saved URLs to a file to keep the hoarder in you happy when you switch to a new laptop.

User Avatar

Andreas Bollig

4y ago

In the last couple of years, Python has been my daily driver. As a data scientist, I have used Python for data analytics but haven't done any web development with it.

Python web development

I recently wanted to start building a web app and went looking for a framework to use. As a Pythonista, I quickly found my natural choice in Django. I went on to build a small test app and quickly realized a major roadblock when trying to integrate React as a frontend framework into my project.

As it turned out, Django delivers a fully-fledged experience when it comes to shipping server-rendered HTML to the browser, but leaves you on your own from there on out. If your goal is to build a dynamic frontend with Javascript, it is your job to figure out how to integrate that into your project.

More research uncovered, that the typical way of using Django together with something like React is to ignore the templating parts of Django and only use it as an API that serves data to a single page app (SPA) frontend.

Javascript full stack frameworks

The recent years have seen the emergence of Javascript-based web frameworks that cover both, the frontend and the backend. After some experimentation in this space, I dropped the Django API + React SPA setup and went with one of the JS full stack frameworks called Remix. Here is why.

#1: Less cognitive overhead

Since both, the frontend and the backend are written in Javascript, I don't have the constant context switch between two different programming languages.

#2: Code sharing

One example of this is form validation logic. Form data needs to be validated on the server to ensure safety. Also validating it on the client facilitates a better user experience. Having the same language in the browser and on the server means this code doesn't have to be written twice.

#3: Half the complexity

Using different technologies for the frontend and the backend, you are actually building two applications, not one. That means that there has to be two of everything: two dependency managers, two linters, two test runners, etc. Managing this complexity takes away time from writing application code that delivers value to your customers.

"But I don't want to learn JS"

Javascript is THE language of the web. It is the only language available in the browser. Sooner or later you will anyway need it to make your web app modern and dynamic. Don't try to fight it - embrace it.

User Avatar

Andreas Bollig

4y ago

You'll learn about the three main strategies for automated hyperparameter tuning and how to choose between them.

One way to improve the performance of a machine learning model is to tune its hyperparameters. Of course, you can do this manually, but as you might have painfully experienced, that can be a very time and resource-consuming exercise. Automate it to get results faster and have the freedom to spend your time on less boring things.

The three main strategies are grid search, random search, and Bayesian optimization. For all three, you define a search space (parameters and their possible values) and let the algorithm find the optimal parameter set by itself. Below I'll briefly describe them and give you their pros and cons, so you know when to choose which.

Grid Search

This approach tries every possible combination of values for your parameters and picks the one with the best performance. For continuous value parameters, it picks values at regular intervals (that's where the word "grid" comes from). With a sufficiently fine-grained grid, this is guaranteed to find the best parameter set. However, as you can imagine, the number of possible parameter value combinations is huge. This means that the grid search will run for a long time and be expensive.

Random Search

As the name suggests, this method tries one random parameter value combination after the other. It will do this for as long as you let it. After you stop it, you can collect the combination with the best performance. This might sound ludicrous, but if you let it run long enough, the chance that it hasn't tried a combination that is close to the optimum is low. It is a good way to find "good enough" parameters quickly, but will very slowly converge to the true optimum.

Bayesian Optimization

The idea here is to iteratively model the relationship between the parameter values and the performance. At each step, the algorithm balances "exploration" (looking at parts of the parameter space that haven't been covered, yet) and "exploitation" (moving towards the direction, where the model expects to find the optimum) to converge to the optimum as quickly as possible. Note, that you need to do a fair number of iterations before it produces any meaningful parameter sets. Also, it can get stuck in local optima.

User Avatar

Andreas Bollig

4y ago

Maybe you have been thinking about going freelance as an IT professional, but don't know how to get started. There are many ways of acquiring projects. In this atomic essay, I'll lay out the ones that have worked well for me in the past.

Recruitment agencies

There is a whole industry of recruiters that make their money by placing freelancers on projects and collecting a premium on their hourly rates. They keep databases of freelancers including their CVs, most important skills and next date of availability and will happily add you to it. Whenever you match on a project they are currently trying to staff, they will call or email you. Examples on the German market are hays.de, gulp.de, and michaelpage.de. Make sure to register with a number of them. This will ensure a steady flow of incoming project requests.

Project platforms

These are market places for freelance projects and freelancers. Recruiters publish projects they are currently staffing here, so you can actively apply for them. You can also create your freelancer profile so recruiters that don't have you in their database can find and contact you easily. Examples on the German market are gulp.de, freelance.de, and freelancermap.de.

Business-oriented social networks

Make sure the word freelance or freelancer is prominently featured on your LinkedIn profile (+ Xing for Germany), so recruiters can easily find you here as well.

Your personal network

If you have been in the industry for a couple of years, your former colleagues will have spread to a number of companies. All of these are potential clients of yours. Hiring freelancers is mostly about trust. Your clients' biggest concern is that their project will be successful. Your former colleagues know and trust your capabilities, which gives you head start against the competition.

User Avatar

Andreas Bollig

4y ago

Many people hold back on exploring self-employment because they fear their income flow might stop at any time.

Being permanently employed at a company seems like a safe way to get a steady paycheck. Freelancing on the other hand seems risky. What if there aren't enough projects in my area of expertise? What if my profile is not attractive enough to acquire project after project? You might think that freelancing will jeopardize your financial stability.

Permanent employment is riskier than freelancing.

Last year there has been a reorganization at one of my former employers. Many people I worked with have been asked to leave. One of them had been with the company for 35 years.

In that situation it sure is helpful to have an attractive profile with skills that are sought-after in the job market. However, working at a single company for that long can lead to the opposite if you don't stay on your toes.

Freelancing keeps you relevant.

As a freelancer, every time you do project acquisition, you get a reality check on whether the market still needs your skills or whether you should start learning other things. This forces you to stay relevant.

If you are afraid that you can't find freelance projects with your profile, you also won't be able to find a new permanent job if you have to leave your current one for some reason. This thought might make you nervous, if you have been working at the same company for a long time.

You should strive to continuously improve your CV so you don't have to worry about losing your income. And freelancing helps you do so.