News for hackers. Stuff that matters.
Re:The Deno Company by oblio on Monday March 29, 2021 @09:38AM (#26621340)
> Or if it just exists because JavaScript developers don’t want to learn something new.

It's probably a big reason. But if you think about it from the other angle... you don't want to learn Javascript, which would be new to you :-)

Re:The Deno Company by int_19h on Monday March 29, 2021 @09:42AM (#26621380)
Speaking for myself, I have already learned JavaScript - I just don't want to have to use it.
Re:The Deno Company by bluejekyll on Monday March 29, 2021 @09:48AM (#26621480)
With WebAssembly, now you don’t have to. You do need a JS shim to load the WebAssembly, but after that, pick your favorite source language that can target wasm.
Re:The Deno Company by k1rcher on Monday March 29, 2021 @09:54AM (#26621563)
This is fascinating. As someone who programs primarily in Python, I have been struggling with adapting to a JS-heavy environment in the past several years.

I have began utilizing Node + React for frontend use cases but find that my build pipelines become incredibly cluttered and esoteric rather quickly.

Am going to explore wasm solutions, thanks :)

Re:The Deno Company by giobox on Monday March 29, 2021 @10:09AM (#26621800)
I’ve long been of the opinion you must learn JS today regardless of what your preferred language might be - it’s more or less (thanks to browser vendors and the web) the closest thing we have to a “zero” dependency runtime on all platforms. Learning a WASM based workaround to avoid learning JavaScript is not helping you or the products you might want to make. There is a huge ecosystem of existing JavaScript code to adopt or extend in the client out there too. Expecting or wishing the market to bend to your preferred language or style is an often great way to become a very unhappy developer.
Re:The Deno Company by jessaustin on Monday March 29, 2021 @10:13AM (#26621886)
As someone who programs primarily in Python, I have been struggling with adapting...

Would you mind providing some more details here? After Python packaging drove me batty for the last time, I wouldn't have described the switch to JS/CS/TS as "struggling"?

With respect to "build pipelines", you don't have to use grunt, gulp, etc. It's totally fine to have regular bash commands in npm scripts.

Re:The Deno Company by k1rcher on Monday March 29, 2021 @11:16AM (#26622995)
Hm... I think the biggest issues I experience have more to do with frontend design rather than composing JS itself.

I love using it as a "one-off" scripting language which usually involves interaction with some sort of an existing codebase.

I'm also fairly confident in doing any sort of backend-centric work, in which existing components most likely exist as well (or at the very least something POC-esque to iterate on or scaffold from).

With that said I believe most of these difficulties stem from most of my experience being backend-centric roles, so when it comes time to implement a frontend from scratch, I become unsure of where to start. The sheer amount of technologies available and vast amount of flexibility is also very intimidating.

However I've been slowly but surely immersing myself in the stack(s), and have found that much like my experience with CSS the best way to learn is to simply do it-- making mistakes and learning from them in my exploratory learning.

I do appreciate what you said about build pipelines and feel much better about my current projects :-)

quick edit: I think my lack of experience in functional programming is another factor here, however Typescript's object orientated style is very attractive.

Re:The Deno Company by int_19h on Monday March 29, 2021 @09:48PM (#26630509)
WebAssembly holds a lot of promise for sure, but the interface with the outside world still has to go through JS for now for anything non-trivial. I really do hope that this will change soon.
Re:The Deno Company by marcosdumay on Monday March 29, 2021 @10:08AM (#26621776)
For web programming, WebAssembly is still not enough.

It solves the problem of how to run your non-web based code in a browser, but until it can interoperate with the DOM, JS will continue to be mandatory.

Re:The Deno Company by bluejekyll on Monday March 29, 2021 @10:21AM (#26621998)
I think you mean efficiently interoperate with the DOM. There are plenty of abstractions (at least that I’ve worked with in Rust) that allow for dynamic management of the DOM.

For example, see the wasm-bindgen and the generated web-APIs in web-sys: https://docs.rs/web-sys/0.3.49/web_sys/

A nice framework that takes advantage of this is yew: https://yew.rs/docs/en/

Re:The Deno Company by hinkley on Monday March 29, 2021 @09:48AM (#26621479)
What I learned about myself working as a NodeJS developer:

I’m okay writing JavaScript as long as I don’t have to spend all day every day writing it.

Re:The Deno Company by joshmanders on Monday March 29, 2021 @10:31AM (#26622187)
This is an interesting thing to think about.

I was primarily a PHP backend dev for 15 years who only used jQuery to toggle classes on click actions, but decided to try something new and switched to Node in 2015.

Node + ECMAScript 2015 just BLEW my mind and was so fun, that not only am I now primarily a Node dev, but I've excelled extensively in the frontend.

I've never enjoyed building websites or web apps as much as I have in the last 5 years.

Re:The Deno Company by celeritascelery on Monday March 29, 2021 @10:52AM (#26622586)
Touché. I will admit I am resistant to learning JS. Part of this is that it seems like no one actually "likes" to program in it, they just have to because it is so ubiquitous. But I guess that just goes back to the Bjarne Stroustrup quote: "There are two kinds of programming languages: The ones people complain about and the ones nobody uses."
Re:The Deno Company by richeyryan on Monday March 29, 2021 @11:30AM (#26623245)
I like to program in JS. I've written non trivial amounts of code in Java, PHP, Clojure and OCaml. I've written approaching trivial amounts of code in Go and Rust.

JS has warts, undoubtedly so. But I try to approach it like I would Clojure and it makes the experience much better for me. I think JS has the bones of a Lisp if you're willing to look for them. Sure it doesn't have macros or decent conditional expressions or immutability but using something like Ramda gets you some of the way there. And there are proposals for pattern matching and immutable data structures though they are fairly far off.

I think JS is at its worst when people try to code it as poor version of Java or C#. I have a bit of a love hate relationship with Typescript for this reason. Some aspects of its type system are great like being able to make a union out of anything, I wish OCaml had that. But I think denying Javascript's inherent dynamic nature is a mistake.

Overall I've learned to ignore its worst parts and just focus on what made it good from the start, being a weird cousin of Scheme that runs in the browser.

Re:The Deno Company by arcturus17 on Monday March 29, 2021 @11:22AM (#26623083)
> Part of this is that it seems like no one actually "likes" to program in it

JavaScript consistently ranks as one of the most loved languages in Stack Overflow surveys...

I find plenty of counter-examples of this point on HN too - engineers who have worked across many different stacks and rank JS/TS as one of the best dev experiences they've had (there is one such comment in this comment tree)

Anecdotally, I feel as if pre-ES6 a lot of the complaints you read online were from users of the language. Nowadays, it's as if most of the complaints are from people who don't use it.

I think there is something to be said about refusing to learn anything but JS, as knowing different languages can be a boon for an engineer, but I believe it's an excellent tool to have in one's belt nowadays.

Re:The Deno Company by ronyeh on Monday March 29, 2021 @11:00AM (#26622720)
I love it, but I use Typescript, which has a few niceties (e.g., stronger typing) beyond modern JS.
Re:The Deno Company by cdash on Monday March 29, 2021 @12:59PM (#26624787)
For me, Typescript changed everything. I don't enjoy programming in plain old JS but I love Typescript.
Re:The Deno Company by FpUser on Monday March 29, 2021 @11:04AM (#26622792)
I learned JS when it first showed up. Still write backend servers in C++ and JS libraries to interact with those servers from a browser.