Live data from Hacker News

The State of JavaScript – Survey results

stateofjs.com

321–330 of 357 posts

Re: The State of JavaScript – Survey results

#321
post #306

Earlier quoted context omitted.

That is mutable state. Your Redux store is a mutable state container. If your redux store returns a {a:1,b:2}, and then you dispatch an action and it now returns an {a:2,b:1}, then you have mutated your state . It doesn't matter at all if the store's data structures are mutated in place or replaced with a modified immutable updated copy of a previous state, you still have mutable state .

I think I see where you're coming from, but I also think you might be moving the target a bit. I suspect you'd garner less debate if you said, I dunno, just "a dynamic UI app needs a way to model state changes ". "Mutate" has a specific meaning, in my mind at least, when discussing variables and data structures. React enables avoidance of direct DOM manipulation, Redux obviates direct state mutation.

Also, "finite state machine" has a very specific meaning, and that isn't just any machine that has a finite bunch of variables that you call state.

If React lets you execute arbitrary JavaScript code (which it does), then you're no longer using just a finite state machine, you're using a Turing machine, which is something different, and more powerful. It may have many finite state machines embedded in it, but to refer to a user interface as a finite state machine is like referring to a car as a pulley, just because the engine requires several pulleys to work, and ignoring all the rest of the engine and car. You can't make a car out of just pulleys, and you can't make a user interface out of just finite state machines.

Re: The State of JavaScript – Survey results

#322

Some interesting things on the "Front End Frameworks" page: * 53% of the respondents used React, and would do so again. * 47% use "No framework", and would do so again. (hmm. that doesn't leave much room, unless you can use more than one tool depending on the situation) * 43% had "no interest" in Angular 2. One other thing to consider, of the "had used X, would/would-not use again" responses: there is of course a lot…

The way I read it is that each question is independent. So I can say I've used Angular and would never use it again while also saying I've used React and would use it again. This is really a pretty decisively positive stat for React. Very few of its users would never use it again, while a lot of people have tried Angular and abandoned it. (This certainly matches my experience and anecdotes I've heard in the community…

I know. I was joking about a coincidence, as well as pointing out some of the largest response groups. The "tried X and would do it again" add up to over 100%, so some people had more than one tool for favored for different situations (or at least tolerated employer specified selections)

That said, it looks like React is doing well, and I bet on the wrong horse :-(

Re: The State of JavaScript – Survey results

#323

As someone who doesn't work incredibly often with Javascript but has dabbled with MEAN and extensions of MEAN, I found one of the last questions a bit biased in its results: "I would like JavaScript to be my main programming language" (Rate 1 to 5) 49% (5) 35% (4-3) 16% - (2-1) If you've taken this survey, it means that you have done at least a decent amount of work with Javascript. Chances are, you have at least enj…

It would be interesting if they'd also asked "How many other programming languages do you know besides JavaScript?"

And compared how many people want JavaScript to be their main programming language because they only know one programming language and don't want to learn another, with how many people know multiple programming languages and would rather program in JavaScript as their main language because they like JavaScript better.

Re: The State of JavaScript – Survey results

#324
post #288
post #224

Earlier quoted context omitted.

Why do you say that's the right way? Is there something intrinsically better about having the state modelled as a stream of changes? Is that really getting rid of mutable state? [EventA, EventB] is a mutation of [EventA], sure it's a WAL style, but the combined final state is a mutated version of the original state. Presumably the concrete state model (like MobX) is a realisation of the event stream at a moment in ti…

Mutable state is fundamentally harder to reason about. You get aliasing bugs, stale cached values, etc. With immutable data in an append-only stream this is simply impossible.

I've done plenty of work with immutable data, and I tend to code in a way that minimizes the amount of state I have to manage.

I guess that's what I was saying about mobx though - I can have a much smaller set of core data and then pure functions for the layers of derived data. And it's a) easy to reason about and b) super performant at managing the calculations.

Aliasing bugs don't really apply in JS, unless there's some variation of the term? Stale caching is also not an issue with calculated derived data.

Re: The State of JavaScript – Survey results

#325
post #110

Earlier quoted context omitted.

Excellent! someone in this world has their head screwed on right! (you're getting downvoted unfairly I think, probably a bit politically incorrect in this neighbourhood).

I don't care about downvotes, I thought that video was hilarious and enjoy sharing it. He's the same guy behind "MongoDB is web scale" and "Erlang the Movie II", which I'd also highly recommend: http://www.mongodb-is-web-scale.com/ https://www.youtube.com/watch?v=rRbY3TMUcgQ

Love me some Erlang, er, "OTP".

I'm pretty sure the video would violate the "code of conduct" at our local JS user group, though.

Re: The State of JavaScript – Survey results

#326

It's really unfortunate that so many people aren't interested in learning Ember. I just started an internal IT tool in Rails and Ember and I'm really enjoying the simplicity of it. I want something that is easy to understand, easy to setup, and won't change for a while. I became more interested in Ember when I read something online about how they are focusing on stability in the long term instead of a bunch of featur…

> I just started an internal IT tool ... I think a lot of your ease of use comes from it being an internal IT tool. It's allowed to be clunky, you probably don't have many eyes from marketing/design/product on it-- and if they have seen it, they don't care too much. Design & product want to be able to do some crazy stuff sometimes. And they're justified in that wish, our frameworks should work with anything that is p…

> "It's allowed to be clunky"

> "that I think you'd have a really bad time if this app was consumer/client-facing"

Gee, thanks.

Now, ignoring the fact that you're immensely disrespectful, you're missing the point of what I'm trying to say. There is nothing wrong with having a small problem that is solved by a simple solution and I'm sharing how I'm solving my problem. I'm not going to choose an engineering solution that's more complex than what I need.

That being said... there are a decent amount of companies that have used Ember to build easy to use and fluid interfaces. I think the very first interface I saw built using Ember was the interface for the Riak data store - which is incredibly slick. Netflix uses it for internal services, Groupon uses it for its website, and so does LinkedIn and Heroku. Actually, technically speaking, Google uses it as well because of their acquisition of Nest - unless they rewrote the Nest store into Angular or something.

If I thought that rendering searchable tables and embedding graphs was more than Ember could handle and would result in a sluggish application then I wouldn't use it regardless of how easy it is to setup. If I thought that it wouldn't allow me to apply basic CSS and buttons and layout principles to my interface so that it's pleasant to use then I wouldn't have used Ember.

And if you think that you can deliver a better web dashboard than what's facing the users of Heroku then I suggest you knock on their door and tell them how to do so.

Re: The State of JavaScript – Survey results

#327
post #187

Earlier quoted context omitted.

I'm unconvinced by this argument. State machines don't let you change things whenever you feel like it. There are a set number of states and a bunch of predefined transitions between them. That structure is exactly what redux forces you to implement - whereas in MobX it's up to you to apply the same constraints. Redux with plain JS objects a a little messy IMO, because there aren't lots of nice & readable ways to tra…

I made a poc with Redux and I felt that a) the boilerplate obscured my code b) the async story was pretty confusing and c) managing my derived / calculated properties was really hard. One thing I've discovered is that a lot of the logic is derived data in the form of pure functions. A huge amount of my codebase seems to be about managing the derived state that trigger from a core bit of state changing. Really there's…

https://github.com/redux-observable/redux-observable addresses your point b) and your point c) somewhat.

Re: The State of JavaScript – Survey results

#328

Earlier quoted context omitted.

> I just started an internal IT tool ... I think a lot of your ease of use comes from it being an internal IT tool. It's allowed to be clunky, you probably don't have many eyes from marketing/design/product on it-- and if they have seen it, they don't care too much. Design & product want to be able to do some crazy stuff sometimes. And they're justified in that wish, our frameworks should work with anything that is p…

> "It's allowed to be clunky" > "that I think you'd have a really bad time if this app was consumer/client-facing" Gee, thanks. Now, ignoring the fact that you're immensely disrespectful, you're missing the point of what I'm trying to say. There is nothing wrong with having a small problem that is solved by a simple solution and I'm sharing how I'm solving my problem. I'm not going to choose an engineering solution t…

Ahhh, sorry, I wasn't meaning to be disrespectful, I just felt like it was an important point to shed light on.

I was listening to Joe Rogan's interview of Adam Greenfield (a bowhunter) yesterday, and Adam said something like: "look, if you're looking to get into bowhunting but you don't have the cash to get the best equipment, that's fine. You can still have success with a cheaper bow and without the extra gadgets, but it'll take more time." I'm not saying that you can't build world-class products with Ember, I'm just saying that it probably takes more time if you're getting wrenches thrown at you from design & product.

I also really haven't spent enough time with Ember to really back up my last statement, I'm really just trying to give some perspective from a company-politics / organization-process POV?

Re: The State of JavaScript – Survey results

#329

According to the survey, 213 people that took it have never head of plain javascript.

PlainJS -- the hot new javascript dialect that transpiles Javascript 1.1 to ES6 so that your coworkers don't have to know that you don't know how the fuck Array.each works.

Re: The State of JavaScript – Survey results

#330
post #289

Earlier quoted context omitted.

A "C-like language" is a very dubious compliment. Fortunately, JS is built around a different core. Unfortunately, it's built as haphazardly as C has been.

What I mean is that its syntax is classical. Its constructs will be very familiar to those who have taken basic education in modern programming. As far as your 'different core' argument I'm not too sure what you mean. If you're a Node dev, then JS is just your means of calling OS routines and giving work to threads (in C under the hood, to be sure). If you're a front end person, then JS is a very high level layer aga…

I'm pretty sure the "core" reference refers to the "FP with OOP" core based on Scheme and Self, which is one of the best things about the (JS) language.

Alas, "The Management" demanded that it be dressed up to look like Java (and thus like C++). This led to a bunch of people that were unhappy that Javascript was in fact NOT like Java when they tried to use it like Java.

It's a very nice dynamic FP language, but people keep wanting to do static OOP with it :-(

Post reply on HN