this post was submitted on 08 Oct 2023
28 points (71.9% liked)
Programming
17482 readers
202 users here now
Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!
Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.
Hope you enjoy the instance!
Rules
Rules
- Follow the programming.dev instance rules
- Keep content related to programming in some way
- If you're posting long videos try to add in some form of tldr for those who don't want to watch videos
Wormhole
Follow the wormhole through a path of communities [email protected]
founded 1 year ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
Obviously the actual programs are trivial. The question is, how are the tools supposed to be used?
So you say to use
deno
? Out of all the tutorials I found telling me what tools to use, that wasn't one of them (I really thought this "typescript" package would be the thing I was supposed to use; I just checked again on a hot cache and it was 1.7 seconds real time, 4.5 seconds cpu time, only 2.9 seconds if I pin everything to a single core). And I swear I just saw this week, people saying "seriously, don't use deno". It also doesn't seem to address the browser use case at all though.In other languages I know, I know how to write 4 files (the fib library and 3 frontends), and compile and/or execute them separately. I know how to shove all of them into a single blob with multiple entry points selected dynamically. I know how to shove just one frontend with the library into a single executable. I know how to separately compile the library and each frontend, producing 4 separate artifacts, with the library being dynamically replaceable. I even know how to leave them as loose files and execute them directly (barring things like C). I can choose between these things all in a single codebase, since there are no hard-coded project filenames.
I learned these things because I knew I wanted the ability from previous languages I'd learned, and very quickly found how the new language's tools supported that.
I don't have that for TS (JS itself seems to be fine, since I have yet to actually need all the polyfill spam). And every time I try to find an answer, I get something that contradicts everything I read before.
That is why I say that TS is a hopelessly immature ecosystem.
It sounds like to me that you've taken your knowledge of your commonly used languages for granted, and assumed a new language would be just as easy. But if you watch a developer who is dipping their toe into that ecosystem for the first time you'll find them making mistakes and running into footguns you didn't know were possible.
Regardless of the language, not having a proper guide leaves devs susceptible to the incorrect blogospam that's out there, where engagement is rewarded over correctness.
Ignore all of the blogospam.
The two things you need to know:
Here's my shortened version of number 2.
The beginning:
The false start:
The resumption:
async
/await
/Promise()
syntax sugaring, to make asynchronous programming easier...
(rest/spread operator) syntax sugaring, to make destructuring and variadic functions easier??
Nullish coalescing operator syntax sugaring??=
/&&=
/||=
Logical assignment syntax sugaringThe current state of things
Language-wise
Runtime-wise
Standard workflow
Tooling wise
For your simple fibonacci example:
console.log()
and see result in browser's console.Deno.serve()
and see result in network requests/responsesconsole.log()
and see result in terminal