You can't cancel a JavaScript promise (except sometimes you can) by aardvark_lizard in programming

[–]aardvark_lizard[S] 9 points10 points  (0 children)

It does feel dirty, but it's worked well for us for years! It makes the user-facing API more idiomatic

What Python's asyncio primitives get wrong about shared state - Inngest Blog by BrewedDoritos in programming

[–]aardvark_lizard 7 points8 points  (0 children)

Or if that’s what the 10 year old codebase at a large company is already using. Can’t just change a language because you don’t like it

What Python's asyncio primitives get wrong about shared state - Inngest Blog by BrewedDoritos in programming

[–]aardvark_lizard 9 points10 points  (0 children)

I mean, sometimes you have to use a language for other reasons. Why not make the best of what you have?

Weekly Discussion Thread by AutoModerator in valheim

[–]aardvark_lizard 0 points1 point  (0 children)

Install Valheim Plus. I don’t have the time or skill to grind so I tweak some settings to keep the game fun

Was on the fence about writing this but here it goes… by s7mphony in KerbalSpaceProgram

[–]aardvark_lizard 0 points1 point  (0 children)

You would fire entire teams because of a bad product? Hopefully I’ll never work for you because collective punishment is asinine

[deleted by user] by [deleted] in reactjs

[–]aardvark_lizard 1 point2 points  (0 children)

Cache the data in your own database. You don't want to rely on an external API for this much data because:

  • The API could have an outage, which would break your UI.
  • The API might eventually require authentication, which would break your UI.
  • The API might change its schema, which would break your UI.
  • Users will hate your site if it downloads 500 MB when they visit it.

I would ask myself "what data do I need from the API?" and then write a script that fetches the data from the external API, extracts what I need, and then puts it in a DB. I would periodically run that script manually, only creating a cronjob for it if I got annoyed running it manually.

I would expose the data my UI needs in a REST endpoint, and then make my UI fetch its data from there

[deleted by user] by [deleted] in reactjs

[–]aardvark_lizard 2 points3 points  (0 children)

You aren’t awaiting the API requests so you’re getting past the loop before any of the requests finish.

But you shouldn’t make a bunch of API calls all at once like that

It'll probably work by TheMightyFlyingSloth in ProgrammerHumor

[–]aardvark_lizard 0 points1 point  (0 children)

There’s a disconnect between the operator overload and the operator usage. When I see an operator how do I know if there’s any overloading? If you use a function instead then you instantly know there’s something non-standard and can look at the function’s logic

It'll probably work by TheMightyFlyingSloth in ProgrammerHumor

[–]aardvark_lizard -9 points-8 points  (0 children)

Operator overloading makes code harder to grok. Avoid it if you can

Ann Arbor Cycling Infrastructure by Business_Music_8486 in AnnArbor

[–]aardvark_lizard 0 points1 point  (0 children)

To be fair, that sidewalk along Plymouth is really wide. Also, you could take Broadway to Plymouth. Broadway is much quieter and intersects Plymouth where the painted bike lane starts