Readit News logoReadit News
scotty79 commented on JSDoc is TypeScript   culi.bearblog.dev/jsdoc-i... · Posted by u/culi
skydhash · 9 hours ago
Regardless of how dynamic typing is, the contract being enforced stays the same. It's just less enforced by tools. So with dynamic typing, you will have to change the same amount of code if you want your code to stay correct. The only variation in code changes comes from the annotation for the type system.
scotty79 · 8 hours ago
> So with dynamic typing, you will have to change the same amount of code if you want your code to stay correct.

No, because if a piece of data is pushed through multiple layers you can just change its type at the source and the destination and not in all the layers the data is pushed through. And you can still be correct.

Imagine you have a thing called target which is a description of some endpoint. You can start with just a string, but at one point decide that instead of string you'd prefer object of a class. In dynamic language you just change the place where it originates and the place where it's used. You don't need to change any spot in 3 layers that just forearded target because they were never forced assumed it's a string.

You can achieve that in staticly typed language if you never use primitive types in your parametrs and return types or if you heavily use generics on everything, but it's not how most people write code.

Tools can help you with the changes, but such refactors aren't usually available in free tools. At least they weren't before LLMs. So the best they could do for most people was to take them on a journey through 3 layers to have them make manual change from string to Target at every spot.

scotty79 commented on Hashcards: A plain-text spaced repetition system   borretti.me/article/hashc... · Posted by u/thomascountz
IAmBroom · 15 hours ago
"After all to are the one with a problem."

Please edit this so it says whatever you meant.

scotty79 · 8 hours ago
Sorry, fat fingers on a touchscreen ... What I meant to write was "After all you are the one with a problem." Apologies for being uncharitable. I was in a rough mood when I wrote that.
scotty79 commented on Avoid UUID Version 4 Primary Keys in Postgres   andyatkinson.com/avoid-uu... · Posted by u/pil0u
dimitrisnl · 21 hours ago
Noob question, but why no use ints for PK, and UUIDs for a public_id field?
scotty79 · 9 hours ago
One of the benefits of UUIDs is that you can easily merge data coming from multiple databases. Auto-increments cause collisions.
scotty79 commented on JSDoc is TypeScript   culi.bearblog.dev/jsdoc-i... · Posted by u/culi
jve · a day ago
As I understand that is the core design feature of any strongly typed language.
scotty79 · 9 hours ago
Not really. Strongly typed languages don't usually support not having any types in your code (or any amount of gradual typing). At least not with any convenient syntax. There's usually some one clumsy "dynamic" type that doesn't interact with the rest of the system well and you'd be crazy to start writing your code using only this dynamic type.

I can't just write C++ like:

  any a = 1;
  a = "Hi!";
I also can't tell JS this shouldn't be allowed. But I can tell this to TS, at any stage of evolution of my program.

scotty79 commented on Hashcards: A plain-text spaced repetition system   borretti.me/article/hashc... · Posted by u/thomascountz
furyofantares · a day ago
In what way are you a professional problem solver such that it applies to random problems in peoples' lives?

The thing that drives me nuts is when people start throwing out immediate ideas, sometimes before I've even given a full account of the problem. But even if they do wait, I don't feel like explaining why all your immediate ideas don't work - most of the time, I've also already thought of those things. Try asking questions instead.

scotty79 · 16 hours ago
There's value to anyone willing to listen to you talking about your problem. Otherwise rubber duck debugging wouldn't work.

Why don't you ask some questions about their obviously wrong solutions instead od spoiling the fun they have guessing? After all to are the one with a problem.

scotty79 commented on Hashcards: A plain-text spaced repetition system   borretti.me/article/hashc... · Posted by u/thomascountz
0cf8612b2e1e · a day ago
I love this example because the correct, wise approach is so alien to my mind that I do not know how to respond to such situations. I am a professional problem solver, you described a problem, yet you do not want it solved? Just talk about it being annoying, like an immutable facet of the universe? Should I retort about my grievances with gravity making roof repairs a bear?
scotty79 · 16 hours ago
> I am a professional problem solver

The question is, do you want to be anything more than that?

Even as a problem solver you might ask yourself, what should I do in any given interaction to not become the additional secondary problem myself.

scotty79 commented on JSDoc is TypeScript   culi.bearblog.dev/jsdoc-i... · Posted by u/culi
skydhash · 20 hours ago
I don’t think so. With a good editor, you change the type and run the compiler which will warn you with all the locations you’ll need to edit. Then you can quickly navigate to those locations.
scotty79 · 18 hours ago
Yeah, tooling for strongly typed languages is way better than 20 years ago. They are getting very being usable.
scotty79 commented on The Gorman Paradox: Where Are All the AI-Generated Apps?   codemanship.wordpress.com... · Posted by u/ArmageddonIt
KurSix · a day ago
That works great for a small greenfield project. Now try applying it to a million-line monorepo with three competing architectural patterns and a CI/CD pipeline that breaks if you look at it wrong. The real world of development is much messier
scotty79 · 21 hours ago
If you have such a beast you have n problems. Not being able to apply AI to it is just (n+1)th.

It works great when dealing with microservices architecture that was all the rage recently. Of course it doesn't solve it's main issue that is that microservices talk to each other but it still lets you sprint through a lot of work.

It's just that if you engineered (or engineer) things well, you get immediate huge benefits from AI coders. But if all you did last decade was throw in more spaghetti into already a huge bowl of spaghetti you are out of luck. Serves you right. The sad thing is that most humans will get pushed out into doing this kind of "real development" so it's probably a good time to learn to love legacy, because you are legacy.

scotty79 commented on If AI replaces workers, should it also pay taxes?   english.elpais.com/techno... · Posted by u/PaulHoule
kelseydh · a day ago
Corporations should be taxed on their profits, including profits boosted by the invention of new technology.
scotty79 · 21 hours ago
You tax where you can not where you should. Corporations trivially hide profits. What they couldn't hide well was labor. You know what else they can't hide? Their power bill. It even works for companies that eternally operate "at loss" (which also parallels taxing labor).
scotty79 commented on If AI replaces workers, should it also pay taxes?   english.elpais.com/techno... · Posted by u/PaulHoule
sigmoid10 · a day ago
It's actually trivial. AI apis are pretty streamlined by now. Just slap a tax on processed tokens and you're guaranteed to reach every AI agent out there. It already happens everywhere with sales tax for normal products. Just treat tokens as the product and create an extra tax for it.
scotty79 · 21 hours ago
You could tax the energy and subsidize it for individuals. It's the ultimate resource that all business uses. But that would mean unscrupulous countries could tax their energy less and attract AI farms. So probably you need to tax imported tokens (and other goods) as well. There could be many benefits of taxing grid energy instead of labor.

u/scotty79

KarmaCake day15019July 7, 2009View Original