Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions content/2009/running-legacy-code/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ tags=["dev"]
This short article deals with a severe problem in software development: bit rot.
When switching to a new platform (for instance from Windows XP to Windows Vista/7), the programmers need to make sure that old bits of code run flawlessly. There are several ways to achieve this goal that will be discussed in the next paragraphs:

## Porting the code
## Porting the Code

This is generally considered a hard path to follow. For non-trivial legacy code-blocks, chances are high that they contain side-effects and hacks to make them work in different environments. Porting code means replacing parts of the program that use functions and methods that don't exist anymore with new ones which make use of the modern libraries  and routines of the new platform. The significant advantages are maintainable software and sometimes faster running programs. But it may be needed to hack the new platform libraries in order to preserve the whole functionality of an old application. When changing an algorithm inside legacy code, the ported version may become unstable. Thus there may be better ways of maintaining obsolete code today.

## Emulators

Emulators work much the same like porting the code. You replace old function calls with new ones to make everything work again. <br />However you don't alter the old codebase itself (because you may not have the source code available) but you create a new compatibility layer that "translates" the communication between the underlying operating system and software (our new platform) and our old software. Emulation can also be very fast and run stable for many years but writing an emulator can be even harder than porting the code because an educational guess may be needed to figure out how the program works internally. Additionally, the emulator itself may become obsolete in the future and might eventually&nbsp; be replaced by a new one.

## Virtual machines
## Virtual Machines

During the last years, a new approach was gaining popularity. The idea is simple: Don't touch anything. Take the whole platform and copy it in order to run old software. The old software runs on top of the old operating system within a virtual machine that runs on the new platform.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
+++
title="Howto Sort a Vector or a List in C++ using STL"
title="How to Sort a Vector or a List in C++ Using STL"
date=2010-01-27
[taxonomies]
tags=["dev"]
Expand Down Expand Up @@ -104,7 +104,7 @@ int main() {
}
```

## Compilation and execution
## Compilation and Execution

Save the above code inside a file, e.g. `list_vector.cpp` and compile it like so:

Expand All @@ -118,7 +118,7 @@ To run it, execute the resulting binary.
./a.out
```

## Program output
## Program Output

```
Vector: 12 5 1
Expand Down
2 changes: 1 addition & 1 deletion content/2011/are-you-a-programmer/index.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
+++
title="Are you a Programmer?"
title="Are You a Programmer?"
date=2011-10-20
[taxonomies]
tags=["culture", "dev"]
Expand Down
6 changes: 3 additions & 3 deletions content/2017/boxes-and-trees/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,13 +122,13 @@ Therefore we would need to add lifetime parameters here. This can make it tediou
}
```

## Putting the tree into a box
## Putting the Tree into a Box

All three options are totally valid. Which one you should choose, depends on your use-case.
A rule of thumb is to keep it simple.
In my case, I chose to use a `Box`, because I did not need any special guarantees.

## Making subtrees optional
## Making Subtrees Optional

The next problem I faced was that I could not instantiate a tree structure.
The left and right subtree have the type `Box<Tree>`, but at some
Expand Down Expand Up @@ -241,7 +241,7 @@ root(15)
);
```

## Why did it just work in Python?
## Why Did It Just Work in Python?

Now you might be wondering why our tree implementation worked so flawlessly in Python.
The reason is that Python *dynamically* allocates memory for the tree object at *runtime*.
Expand Down
4 changes: 2 additions & 2 deletions content/2017/digitial-clocks/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ As a result I didn't set the correct time, instead, I set a cooking timer... and

{{ <figure page={page} src="kitchen.svg" /> }}

## Let's add a clock to the microwave!
## Let's Add a Clock to the Microwave!

On occasions like these, I wonder why there's a digital clock on every single household device these days.
They're integrated into microwaves, fridges, ovens, dishwashers, dryers, mixers &mdash; and that's just the kitchen!
Expand Down Expand Up @@ -44,7 +44,7 @@ That's why I constantly need to look after those clocks.
Let me tell you a secret:
When I'm not warming stuff in the oven, I don't want it to tell me the local time. I want the stove to be _off_.

## Why I have trouble setting the clock on our oven
## Why I Have Trouble Setting the Clock on Our Oven

Our oven has three buttons related to time: plus, minus and a clock symbol.
To set the time, you push the clock symbol. An arrow appears and the display changes to 00:00. You press time again and another arrow appears.
Expand Down
4 changes: 2 additions & 2 deletions content/2017/future-of-rust/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ It is not unthinkable that Rust is going to be some healthy competition for C++
The benchmarks of [leaf](https://github.com/autumnai/leaf), a machine learning library written in Rust, are already nothing short of
impressive.

## Blockbuster games
## Blockbuster Games

[Games](https://www.reddit.com/r/rust_gamedev/comments/4qlftu/look_our_game_writen_entirely_in_rust/d4tz4r3/) are another area where Rust might shine.
It's financially attractive for Game Studios to support multiple platforms without much
Expand All @@ -57,7 +57,7 @@ That said, the first AAA Rust game might still be far in the future. [Here's Bli
Maybe &mdash; eventually &mdash; we will also see formal verification of the Rust core. Projects like [RustBelt](https://plv.mpi-sws.org/rustbelt/) would then open new opportunities in safety-focused industries like the Space industry. Wouldn't it be nice to safely land a Spacecraft on Mars that is controlled by Rust? (Or by one of its spiritual successors.)
I wonder if [SpaceX](https://www.spacex.com/) is experimenting with Rust already...

## Integrating with other languages
## Integrating with Other Languages

There are many other areas I haven't even mentioned yet. For example, financial and medical software or Scientific Computing, just to name a few.
In all cases, Rust might be a good fit. Right now the biggest barrier to entry
Expand Down
12 changes: 6 additions & 6 deletions content/2017/go-vs-rust/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Shuttle 🚀
Both languages seem to be competing for the same user base and they both seem to be
_systems programming_ languages, so there must be a clear winner, right?

## Go: practical, pragmatic, plain
## Go: Practical, Pragmatic, Plain

{{ <figure page={page} src="go.jpg" caption="The Golang learning curve over time, a straight line." /> }}

Expand All @@ -47,7 +47,7 @@ But with Go, you _get things done_ &mdash; fast.
Go is one of the most productive languages I've ever worked with.
The mantra is: solve real problems today.

## Rust's strong guarantees come at a cost
## Rust's Strong Guarantees Come at a Cost

{{ <figure page={page} src="rust.jpg" caption="The Rust learning curve over time, a bumpy ride." /> }}

Expand All @@ -70,7 +70,7 @@ That's because these guarantees come with a cost: ramp-up time.
You'll need to unlearn bad habits and learn new concepts.
Chances are, you will [fight with the borrow checker](https://m-decoster.github.io/2017/01/16/fighting-borrowchk/) a lot when you start out.

## Case-study: Primality by trial division
## Case-Study: Primality by Trial Division

Let's say, you want to check if a number is [prime](https://en.wikipedia.org/wiki/Prime_number).
The easiest way is to check if we can divide the number by any smaller natural number (without a remainder). If not, we found a prime number! This approach is called [trial division](https://en.wikipedia.org/wiki/Trial_division).
Expand Down Expand Up @@ -136,14 +136,14 @@ It might seem a little alien at first, but it will become second-nature after a

This was just a quick example, of course. I suggest, you browse some code on [Rosetta Code](https://rosettacode.org/wiki/Rosetta_Code) to get a better feeling for both languages.

## Case study: Finding duplicate words in text files
## Case Study: Finding Duplicate Words in Text Files

If you're more like a visual type, here is a video where I write a simple
concurrent program in Go and Rust to compare both languages:

{{ <video url="https://www.youtube.com/embed/B5xYBrxVSiE" preview="maxresdefault.jpg" /> }}

## Some things I prefer in Go
## Some Things I Prefer in Go

- Fast compile times
- Pragmatic problem-solving approach
Expand All @@ -153,7 +153,7 @@ concurrent program in Go and Rust to compare both languages:
- Simple error handling
- The mascot 😉

## Some things I prefer in Rust
## Some Things I Prefer in Rust

- Safety: No null pointers, no data races,...
- Fine-grained system control
Expand Down
14 changes: 7 additions & 7 deletions content/2017/hacktoberfest/index.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
+++
title="Learn Some Rust During Hacktoberfest"
title="Learn Some Rust during Hacktoberfest"
date=2017-10-15
[taxonomies]
tags=["culture", "dev", "oss", "rust"]
Expand All @@ -21,7 +21,7 @@ This guide is trying to change that!
Let me show you, how _everybody_ can contribute code to [Rust](https://www.rust-lang.org/), a safe systems programming language.
I was inspired to write this by a [tweet from llogiq](https://twitter.com/llogiq/status/915288482314178560).

## 1. Find a great Rust project to work on
## 1. Find a Great Rust Project to Work On

We all want our work to be appreciated.
Therefore I suggest to start contributing to medium-sized projects, because they gained some momentum but are still driven by a small number of maintainers, so help is always welcome. By contrast, tiny projects are mostly useful to the original author only, while large projects can be intimidating at first and have stricter guidelines.
Expand All @@ -35,7 +35,7 @@ language:Rust stars:5..100 pushed:>2017-01-01

[Here](https://github.com/search?q=language%3ARust+stars%3A5..100+pushed%3A%3E2017-01-01)'s a list of projects, which match this filter.

## 2. Install the Rust toolchain
## 2. Install the Rust Toolchain

To start contributing, we need a working Rust compiler and the cargo package manager.
Fortunately, the installation should be straightforward.
Expand All @@ -56,7 +56,7 @@ rustup install nightly

Questions so far? Find more detailed installation instructions [here](https://asquera.de/blog/2017-03-03/setting-up-a-rust-devenv/).

## 3. Fork the project and clone it to your computer
## 3. Fork the Project and Clone It to Your Computer

First, click on the little _fork_ button on the top right of the Github project page. Then clone your fork to your computer.

Expand All @@ -66,7 +66,7 @@ git clone git@github.com:yourusername/project.git

For more detailed instructions, go [here](https://guides.github.com/activities/forking/).

## 4. Does it build?
## 4. Does It Build?

Before we start modifying the codebase, we should make sure that it is in a workable state.
The following commands should work right away from inside the project folder.
Expand All @@ -78,7 +78,7 @@ cargo test

If not, you might want to consult the `README` for further instructions. (But feel free to choose another project.)

## 5. The magic sauce
## 5. The Magic Sauce

Here's the trick: we use a [linter](<https://en.wikipedia.org/wiki/Lint_(software)>) called [clippy](https://github.com/rust-lang/rust-clippy) to show us improvement areas in any Rust codebase.

Expand Down Expand Up @@ -138,7 +138,7 @@ Please add a meaningful description and then submit the pull request.

Congratulations! You've contributed to the Rust ecosystem. Thank you! 🎉

## Trophy case
## Trophy Case

- [m4b/goblin](https://github.com/m4b/goblin/pull/55)
- [fitzgen/cpp_demangle](https://github.com/gimli-rs/cpp_demangle/pull/100)
Expand Down
2 changes: 1 addition & 1 deletion content/2017/image-previews/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ I could fix that, by hardcoding the image width and height, but that would be te
And there would be no preview.
So I was wondering, what others were doing. 🤔

## Tiny image thumbnails
## Tiny Image Thumbnails

I vaguely remembered, that [Facebook uses tiny preview thumbnails in their mobile app](https://code.fb.com/uncategorized/the-technology-behind-preview-photos/).
They extract the quantization table from the JPEG header to render the preview. This information
Expand Down
12 changes: 6 additions & 6 deletions content/2017/makefiles/index.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
+++
title="Afraid of Makefiles? Don't be!"
title="Afraid of Makefiles? Don't Be!"
date=2017-08-15
updated=2022-03-01
[taxonomies]
Expand Down Expand Up @@ -38,7 +38,7 @@ Along the way, they keep making the same basic mistakes:

These are issues Makefiles were invented to solve.

## Makefiles are scary!
## Makefiles Are Scary!

If you think that `make` is scary, you probably think of complicated build machinery for [big](https://community.kde.org/Guidelines_and_HOWTOs/Build_from_source) [software](https://chromium.googlesource.com/chromium/src/+/master/docs/linux/build_instructions.md) projects.
It doesn't need to be that way. Let's hear from the author of `make`, [Stuart Feldman](https://en.wikipedia.org/wiki/Stuart_Feldman) himself:
Expand All @@ -47,9 +47,9 @@ It doesn't need to be that way. Let's hear from the author of `make`, [Stuart Fe
>
> &mdash; [The Art of Unix Programming (2003)](https://nakamotoinstitute.org/static/docs/taoup.pdf)

Make was built in _one weekend_ to solve a reoccuring problem in a simple way.
Make was built in _one weekend_ to solve a reoccurring problem in a simple way.

## Makefiles are simple!
## Makefiles Are Simple!

Before I leave the house, I need to get dressed.
I use the same simple routine every time:
Expand Down Expand Up @@ -100,7 +100,7 @@ Putting on jacket.
All done. Let's go outside!
```

## What just happened?
## What Just Happened?

Noticed how the steps are in the correct order?
By plainly writing down the dependencies between the steps, `make` helps us to execute them correctly.
Expand Down Expand Up @@ -130,7 +130,7 @@ target: [dependencies]

Congratulations! You've learned 90% of what you need to know about `make`.

## Next steps
## Next Steps

Real `Makefiles` can do much more! They will [only build the files that have changed](https://stackoverflow.com/a/3798609/270334) instead of doing a full rebuild.
And they will do [as much as possible in parallel](https://stackoverflow.com/a/3841803/270334).
Expand Down
10 changes: 5 additions & 5 deletions content/2017/obsolete/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ There was one problem though: The list of pull requests got longer and longer, a

{{ <figure page={page} src="pull_requests.jpg" caption="The list of Github Pull requests for awesome-static-analysis" /> }}

## Adding contributors
## Adding Contributors

I always try to make team members out of regular contributors. My friend and colleague [Andy Grunwald](https://github.com/andygrunwald) as well as [Ouroboros Chrysopoeia](https://github.com/impredicative) are both valuable collaborators. They help me weed out new PRs whenever they find the time.

Expand All @@ -57,7 +57,7 @@ What needs to be checked for each new tool can be summarized like this:

I guess it's obvious what we should do with that checklist: automate it!

## A linter for linting linters
## A Linter for Linting Linters

So why not write an analysis tool, which checks our list of analysis tools!
What sounds pretty meta, is actually pretty straightforward.
Expand Down Expand Up @@ -108,7 +108,7 @@ This allowed me to focus on the actual analysis code,
which makes for a pretty boring read. It mechanically checks for the things mentioned above and could be written in any language.
If you want to have a look (or even contribute!), [check out the repo](https://github.com/mre/awesome-static-analysis-ci).

## Talking to Github
## Talking to GitHub

After the analysis code was done, I had a bot, running locally, waiting for incoming pull requests.

Expand Down Expand Up @@ -247,7 +247,7 @@ Now, whenever a new pull request is coming in, you see that little bot getting a

![A successful pull request, which was checked by the bot](/2017/obsolete/pull_request_success.jpg)

## Outcome and future plans
## Outcome and Future Plans

I am very pleased with my choice of tools: afterparty saved me from a lot of manual work, while zeit made deployment really easy.
It feels like [Amazon Lambda](https://aws.amazon.com/lambda/features/) on steroids.
Expand All @@ -266,7 +266,7 @@ If you like, you can compare the [old](https://github.com/mre/awesome-static-ana

Most everything about that project has changed since then.
I now use Github Actions to run the CI checks, and the `README.md` is completely auto-generated from the YAML files for each tool.
We support specia metadata fields like a list of additional resources (tutorials, videos, etc) or the list of paid plans a tool offers.
We support special metadata fields like a list of additional resources (tutorials, videos, etc) or the list of paid plans a tool offers.
We have a [fancy website](https://analysis-tools.dev/) now, where we list all 700+ tools and allow people to vote.
The website is built with Next.js and uses Algolia for search.
We also have a bunch of sponsors now, who help us pay for hosting and other expenses.
Expand Down
14 changes: 7 additions & 7 deletions content/2017/professional-programming/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ This article aims to save you from a few years of uncertainty.

Before you dig into this, be sure to read the first part of this series titled ["Why I love Programming"](@/2017/why-i-love-programming/index.md).

## What's the difference between "professional" and "hobby" programming?
## What's the Difference between "professional" and "hobby" Programming?

In one word: _accountability_.
You are expected to be responsible.
Expand All @@ -44,7 +44,7 @@ Eventually, you'll understand that those neckbeards were not slower than you, bu
more careful. You learn how to test your code, how to document it. You even begin to
appreciate UML diagrams.

## Becoming obsolete
## Becoming Obsolete

"The world is moving too fast. What you learned today is obsolete tomorrow. Why bother?".
I've heard that saying countless times throughout my career.
Expand All @@ -63,7 +63,7 @@ One advice I can give you is not to take it too seriously.
Drop the project, keep the wisdom.
Embrace change.

## Writing software in a non-perfect world
## Writing Software in a Non-Perfect World

A professional programmer has to deal with deficiencies all the time. The game is called "balancing constraints". Deadlines, budgets, and code quality are just a few competing constraints we have to consider.
Elegant designs fade away in the face of reality.
Expand All @@ -77,12 +77,12 @@ For me, I was always leaning more towards elegance.
That's just a nicer way to say I was a perfectionist.
I needed to learn the pragmatic part through hard work.

## Mentoring less experienced Programmers
## Mentoring Less Experienced Programmers

> The better you become at programming, the less you code.

Instead, you will spend more time thinking about Software Architecture,
high-level designs and splitting up the work into smaller junks for other developers to consume.
high-level designs and splitting up the work into smaller chunks for other developers to consume.
You will start mentoring Junior Developers. Recruiting will require a lot of your
attention. You will spend your time in Meetings, discussing project goals with
business people.
Expand All @@ -107,7 +107,7 @@ Talk to others, listen to their problems. Read books about Software Project
Management, even though you don't want to be a manager yourself. It will help
you understand the role of your boss.

## A word about money
## A Word about Money

There are many good reasons to work in IT, but money is not one of them.

Expand All @@ -124,7 +124,7 @@ attempts.
Another way is to stop being a programmer and become a manager instead.
I've already shared my opinion on that in the last section.

## Final words
## Final Words

While you should learn to read (and maybe write) code, working as a professional programmer is not for everyone.
You might ask: "Is it worth it?".
Expand Down
Loading
Loading