News for hackers. Stuff that matters.
Re:Why Not Document.write()? by holoduke on Sunday April 02, 2023 @02:15AM (#35407712)
Why is node so pupular serverside? I believe js is one of the easiest languages to step into. Its standard syntax is super easy to read. Its standard lib is very small. And it performs extremely good. The most performant scripting languages there is. Heavily optimized browser render engines and javascript executors helping with this. Nah. There is a reason why js is with us.
Re:Why Not Document.write()? by layer8 on Sunday April 02, 2023 @03:13AM (#35407998)
No, the sole reason why JS became popular server-side is because it’s the same language as used in the browser client-side. A large number of people started out learning programming in the browser, and having been “primed” with JS that way, it’s what they’re used to and then also want to use server-side.
Re:Why Not Document.write()? by Kiro on Sunday April 02, 2023 @05:01AM (#35408571)
> No, the sole reason

You can't possibly know that.

Re:Why Not Document.write()? by Timon3 on Sunday April 02, 2023 @07:06AM (#35409287)
The likelihood of a HN comment being correct is inversely proportional to its certainty.

I'm sure of it.

Re:Why Not Document.write()? by v3ss0n on Sunday April 02, 2023 @07:08AM (#35409298)
This , nobody liked JS on server side world before. Until node came in. And many people still hate JS even after year of serverside development. Especially who had done work with far sound languages like python and ruby on Django or RoR frameworks. There is no Quality framework for JS on that space even though many startups are using node as backend. Django Popularity rising back these days on hires .
Re:Why Not Document.write()? by veidelis on Sunday April 02, 2023 @03:38AM (#35408157)
One big reason I use JS on the backend is because Prisma can generate types for my API endpoints which I can use for my client code. Having confidence that my code works as expected is a huge deal and having end to end type safety is a great first step towards that.