Live data from Hacker News

How it feels to learn JavaScript in 2017

medium.com

21–30 of 167 posts

Re: How it feels to learn JavaScript in 2017

#21
post #17

We have recently implemented Angular4 in our project, and have started to pick it up. Recently picked up a story that was adding a simple confirmation modal to a page: "Alert" text in the top, body with some warning text, and a yes/no button. This was my first experience with modern JavaScript frameworks and TypeScript. I wanted to do it right, so worked closely with team members who were more versed in this stuff, a…

Yeah something's not right. A modal is a line of code, not 27 files. The most extensible modal could be a single file component. Just starting fresh, what is a modal? It's a widget (we could use a div) which when activated is moved to the front of the z axis and steals focus. CSS can do that. Now all you need it do is keep attributes regarding the text of the modal and state representing whether it's activated (we ca…

I agree with the GP with regard to Angular4. But have you really tried to create a modal in HTML/CSS/JS without any framework?

It's surely not one line of code!

Re: How it feels to learn JavaScript in 2017

#22
post #17

We have recently implemented Angular4 in our project, and have started to pick it up. Recently picked up a story that was adding a simple confirmation modal to a page: "Alert" text in the top, body with some warning text, and a yes/no button. This was my first experience with modern JavaScript frameworks and TypeScript. I wanted to do it right, so worked closely with team members who were more versed in this stuff, a…

> This seems ludicrous to me.

Why?

UI is hard dude. UI on the web is especially hard because the technology has been growing progressively for over two decades.

Re: How it feels to learn JavaScript in 2017

#23

Earlier quoted context omitted.

Yeah something's not right. A modal is a line of code, not 27 files. The most extensible modal could be a single file component. Just starting fresh, what is a modal? It's a widget (we could use a div) which when activated is moved to the front of the z axis and steals focus. CSS can do that. Now all you need it do is keep attributes regarding the text of the modal and state representing whether it's activated (we ca…

I agree with the GP with regard to Angular4. But have you really tried to create a modal in HTML/CSS/JS without any framework? It's surely not one line of code!

OK, so it's a dozen.

https://stackoverflow.com/questions/25920941/how-do-i-overla...

Didn't say not to use a framework. Use it and some CSS and that's a basic task, not to mention there are other libraries which do it for you already.

Re: How it feels to learn JavaScript in 2017

#24
post #17

We have recently implemented Angular4 in our project, and have started to pick it up. Recently picked up a story that was adding a simple confirmation modal to a page: "Alert" text in the top, body with some warning text, and a yes/no button. This was my first experience with modern JavaScript frameworks and TypeScript. I wanted to do it right, so worked closely with team members who were more versed in this stuff, a…

> This seems ludicrous to me. Why? UI is hard dude. UI on the web is especially hard because the technology has been growing progressively for over two decades.

Agree. More importantly, I see this nasty trend where people bag on jQuery code just because it's jQuery code.

I've seen devs complain about how coupled some small jQuery one-liner is and then replace it with some muli-hundred line monstrosity of a module that's buggy, incredibly hard to understand and impossible to actually reuse...then when you call them out on it, they just say "fuck you, we're writing ES6 now".

The code they replaced was simple, just worked and didn't have side-effects. And they're still using jQuery elsewhere in their project anyway...

Re: How it feels to learn JavaScript in 2017

#25
post #17

We have recently implemented Angular4 in our project, and have started to pick it up. Recently picked up a story that was adding a simple confirmation modal to a page: "Alert" text in the top, body with some warning text, and a yes/no button. This was my first experience with modern JavaScript frameworks and TypeScript. I wanted to do it right, so worked closely with team members who were more versed in this stuff, a…

> This seems ludicrous to me. Why? UI is hard dude. UI on the web is especially hard because the technology has been growing progressively for over two decades.

UI is hard dude.

It's been a solved (and re-solved) problem for decades.

Re: How it feels to learn JavaScript in 2017

#26

Earlier quoted context omitted.

> This seems ludicrous to me. Why? UI is hard dude. UI on the web is especially hard because the technology has been growing progressively for over two decades.

UI is hard dude. It's been a solved (and re-solved) problem for decades.

There's been a pervasive meme that JavaScript is terrible jQuery is a spaghetti factory. Which is it?

Re: How it feels to learn JavaScript in 2017

#27
post #17

We have recently implemented Angular4 in our project, and have started to pick it up. Recently picked up a story that was adding a simple confirmation modal to a page: "Alert" text in the top, body with some warning text, and a yes/no button. This was my first experience with modern JavaScript frameworks and TypeScript. I wanted to do it right, so worked closely with team members who were more versed in this stuff, a…

> Recently picked up a story that was adding a simple confirmation modal to a page: "Alert" text in the top, body with some warning text, and a yes/no button.

> By the time all was said and done the PR for this thing had 27 files in it.

Can you not just use a library for this and do it in a few lines...? I found Angular 2 verbose but I don't see how the above is common. I just did something similar in Vue today and it was about 4 lines to load the library and call it. You shouldn't be implementing modals yourself if you can avoid it.

Re: How it feels to learn JavaScript in 2017

#28
post #20
post #16

"I have to confess, the build setup is the most intimidating part of modern web development for me." Here here.

I feel sorry for the generation who didn't experienced the "drop file on ftp client, it's on the internet" experience. No setup, no build tools ...

I feel worse for the me of eight years ago maintaining an SPA codebase where everything was thrown on window with dozens of global stylesheets.

Re: How it feels to learn JavaScript in 2017

#29
It can be a pain getting the build system up and running but once you're writing typed JavaScript code with modern features like async/wait and ES6 modules along with live + hot reloading, it's impossible to go back. It's really trendy to complain about JavaScript changing too fast right now but the last few years have brought some great changes to JavaScript.

Re: How it feels to learn JavaScript in 2017

#30
post #26

Earlier quoted context omitted.

UI is hard dude. It's been a solved (and re-solved) problem for decades.

There's been a pervasive meme that JavaScript is terrible jQuery is a spaghetti factory. Which is it?

With the way callbacks work in Javascript and jQuery, you lose some flexibility in organizing your code. It is true the types in Javascript make it difficult to build large projects. These drawbacks can be overcome, of course, but this is all orthogonal to the main point......

If Javascript and jQuery truly are bad (though I would claim they are not, they are mediocre but workable), it's because their creators didn't know history, not because the problem is unsolvable.

Post reply on HN