• 0 Posts
  • 53 Comments
Joined 1 year ago
cake
Cake day: June 21st, 2023

help-circle

  • The “‘modern’ development stack” we used at my school when I was in a CS program was C++98 or something, compiled using gcc directly. This was in the last decade. It technically wasn’t C!

    But we did use C in my computer engineering classes so I guess they technically did teach it. I feel very fortunate that I haven’t needed to use it since then.


  • Pushing HTML even further, one could say it’s a declarative programming language that programs a UI in a mostly-stateless manner (inputs aren’t really stateless but you can argue the state is provided by the UI rather than managed by HTML).

    I’m not sure I’d make this leap myself though, I have a hard time classifying it (or any other markup language) as a PL. As far as I am aware, you can’t really program a state machine with pure HTML, though you can accept inputs and return outputs at least.



  • I think it’s good to document why things are done, but extracting things out into another function is just documenting what is being done with extra steps. This also comes with a number of problems:

    1. Not all languages are readable. Documenting what is being done is important in some C, or when working with some libraries that have confusing usage syntax.
    2. Not all people reading the code know the language or libraries well. Those people need guidance to understand what the code is trying to do. Function names can of course do this, but…
    3. Not all types can be named in all languages. Some languages have a concept of “opaque types”, which explicitly have no name. If parameter and return types must be specified in that language, working around that restriction may result in unnecessarily complicated code.
    4. Longer files (the result of having dozens of single-use functions) are less readable. Related logic is now detached into pointers that go all over the file all because of an allergic reaction to code comments, where a simple // or # would have made the code just as readable.
    5. Function names can be just as outdated as code comments. Both require upkeep. Speaking from personal experience, I’ve seen some truly misleading/incorrect function names.




  • For library code - yes, you’d usually want to direct users to the correct way of using the library, so you’d be more likely to come across fallible build functions or a bunch of type parameters to constrain when it can be called.

    For applications - honestly, it’s your code, so do what makes sense to you. Using a build function can help you ensure your settings were fully configured before using them, but it’s up to you if that’s the direction that makes the most sense to you. One benefit is you only need to perform the check once, but the downside is having another “built” type that you need to keep in sync with the original type. You can also look at libraries like derive_builder if you want to have your builder generated for you to avoid needing to manually update two separate types.




  • Some thoughts on the comments on Discord:

    I can understand most of the arguments against Discord, and there are some problematic communies on it of course, but I’m not sure I understand how using Discord over an alternative puts someone more at risk of exposure to those communities. People are free to join and leave servers at will, so is the issue that these servers built around FOSS projects have toxic communities? If so, how would being on any other platform solve this?

    Speaking from experience, just about all the servers I’m in have some kind of “no politics” rule, a very inclusive “be nice” rule, and a pronoun selector. Maybe it’s just the servers I join, but hate speech gets people banned pretty quickly.

    Anyway, there are plenty of arguments that can be made about discoverability, lack of control, privacy, and the non-FOSS nature of the platform to justify its presence on that list.


  • Speaking as someone with a MTF close friend and NB spouse, but the term used in the article is the term everyone around me used when I was growing up. That term may be obsolete now, and if so, the author simply needs to be informed. There’s no need to assume they meant harm by it.

    If they knowingly used a term that may offend, then that’s of course a separate issue.


  • In addition to 1:many, many:many, and many:1 (which is just 1:many but looking at it in the other direction), you also occasionally see 1:1, for example if you want to augment a table with additional data. This might be done by having your foreign key also be your primary key in the augmenting table, since that would also enforce a uniqueness constraint on the FK as a result.

    Also, probably unnecessary to mention, but you can also have “0 or 1” relationship (meaning one side is optional but capped at 1). These are technically separated from “1” relationships usually when you get into all the theory. An example of this might be a “0:1” relationship using the above augment table, but where the augmenting table isn’t required to have a row for every row in the augmented table. (A 1:1 constraint can be enforced, for example, by having an additional FK in the augmented table pointing to the augmenting table.)



  • Not quite a “gaming PC” since, at least if they’re using something like Nvidia’s Hopper GPUs (or relying on another service that does), they’re not designed for gaming (and in the price range of $10k-$100kish), buuut if you ignore the finer details then fundamentally it’s basically like that. They’d send the image to their “very expensive gaming PC server” where the inferencing would be done.


  • I’ve seen this in a few places on desktop, and I have no clue why it’s even a feature. I’m not aware of anyone using it anywhere (although to be fair I haven’t thought to ask).

    As for why it’s enabled by default, probably for visibility. The easiest way to get people to use a feature is to make them use it and make them explicitly disable it (if even an option). For AI training, they could theoretically just capture typing data and messages regardless of if the feature is enabled/disabled anyway.



  • Maybe it’s just me, but the majority of programmers I’ve worked with don’t even know how to quit vim, let alone use it for programming. I wonder if the demographic who completed the survey accurately represents all the people who use Rust, or only those most passionate about the language. It’s also possible that ~30% of Rust programmers do actually use vim (and friends) and represent a different group of programmers than the ones I’ve worked with (who use more traditional programming languages).

    Nothing against vim of course. vim is a great editor.