• 1 Post
  • 91 Comments
Joined 1 year ago
cake
Cake day: June 11th, 2023

help-circle



  • I started in C and switch to C++. It’s easy to think that the latter sort of picked up where the former left off, and that since the advent of C++11, it’s unfathomably further ahead. But C continues to develop and occasionally gets some new feature of its own. One example I can think of is the restrict key word that allows for certain optimizations. Afaik it’s not included in the C++ standard to date, though most compilers support it some non-standard way because of its usefulness. (With Rust, the language design itself obviates the need for such a key word, which is pretty cool.)

    Another feature added to C was the ability to initialize a struct with something like FooBar fb = {.foo=1, .bar=2};. I’ve seen modern C code that gives you something close to key word args like in Python using structs. As of C++20, they sort of added this but with the restriction that the named fields have to come in the same order as they were originally defined in the struct, which is a bit annoying.

    Over all though, C++ is way ahead of C in almost every respect.

    If you want to see something really trippy, though, have a look at all the crazy stuff that’s happened to FORTRAN. Yes, it’s still around and had a major revision in 2018.


  • I think I could get very nervous coding for the military, depending on what sort of application I was working on. If it were some sort of administrative database, that doesn’t sound so bad. If it were a missile guidance system, on man! A single bug and there goes a village full of civilians. Even something without direct human casualties could be nerve-wracking. Like if it were your code which bricked a billion-dollar military satellite.

    Speaking of missile guidance systems, I once met someone who worked a stint for a military contractor. He told me a story about a junior dev who discovered an egregious memory leak in a cruise missile’s software. The senior dev then told him “Yeah, I know about that one. But the memory leak would take an hour before it brings the system down and the missile’s maximum flight time is less than that, so no problem!” I think coding like that would just drive me into some OCD hell.








  • Wow, that is fascinating!

    Makes me wonder about the other direction, going into the near infrared as opposed to UV. I remember from a class in remote sensing that many plants are actually most reflective in that band (more so than in green, even). NIR air photos are often used by biologists to get an indication of the health of a forest. But I have no idea whether animals also reflect NIR? It may be that most animals cannot see in that band in the first place, so it would not offer any camouflage advantage.


  • Great read! That explains a lot.

    I’ve been deep diving a bit myself and found this article that explains another thing that’s puzzled me over the years. Some birds have crazy vibrant coloration that almost glistens, like peacock feathers. Outside of the zoo, I’ve noticed it a bit in common grackles. They look black on first glance, but when you study them closely, they have this kind of purple sheen around their heads. Apparently, it’s still melanin at work here, but it’s structured in a very special way.