View on GitHub

Simple man devblog

  • Support multiple dotnet target frameworks but build using only one of them and not all

    Scenario: two developers working on the same project. One is using a machine with .NET 5 installed and the second one uses the latest .NET 7.

    The code base is the same for both runtimes. The final application is devliered to the users as a self-contained, framework-independend exe.

    The developers want to just use the dotnet build command and not care about each other frameworks.

    How to tell dotnet to build the project using the framework that is currently installed on the machine?

    The solution is both, surprisingly easy and surprisingly hard to figure it out

    Read more...
  • Panic! within a panic! can make you panic!

    Overall, you probably want to avoid “panic!” as much as possible. However, there are many scenarios where “panic!” is exactly what you want. Be careful though, because if by accident you call a panicing function inside your panic!, you may encounter quite missleading error message, such as “signal: 4, SIGILL: illegal statement”.

    tl;dr

    Don’t:

    fn foo(bar: u8) {
      if bar == 0 { panic!("I don't like 0"); }
    }
    
    fn main() {
      panic!("foo: {}", foo(0))
    }
    

    Do:

    fn foo(bar: u8) {
      if bar == 0 { panic!("I don't like 0"); }
    }
    
    fn main() {
      let msg = foo(0);
      panic!("foo: {}", msg)
    }
    
    Read more...
  • Save (y)our time by reducing the number of required dependencies

    The ease of adding new dependencies in Rust is a great power that, as usual, comes with great responsibility. Here are some dos and don’ts to avoid too many dependencies in your Cargo.lock and thus reduce the amount of coffee you drink during the compilation process!

    Read more...
  • Global variables and Unity

    State is the root of all evil. Global state is even worse. However, if something can simplify your life, then used with caution might be a huge time-saver. In this post, I will show my approach to global data storage in a Unity project. It allows you to store and edit in the Editor all kind of serializable data including references to various Unity objects such as Sprites or GameObjects.

    Read more...

I've been a developer since the late 90's. I learned to code as a child. A child's brain is simple. So as a child, I learnt to write simple code. My body grew up but my brain remained simple. Simplicity is beauty.

Side note: I'm not a native English speaker. I don't even think my english is good. If you spotted any gramatical error, let me know via e-mail or just make a pull request