• 0 Posts
  • 12 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’m in a band that performs on occasion at CFBs (Canadian Forces Bases). We typically eat there and spend the night either in barracks or guest housing.

    I have noticed that when we play for officers, dinner is like steak and lobster. When we play for enlisted, it’s more like high school cafeteria. The one and only time I had to excuse myself towards the end of a concert and miss the closing number was after eating at the enlisted mess and getting explosive diarrhea.





  • tunetardis@lemmy.catoProgrammer Humor@lemmy.mlTrue Story
    link
    fedilink
    arrow-up
    12
    ·
    edit-2
    3 months ago

    There is an issue with templated code where the implementation does have to be in the header as well, though that is not the case here. C++20 introduced modules which I guess were meant to sort out this mess, but it has been a rocky road getting them to be supported by compilers.






  • That Sora-Q rover is some cool tech. I remember watching a demo of it on a TV show. It was co-developed by JAXA (the Japanese space agency) and TOMY (yes, the toy company), and it’s a little transformer bot.

    My Japanese is a little rusty, but in the interview, the inventors talk about how they wanted a tiny rover the size of a baseball that could navigate the lunar surface. After numerous abortive attempts at making something that small that could still propel itself over lunar sand, one of the team had a dream about sea turtles that inspired the final design. They claim it can handle grades of up to 30° which is better than a lot of larger rovers.

    And yes, TOMY is making a consumer version of it with a working camera you can operate using a phone app. Their rep said they wanted to inspire a new generation to tinker and develop interest in space exploration and sciences in general.