Live data from Hacker News

You probably don't need a JavaScript framework

slack-files.com

181–190 of 356 posts

Re: You probably don't need a JavaScript framework

#181
post #5

I don't use React for speed. I use it because manipulating the DOM to make it reflect the application state is hard . It's something a program should do for me. React is that program.

I don't get a lot of opportunities to play around with JS frameworks, which is odd because I hobby-code a lot in JS. I imagine the top reasons to use frameworks are cross-browser compatibility and support for scalability in the domain of your work. Unfortunately sometimes people use them because the only tool they have is a hammer, so everything is a nail. Vanilla DOM manipulation has become much easier in the past few years. I have played around with some new DOM features in my own time, but for anything public-facing I'm going to use a library that allows for cross-browser compatibility, and typically that's a combination of jQuery, polyfills, etc.

Re: You probably don't need a JavaScript framework

#182
post #72

Earlier quoted context omitted.

Do Google even really use angular? I know none of their core products use it. As to Facebook, their website is painfully slow, seems like it's not a model of the right way to do stuff

I don't think their main website uses React fully yet. Instagram does and that's pretty fast—same as most other well-done React apps.

Facebook.com contains more than 20,000 react components. They use React at pretty much every dynamic aspect on their website. They also use React Native in a lot of aspects of their mobile apps, both for iOS and android.

Re: You probably don't need a JavaScript framework

#183
post #91

One thing many people underestimate is how easy it is to run into XSS, XSRF, XSSI when not using a framework, in particular XSS when using native DOM APIs ("location.href = ..." - pwned. "e.innerHTML = ..." - pwned. "a.href = ..." - pwned. "*.src = ..." - pwned.). You might not need a framework, but you'll need a structured approach to avoid those problems, and frameworks can help a lot with security.

Unless your framework bridges the backend and frontend you're not going to just magically get rid of XSS vectors. Also regardless of what framework you are using you still have access to location.href, e.innerHTML, etc. I'm not really sure what you're trying to convey here but it's lost on me because, framework or not, all of these things still exist. Hell angular simply wraps location as do some other frameworks.

I thought his point was clear. A framework provides all those things, free of charge. Instead of using location.href or e.innerHTML you're invited to use framework.html(), etc. It's possible you would take care of escaping output on your own, but the point he was trying to convey is that you are likely to take shortcuts and not do all those things.

Re: You probably don't need a JavaScript framework

#184
post #43

I still remember doing a PoC for an end-to-end secure messaging app with web support, around 3 years back. It was written in plain JS with jquery and one or two libs for crypto bolted on. Simple, easy, but not very maintenance friendly written. Took around 2000 lines all in all. One of four clients (Android, iOS and a bot framework in Scala/Java). Then the web-boys came in to rewrite my... well, contraption. In came…

Thanks a lot for your comment, after all I'm not crazy at all, I wish find more people like you

Re: You probably don't need a JavaScript framework

#185

Earlier quoted context omitted.

(gjolund: I can't reply to you directly, but consider this my reply) Because they're simple? They're relatively standard? They're compact? Because I don't have to learn a new god-damned framework for every single new assignment? When did software development become a paint-by-numbers exercise? There is a difference between spaghetti-code and engineering. Why do you want to write all that extra code instead of just pi…

It's a lot easier to learn React than what all of you think. It's especially easier to learn these frameworks when you tried to solve the problem without them and experienced the pain of not having them.

As a user of React, I disagree -- unless you are using React in a javascript runtime, in which case you're probably fine. But I resent react for all the extra cognitive load it forces me to worry about when all I really give a shit about is its shadow DOM implementation. And then, only when I've got page(s) full of data I need to update without lag.

Re: You probably don't need a JavaScript framework

#186

Earlier quoted context omitted.

What? Seriously? If you can't imagine trying to build these things, why on earth should you be trusted to use these things built by others? All of your comments in this thread are so unnecessarily abrasive. And you just continue to give off an unfounded and indefensible air of smug superiority, when what you're really falling back on is ... the ability to run a command that puts you in a padded room so you don't hurt…

> I can't imagine trying to build a ... and more, in less code that just ...

The other half of that "less code that[sic] just" is no code at all, and a reliance on a pkg manager command. It's a useless comparison, and wasn't at all lost on me.

Re: You probably don't need a JavaScript framework

#188
post #128

Earlier quoted context omitted.

'simple people' as opposed to? I think people are coming down really hard on the article, and I found it to be light-hearted, and simply asking people to revisit where we're at. He doesn't call for anybody to stop using their frameworks. I am studying Erlang/LFE. I chose LFE over Elixir (I know it is not a framework), since I like Lisp rather than the Ruby-like syntax of Elixir, and because one of the creators of Erl…

Nobody brings in a framework out of hope that it will lead to them getting a job at said sponsors company. If they do they are very very misled. People choose a framework because they want to benefit from the R&D done at said company, and avoid sinking similar R&D costs into their product. I don't find happiness when my neighbors "cow dies" (I like that metaphor), but it does pay the bills, and that makes me happy. I…

I was kinda with you until you nitpicked his/her use of paragraphs. You sound like a Rock Star Programmer? Take the night off, go out, have some fun?

You made you point. I don't like all these continually changing frameworks either, but I am not a good Programmer.

I actually wish their was a site that voted for for the best frameworks, but instead of a popularity contest; the judges would be a mix of the best programmers. Programmers with no adgenda, other than giving their honest unbiased opinions. Maybe throw in students who are in the middle of learning how to program?

Actually, some of the best advice, I have gotten, has been from students just learning to program. Specifically the students in Bootcamps. I use to follow this one guy in SF, and he saved me a lot of time in my journey.

Re: You probably don't need a JavaScript framework

#189
post #183

Earlier quoted context omitted.

Unless your framework bridges the backend and frontend you're not going to just magically get rid of XSS vectors. Also regardless of what framework you are using you still have access to location.href, e.innerHTML, etc. I'm not really sure what you're trying to convey here but it's lost on me because, framework or not, all of these things still exist. Hell angular simply wraps location as do some other frameworks.

I thought his point was clear. A framework provides all those things, free of charge. Instead of using location.href or e.innerHTML you're invited to use framework.html(), etc. It's possible you would take care of escaping output on your own, but the point he was trying to convey is that you are likely to take shortcuts and not do all those things.

framework.html() would presumably have the same problems as e.innerHTML (as you're probably aware). The examples that come to mind are replacing something like...

  e.innerHTML = "" + value + ""
with:

  d3.select(e).append("td").attr("class", type).text(value)
or:

  $(e).append("").addClass(type).text(value)

Re: You probably don't need a JavaScript framework

#190

Ok, we don't need frameworks, however what should we use in order to build complex UI applications? Own solutions? And know imagine that in every project you build your own skeleton and architecture...

I think the point is for complex UI applications (or a team with interchangeable members) you would use a framework. But for less complex applications you might very well not.

Enjoyed this article. I like JavaScript, I use it almost daily, I'd like to learn React or Angular but just haven't had the real need. For the amount of JavaScript in the apps I build there just doesn't seem to be the payoff. I did venture into npm. What a nightmare of goop and time wasting. Although there were some cool utilities the amount of time setting up and dealing with in most cases didn't really pay out.

Don't manipulate the DOM. Why not? Works fine for what I do. Maintainability. Maybe. But well organized code is well organized. If there were a lot more of it this probably becomes a valid point but JS doesn't do everything in my apps. It does the things JS was originally designed to do.

I figure when the dust settles I'll probably dive into a framework. But right now stored database procedures, database triggers, a light Flask/Bottle layer and judicious use of well organized jQuery/ native JS works really well and doesn't have a bunch of unneeded parts.

Then again I'm still using Slackware. I like things simple. The less abstraction and "helpfulness" between me and what I'm trying to get done the better. Simple, powerful, modifiable tools without a lot of glitz and overhead are my preference. I mistrust black boxes and complexity. Maybe React is the kind of tool that could be useful... don't know. Might look into at some point when I feel it's reached puberty.

Post reply on HN