spartanatreyu

joined 2 years ago
[–] spartanatreyu 3 points 3 weeks ago

This is why you're meant to comment your code.

Your code tells you "what", your comments tell you "why".

Here's a good review of comments in the redis codebase: https://antirez.com/news/124

[–] spartanatreyu 2 points 3 weeks ago (1 children)

When the keyboard becomes both columnar/ortholinear (AKA: keys are in up/down straight lines) and when it also becomes staggered (AKA: each column is ,moved up or down slightly so it matches the length of your fingers), then I am buying a framework so hard.

[–] spartanatreyu 5 points 1 month ago

and those who prevent history from being taught, want to lift themselves up at the expense of others

[–] spartanatreyu 5 points 1 month ago* (last edited 1 month ago)

Typescript has made the js ecosystem better.

Tailwind is the epitome of someone trying to make one tool that does everything then tries to sell you on buying only that one tool. As the old saying goes: When all you have is a hammer, everything looks like a nail. Sure you can hammer a screw into a wall, but if you used the right tool for the job to begin with, you could also unscrew the screw and replace it later without needing to fill the old hole or make another hole in the wall.

Tailwind exists purely because developers keep trying to learn CSS the wrong way from people who don't know how to use it, then get frustrated when it doesn't work out.

The problem is that when you're starting out, you don't know the difference between good and bad teachers.

[–] spartanatreyu 3 points 2 months ago (1 children)

I would advise against using pixels for margin/padding since it'll have issues for users who have different zoom/text sizes than you do.

Stick to rem for margin and padding.

If you're still early days with css, it's worth pointing out that you should use a "css reset" file. It will solve problems for you that you don't even know exist yet.

[–] spartanatreyu 1 points 2 months ago

I'm more of a Deno person myself, but I like a good chunk of what's here.

[–] spartanatreyu 3 points 2 months ago

How the fuck has JavaScript lasted three years, let alone 30?

Because it's easier to constantly improve an existing standard than getting the major players to work together to agree on a new standard.

And also because JS has come a long way. Its runtimes are way faster than they have any right to be, and it's hacky enough that you can warp it into almost any workflow you want.

[–] spartanatreyu 2 points 2 months ago

The more windows falls down the enshittification spiral, the more likely the EU will get pissed at Microsoft and fund Linux environments where it's needed.

[–] spartanatreyu 3 points 2 months ago (1 children)

Does everyone who’s following the old account automatically refollow you when you do that?

It doesn't port over any old comments/posts, but I'm pretty sure that when anyone @'s you, it's forwarded to the new account.

IMO it’d still be useful to be able to use an identity you control, like a domain name.

Mastodon already does this

[–] spartanatreyu 6 points 2 months ago (3 children)

It's worth pointing out that while ActivityPub doesn't currently support account migration (although there are proposals in the works for how to do this), Mastodon does have a weak form of support right now.

You can create a new account on another mastodon instance, then you're able to point your old account to your new account.

[–] spartanatreyu 2 points 3 months ago (1 children)

What did Australia do?

I know it has backwards security laws.

[–] spartanatreyu 14 points 4 months ago* (last edited 4 months ago) (3 children)

I think the more important question here is why are you using the internet without an adblocker?

But to answer the lesser question, stick this in a pinned tab and download what you need: https://devdocs.io/offline

 

Answer: create a new object with the properties of the two original objects using the spread operator.

The order you insert the objects into the new merged object determines which object's properties take priority over the other.

Linked example:

const obj1 = { foo: "bar", x: 42 };
const obj2 = { foo: "baz", y: 13 };

const clonedObj = { ...obj1 };
// { foo: "bar", x: 42 }

const mergedObj = { ...obj1, ...obj2 };
// { foo: "baz", x: 42, y: 13 }

You can find more discussion here: https://stackoverflow.com/questions/171251/how-can-i-merge-properties-of-two-javascript-objects-dynamically

 

The mistake most devs make when trying to document their project is that they only make one (maybe two) types of documentation based on a readme template and/or what their mental model of a newcomer needs.

Devs need to be actively taught that:

  1. Good documentation isn't one thing, it's four. To have good documentation, you need all four distinct types of documentation.
  2. What the four types of documentation are (this is discussed in the link)

If you don't have all four types of documentation, you have bad documentation.

view more: ‹ prev next ›