mcc Profile picture
2 Jun, 7 tweets, 2 min read
TypeScript is basically the only reason I'm able to write JavaScript. At all. Everytime I interact with a JS library that doesn't have typings I'm reminded of this at a deep level. "protocol.include()" "protocol.include" is not a function" How the hell was I supposed to know that
Anyway just lost a day or two of time because
1. Writing callbacks/async functions
2. Something in the guts of the system calling the callbacks was catching exceptions and not printing the errors
3. Called a nonexistent function in a callback because there's no typings or docs
4. Invalid function call throws an exception, callback caller throws away the exception, my debug printf on the line after the invalid function is not printed
5. I assume, because the debug printf isn't seen, that the entire function is not being called

THIS HAS HAPPENED BEFORE
Alright. I am in a nightmare. Does anyone want to explain this to me.
I have what I *think* is an array. I console.log it and also its type. It says it's an "object" and then prints it out like it's an array.
I call .include(), a ECMAScript 7 method on arrays. it doesn't exist. ImageImage
If I were in Python, I'd understand this. I'd think: This is a non-array object which follows the iteration protocol. I need to convert it to an array with [x for x in protocols]. What is the most appropriate way to deal with this situation in JavaScript?
D: D: D: D: D: D: D: D: this was the problem
Anyway I'll note this error was simple, silly, and "my fault" (1 letter typo). But various lang/ecosystem characteristics (no typings/docs, callback programming with the risk of a diaper pattern, odd duck type punning) made it a nightmare. I've been chasing this bug since Dec 12

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with mcc

mcc Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @mcclure111

4 Jun
I really, really hate using software that doesn't come with documentation Image
UPDATE: After a *lot* of fiddling I have managed to get to reduce the "unknown function code" from 0x935 to 0x7a. Is that better? It's going down. Is going down better? Image
What I'm trying to do is call this function. This is all the docs I have. Note the lack of a type on "key". In fact, the key MUST be a very special object created by an entirely other npm package, which can itself only be constructed with the output of a third npm package Image
Read 6 tweets
3 Jun
So… this is odd.
Sublime Text did an update.
Now it is running like mud and pegging the CPU at 100%.
I eventually realized it was doing this "indexing" task.
Indexing… what?
I think it might be doing some parsing operation on multi-megabyte webpack-generated js files D: D: D:
Also the dock icon updated and now it follows the new Mac OS HI standards, which suck :/ They made every icon a rounded rectangle and now I can't distinguish them by shape anymore
It is SUCH an awful feeling trying to type on a MacBook which is overheating. The keys are made of lava
Read 16 tweets
2 Jun
Hey Javascript people. Let's say I'm sitting here and going "I need to sign a binary blob then later verify that signature... I know, I'll use SubtleCrypto.sign". Do you feel a need to fling my laptop aside and yell "NO! You fool!! Use ____ from NPM!!" instead?
Also:
- How do I know which of the four crypto.subtle.sign algorithms to use?
- subtle.sign and subtle.encrypt use a totally different. Is there a way to use one key for both signing and encryption?
- I don't see nothin in the docs about like... IVs. Isn't choice of IV important
This is really hard maybe I'll just use TweetNacl :(
Read 4 tweets
2 Jun
Hey so uh if this is for real: What are the chances we could successfully run a boycott threat campaign against Square and Sega demanding they cancel their planned NFT releases this summer
Sega and Square both made similar announcements around the same time (NFTs coming at a vague time this summer); the similarity suggests to me some specific common NFT vendor (in Japan?) got to them. But the lead time creates a sliver of a chance for organizing
(The logic of a boycott is hope Sega/Square may be willing to drop the thing if they realize profits are no longer worth the cost. But if a 3p vendor is driving the NFT campaigns, that might not matter—maybe Sega/Square get a fixed $N million regardless of what the NFTs sell for)
Read 4 tweets
2 Jun
So: I want to talk about Returnal.

What I want to convince you is *this is the Metroid Prime game you have been waiting for for years*. Assuming you've been waiting for a Metroid Prime game. There's elements of Hades and other stuff in there, but Metroid Prime sets the gamefeel.
Combat is pure MP. A combination of hitscan-for-you, projectiles-for-enemies and homing elements make shooting feel like the MP lockon. Since enemy projectiles are slow moving, you're mostly dodging while maneuvering terrain like you were in MP. Dash feels like target-jump.
You crawl a rainy alien planet while progressively unlocking upgrades. Instead of backtracking there's a sort of forward-tracking— you encounter rooms you can't solve yet, until you get an upgrade in the metagame and think "ah! I can now solve [x room] when it comes up at random"
Read 6 tweets
24 May
This game I have been working on for three years, slowly calcifying around what started as a rapid-prototyping demo, has a very important function that draws a scene. The function takes two arguments, a scene, and "realBig". If "realBig" is true, the scene is drawn 4 times larger
I don't... I don't remember why realBig is there. I can't fathom why I'd need to sometimes draw it bigger than other times, much less by precisely a factor of 4. This function is called in three places, in two realBig is true, in the third it is false.

What.
This project has basically been me going in with a well-honed, carefully-thought-out mental list of mistakes to never make in a long-running game project, and then committing all of them
Read 4 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Too expensive? Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal Become our Patreon

Thank you for your support!

Follow Us on Twitter!

:(