pixelscript

joined 3 months ago
[–] pixelscript@lemm.ee 6 points 1 month ago* (last edited 1 month ago)

It's also part of what makes FOSS niche.

[–] pixelscript@lemm.ee 20 points 1 month ago* (last edited 1 month ago)

I recognize three kinds of comments that have different purposes.

The first kind are doc block comments. These are the ones that appear above functions, classes, class properties, methods. They usually have a distinct syntax with tags, like:

/*
 * A one-line description of this function's job.
 *
 * Extra details that get more specific about how to use this function correctly, if needed.
 *
 * @param {Type} param1
 * @param {Type} param2
 * returns {Type}
 */
function aFunctionThatDoesAThing(param1, param2) {
    // ...
}

The primary thing this is used for is automatic documentation generators. You run a program that scans your codebase, looks for these special comments, and automatically builds a set of documentation that you could, say, publish directly to a website. IDEs can also use them for tooltip popups. Generally, you want to write these like the reader won't have the actual code to read. Because they might not!

The second kind is standalone comments. They take up one or more lines all to themselves. I look at these like warning signs. When there's something about the upcoming chunk of code that doesn't tell the whole story obviously by itself. Perhaps something like:

/* The following code is written in a weird way on purpose.
I tried doing <obvious way>, but it causes a weird bug.
Please do not refactor it, it will break. */

Sometimes it's tempting to use a standalone comment to explain what dense, hard-to-read code is doing. But ideally, you'd want to shunt it off to a function named what it does instead, with a descriptive doc comment if you can't cram it all into a short name. Alternatively, rewrite the code to be less confusing. If you literally need the chunk of code to be in its confusing form, because a less confusing way doesn't exist or doesn't work, then this kind of comment explaining why is warranted.

The last kind are inline comments. More or less the same use case as above, the only difference being they appear on the same line as code, usually at the very end of the line:

dozen = 12 + 1; // one extra for the baker!

In my opinion, these comments have the least reason to exist. Needing one tends to be a signal of a code smell, where the real answer is just rewriting the code to be clearer. They're also a bit harder to spot, being shoved at the ends of lines. Especially true if you don't enforce maximum line length rules in your codebase. But that's mostly personal preference.

There's technically a fourth kind of comment: commented-out code. Where you select a chunk of code and convert it to a comment to "soft-delete" it, just in case you may want it later. I highly recommend against this. This is what version control software like Git is for. If you need it again, just roll back to it. Don't leave it to rot in your codebase taking up space in your editor and being an eyesore.

[–] pixelscript@lemm.ee 5 points 1 month ago

Easily my vote for the most unweildy named concept in software development.

It always reads like a typo of memorization. Not exactly an accident, of course. Memorize is memory + -ize, while memoize is memo + -ize, and memo is short for memorandum, which comes from memory. Both terms refer to some kind of storage and retreival of information. The similarities are deliberate.

My gripe with it is that memo in my head exclusively refers to a one-paragraph email sent to my company to notify me about something. Not remembering something. Definitely not the very specific case of linking input parameters to results of pure functions.

So we have this made-up word that looks suspiciously like an existing word that is related and means something related but is not the same thing, and the words it is actually adapted from don't mean the thing it's supposed to mean. Thanks, I hate it.

Really ought to call memoization what it what it really is. Lazy-loaded lookup tables.

[–] pixelscript@lemm.ee 4 points 1 month ago

That's the thing, though. I computed from the claimed figure above of 13 billion net income. The costs are already accounted for.

[–] pixelscript@lemm.ee 3 points 1 month ago

I've been told we have state senators who openly claim to only be there to keep speeding tickets low.

[–] pixelscript@lemm.ee 35 points 1 month ago* (last edited 1 month ago) (7 children)

If you make $50k/yr after taxes, the equivalent fine would be on the order of about $120.

Where I'm from, that's a speeding ticket.

[–] pixelscript@lemm.ee 3 points 1 month ago* (last edited 1 month ago)

why is there no replacement for x11 forwarding over ssh??

There kind of is. The project you're looking for is waypipe.

Knowing how these things tend to go, I predict you'll try to use it for your use case and it just won't work for whatever stupid reason. But I successfully used it to tunnel an app from my Debian machine at home to a Windows machine under WSL.

[–] pixelscript@lemm.ee 2 points 1 month ago

Detective Heart of America: The Final Freedom is a comedy film that will either be the funniest thing ever or an absolute cringefest, depending on your opinion of Jason Steele's brand of humor. There is no in-between. It's available to watch for free on YouTube, or whatever alternative frontend you use.

Jason Steele, AKA FilmCow, you may recognize from YouTube series such as Charlie the Unicorn or Llamas with Hats. Yeah. That guy. Imagine 70 minutes of that.

The film is a sequel to a pair of 4 minute long shorts (here and here). The film contains characters from these shorts and references events from them. So watching the film without watching the shorts first leads to some characters showing up out of nowhere with unexplained details. But that's how every other character in the movie is, so... whatever, lmao.

I still recommend watching the shorts first. If nothing else they can serve as an appetizer for you, to decide whether or not it's your cup of tea. The film is the same vibe as the shorts, just longer. If you hate the shorts you will despise the film.

It's unironically my favorite film, so, I hope you get some amusement out of it. But if you bounce right off, I won't be surprised. If you like it, enjoy quoting every line of it for the next month. If you hate it, sorry for wasting your time.

[–] pixelscript@lemm.ee 4 points 1 month ago

I still won't forgive Shopko for consuming Pamida and ultimately taking the remnants of Pamida down with it.

I'm surprised to see on Wikipedia that Shopko actually owned Pamida basically the entire time I was growing up, they just ran it independently. They even broke up breifly before re-merging later. The second merger sent it all to shit, though. "Shopko Hometown" my ass.

[–] pixelscript@lemm.ee 8 points 1 month ago

As a fanart hoarder, the number of great artists I know of who seem to exclusively post their work on Twitter, a completely unsearchable platform that lossy compresses anything you upload to it and makes it a pain in the dick to get highest quality downloads, as opposed to a browsable upload platform like deviantArt, Pixiv, or Tumblr, infuriates me.

I think I know why a lot of them do it, too. To them, their work is intentionally ephemeral. They want to draw a thing, release it to the world, be admired for a day, and let it fade away into the aether. They don't want a browseable archive of their past work. Art they draw is disposable. Twitter is the best platform for this, as everything on Twitter is naturally consumed this way. That, and its audience is way larger than any of the other platforms I mentioned, so they get more eyes on their work.

Yeah, an archive exists on Twitter, but unless you want to scroll scroll scroll through every single tweet they've ever made in reverse chronological order, you're never going to find what you're looking for without some kind of external indexing tool. All of this before Elon bought it and further enshittified it within an inch of its life. You can't even browse posts without being logged in anymore.

[–] pixelscript@lemm.ee 3 points 1 month ago

Fellow tattooless here. Uh, neither?

I simply don't see the appeal of putting on something I can't easily take off if I wanted to, for its own sake. Yeah, tattoos aren't permanent, a removal process exists. But they cost money and require an appointment to be rid of, on top of the investment of time, money, and pain to buy in. The barrier to entry and the barrier to exit are both too high for my liking.

Ideally you get a tattoo and enjoy it for life. I can't commit to that kind of decision. Not for a funny body picture. If I need a memento to cherish memory of a thing or event I'll get a tchotchke or something.

I have no complaints about others' tattoos. They're more often than not incredible works of art.

view more: ‹ prev next ›