r/programming • • Oct 03 '16

How it feels to learn Javascript in 2016 [x-post from /r/javascript]

https://medium.com/@jjperezaguinaga/how-it-feels-to-learn-javascript-in-2016-d3a717dd577f#.758uh588b
3.5k Upvotes

852 comments sorted by

View all comments

106

u/[deleted] Oct 03 '16

Yeah, think I'll just stick to jQuery. At least I can count on all the new guys knowing it.

31

u/Danish_Canary Oct 03 '16

I'm with you. Why overcomplicate things?

12

u/FarkCookies Oct 04 '16

Because things actually get rather complex with jQuery fast. Imagine a form with checkbox and a field that should be shown only when checkbox is checked. You need:

  1. OnChange handler for checkbox.

  2. Check condition.

  3. Get element.

  4. Change visibility.

It is pure presentational logic and it get's mixed up with everything else. Things get messy immediately. So yeah no, thanks. React have been a blessing for me, yes it requires certain initial investment but I believe it pays out very quickly.

4

u/Forbizzle Oct 04 '16

How is it "mixed up with everything else". You're in the presentation layer.

This only gets complicated by people building "applications" on the front end, and failing to architect them in a way that prevents bleed between view and control.

5

u/FarkCookies Oct 04 '16

With jQuery you need to explicitly modify dom all the time to make sure your view reflects your model. Data binding or react's approach eliminate this need.

→ More replies (2)

39

u/i_spot_ads Oct 03 '16

because i work on huuuuuge complex projects where jquery is not enough. now that i think of it, if i didn't use angularjs for the last project we worked on (1.5 years of dev), the development time would've been multiplied by 4 at least

24

u/salbris Oct 04 '16

In my experience this is a smell that your front-end probably has too much logic that should actually be in the server somewhere.

70

u/yawkat Oct 04 '16

That's essential if you want your app to behave like an application, not a website with some links on it.

16

u/wishthane Oct 04 '16

100%. There are websites and then there are web applications. If you're just building a website, you don't need any of these tools, although some of them can help. If you're building an application, particularly one that needs to or wants to be mostly on the client side (for user experience reasons, for example) it gets super messy if you don't have some frameworks and patterns in place.

2

u/kwirky88 Oct 04 '16

I work primarily on an enterprise saas product and being in the enterprise world we can't really put the business logic in JavaScript. Having the acl on an entirely different stack from the front-end would introduce too much complexity. We don't want business logic client side when millions of dollars are being shuttled around hourly.

→ More replies (1)
→ More replies (9)

21

u/i_spot_ads Oct 04 '16 edited Oct 04 '16

Nope, you don't know what the project was, it wasn't a website, it was an app, backend was only used to store data.

35

u/[deleted] Oct 04 '16 edited Oct 04 '16

Get with the program, man: the point of the thread is for people who know nothing about front end development to shit on both the devs and the libraries, not to have a sensible conversation about what actually works for what.

16

u/basilect Oct 04 '16

"Why is this area that's undergoing huge amounts of innovation so unstable? It must be hipsters."

14

u/Marzhall Oct 04 '16

huge amounts of innovation

The thing is, the innovation is all reinvention of things we currently do as native application developers. Typed programming? Linting? Packaging? It's not innovation, it's reimplementation. It's just weird to try and jump into it from native application development without seeing that toolchain present already, and then seeing a million different frameworks all trying to implement that toolchain for you, with a hundred opinionated people telling you which ones you should use, and every tutorial and stackoverflow question not answering your question, but telling you to use a new framework instead that ends up having its own problems. As someone trying to enter the discipline from outside, it truly can be a harrowing experience.

3

u/i_spot_ads Oct 04 '16

Native is native, you have to code for very platfrom, which takes time and a lot of money, go try to support one app for three different platforms with limited resources, i wanna see how fast you'll have to give up. Web apps work everywhere with same code base and (rarely) minimal platform specific modifications

2

u/Marzhall Oct 04 '16 edited Oct 04 '16

A portable application doesn't need to be native binaries, as proven by the browser itself, java, .Net, and any other code run on a platform, vm, or interpereter. None of those benefits you mention inherently necessitate using the browser as a platform, it's simply the platform we chose to do it on. In a parallel world, you can have a platform that is a vm (think the jvm or .Net's clr) running on top of your OS as your main app platform, and that can call into machine-native binaries you cross-compile and package along with your app if you need to do fancy things the vm can't, such as some intense game programming. The browser itself is just the way we've gone about creating the platform, but it doesn't need to be the platform.

We based our entire network application infrastructure on something meant to display static text, then spent 20 years fitfully extending it into a platform for applications, instead of just writing a platform for networked applications that was easy to extend with native binaries if need be.

→ More replies (0)

9

u/[deleted] Oct 04 '16

"I don't understand this, therefore it's completely devoid of value"

7

u/Marzhall Oct 04 '16 edited Oct 04 '16

shit on both the devs and the libraries

As a person who's admittedly sort of scorned web development, my general issue is that it seems like a massive kludge of different things that are trying to solve an issue we solved 40 years ago: developing and running applications on computers.

Typed languages, linting tools, packaging tools, etc. - these have all existed for a long, long time. It's weird to see people reinventing application development for a platform - the browser - when we already have a platform that runs applications - the OS. I'm basically watching people reimplement operating systems and their toolchains to run on something that was originally just meant to display static text. To me, it looks like 20-odd years of scope creep.

Web applications have shown that we can quickly download and run applications from remote computers. Operating systems have shown that we can have typed, compiled applications that target an individual machine to use its full capabilities. Why can't we just treat the OS as the platform for both tasks? Why do we need to build a whole new OS on top of the old one just to download and run applications? It seems back-asswards to me.

An OS that implemented an OS-level sandbox (think containerization, like docker) would allow for all of the finagling that is 'forcing the browser to act like an OS' to go away. You could download applications and run them (like you do now with the browser and JS) without needing the browser and JS, and you could even include your own self-written binaries that do things the browser can't currently do - because you're just running an application. You won't need 8 years for the browser community as a whole to decide on the new version of HTML with the features you need and for browsers to implement that new version.

I understand that a lot of these platforms and tools made fun of in the article have legitimate uses, it's just weird because so many of their legitimate uses are things we've been doing for so long and can already do. It feels like I'm watching people build a house on top of a house and saying "why don't we just live in the first one?"

2

u/notfromkentohio Oct 04 '16

Why by that much?

0

u/[deleted] Oct 04 '16

[deleted]

11

u/DerJawsh Oct 04 '16

I feel like this is a referential gag based on the post...

→ More replies (1)
→ More replies (1)

14

u/[deleted] Oct 03 '16

Why not use Vanilla.js?

41

u/[deleted] Oct 03 '16

Because it's current year.

2

u/VikesOf98 Jan 06 '17

If you had said "it's 2016", I would have been utterly confused today. Thanks for your futureproof comment!

→ More replies (1)

2

u/Urik88 Oct 03 '16

Well, depends on the project. This guy wants to display a table but if he wanted something more, I'd argue that overcomplicating things would be sticking with jQuery.

→ More replies (2)