Hacker News new | ask | show | jobs
by winrid 2112 days ago
Some of the code for the tools is fun to read https://github.com/google/makani/blob/c421e4497dd09c86b01725...

This is not proper Java, at all. But it's what a lot of Java code looks like because it's a good choice for inexperienced devs or rushed projects.

3 comments

The commenting here is actually pretty dope. I really enjoy the small notes saying _why_ the code exists:

    // because all low speed wind tunnel cases are overset and all high speed are 
    // fixed with a remesh, we only rotate in the presence of overset domains.
This is something that personally I strive to do but isn't always repeated in my team. It's important as 6 months later you struggle to remember the nuance that lead to your code being written.

Whoever this is seems to have experience with this, so I definitely wouldn't say this is an inexperienced dev.

According to GitHub this project is less than 3% Java. It's mostly C++, C, and Python
That's right; the real-time autopilot is written in C, and the flight simulator is written in C++. We have a really slick configuration system written in Python that compiles down to a Python dict and then a C struct at build time.

Example production C code (the crosswind flight controller): https://github.com/google/makani/tree/master/control/crosswi...

Example production C++ code (the "wing" model in the simulator): https://github.com/google/makani/blob/master/sim/models/rigi...

Other than it being a 2400 line file, what's wrong with the Java code?