HNHacker News
TopNewBestAskShowJobs

vmasto

739 karma · joined July 16, 2013

submissionscomments
vmasto··on When Does a Project Need React?
For front-end development some strong options in different languages are: Elm, TypeScript, Reason, Coffeescript (although Coffeescript usage has fallen dramatically every since the newer versions of JavaScript added a lot of its great features).
vmasto··on An experienced Javascript developer’s account of learning React
I was very intrigued by the title:

Things nobody will tell you about React.js

Immediately had high hopes that someone is going to try and give a well researched, novel critique that maybe can spur out some constructive conversation.

And then, sadly, the author goes on to write exactly what countless other articles have already covered and discussed to the death for years now. "HTML in JS", "JSX is bad", "Redux is complicated", "The tooling is too much". And then here we are again in the front page of HN for some reason.

To me, this is, again, an extremely common case of "trying to learn everything at once".

Still, a couple of points I'd like to try to mention:

JSX: Has been argued about so much it's pretty much useless to try and add anything to this discussion at this point honestly. For whomever likes it, fine, for those who don't, thankfully the JavaScript ecosystem provides with a multitude of alternatives. For new-comers still trying to reason about it, this talk by Pete Hunt is a good start https://www.youtube.com/watch?v=x7cQ3mrcKaY

Redux:

> Anytime I work with redux I need to go back to its documentation because its core concepts are so complicate that my mind struggles retrieving them back puking them out as soon as I stop working with it.

While I agree that working with Redux at scale can be complicated, the core concepts are extremely simple: Async Action -> Action -> Reducer -> Connect data to your components -> Display -> Async Action -> enter an extremely simple data flow paradigm (flux).

(state, action) => state

Redux can get complicated when you add to the mix schemas, normalization, selectors et al. My advice and I can't stress this enough: Don't try and learn everything at once, start with simple core concepts, iterate later, add tiny new pieces when it makes sense. You don't always need Redux anyway.

RE: Redux boilerplate: It's a lot, yes, but that's by design. Redux is simply a tradeoff between boilerplate and repetitive, dead simple management of your complicated state. I'd rather write a few lines of code more if it means I'd avoid having logic bugs or getting confused where my data comes from.

RE: React Router:

[...] the maintainers had the great idea of bumping 3 major versions in 5 months completely not backward compatible to each other

This is simply not true. React Router has had a single major breaking API change in 2 years. RR 2 and 3 where the same thing and 4 has just now been released after 2 years of stability.

RE: Final complaints:

[...] you must use className instead of class to define the DOM css classes

This is an extremely weak point to complain about.

[...] you will need to import in your scripts react-dom and react without never using the last one instance for some wild reason known only by the React team

You only need react-dom once, to the point where you ReactDOM.render your application. You need React because you're using it implicitly with JSX. I'm not on the React team by the way, it's a simple google search: http://stackoverflow.com/questions/38206646/do-we-need-to-im...

[...] you can render functional components just by using js functions but you will need to wrap all your markup always in a wrapper tag to properly allow the Virtual DOM creation

Valid point, although it's a nitpick. In any case, this is going away with the newer version of React's reconciler (Fiber).

[...] its apparent simplicity is hidden behind a whole toolchain you need to configure before you can even writing 1 line of code

create-react-app is great, officially supported, and does everything, is it the fault of the ecosystem that the author is reluctant to try the official CLI?

https://github.com/facebookincubator/create-react-app

vmasto··on JavaScript performance, WebAssembly, and Shared Memory in Microsoft Edge
Unfortunately, I don't think it's fair to call Edge evergreen. Updates to Edge come via OS updates, which can be quite a hassle and many corporate environments might not perform at a regular basis.

This article goes into more depth: https://www.scirra.com/blog/173/just-how-evergreen-is-micros...

vmasto··on Node occasionally gives multiple files/folders the same inode
Or wait until JavaScript gets arbitrary precision ints which is not unreasonably far away I would reckon (less than a year most probably).
vmasto··on Facebook Announces React Fiber, a Rewrite of Its React Framework
Some of the API semantics are changing, e.g. componentWillMount can't be trusted any more (it can fire many times) but they're going to be pretty small.
vmasto··on Facebook Announces React Fiber, a Rewrite of Its React Framework
Or the dedicated website on Fiber's progress.

http://isfiberreadyyet.com/

vmasto··on Data structures and algorithms interview questions and their solutions
The best way sure, not the only or even most popular way though.
vmasto··on Why ML/OCaml are good for writing compilers (1998)
:) Yeah, unfortunately JavaScript can only be improved by educating people not to use the horrible parts (rather than fixing/deprecating them which is not possible). const and let were extremely necessary.
vmasto··on Why ML/OCaml are good for writing compilers (1998)
For anyone interested and isn't aware yet Facebook is developing Reason, a layer over OCaml. I've been fiddling with it for the past couple of weeks and coming from JavaScript I personally found the experience generally enjoyable.

https://facebook.github.io/reason/

vmasto··on Show HN: WP Detective – Show what theme and plugins a WordPress site is using
Interesting.

I'd be interested in the maintenance strategies you have in place (if any).

I assume that for plugins who don't output styles or scripts you use other methods, maybe some HTML output etc, so you've probably hard coded a lot of stuff for some popular plugins.

How have you set your tests and how do you plan on knowing when a certain plugin stops emitting the signature you're checking for? Most probably an E2E test with a local theme containing everything, care to share tech specifics ok this part?

vmasto··on Prettier 1.0
Interesting, thanks Dan.
vmasto··on Replacing ‘that = this’ assignments in JavaScript with Arrow Functions
As long as we are extremely clear of the implications it's a good enough reasoning.

Many people, especially newcomers, believe that just because their code initializes a class only N times it's being instanced exactly N times. This is false more often than not, especially in server environments.

vmasto··on New Study Challenges a Genetic Link to Stress, Depression
Isn't this true for pretty much anyone that hasn't actually experienced it?

It's not like you can describe it exactly, I've seen a lot of "the most accurate description of depression"s that really hit home, but there's no way to make someone understand what it's actually like.

vmasto··on Prettier 1.0
I recall the React team were discussing at what part of the build step they should include Prettier.

I believe there was an idea of adding it as a pre-commit hook, a second one as a manual step and another one as a post-commit amend.

Have we reached a consensus on that? Not up to date what they went with, what seems to be the best way to do this?

vmasto··on How We Built r/Place
> Users can place one tile every 5 minutes, so we must support an average update rate of 100,000 tiles per 5 minutes (333 updates/s).

It only takes a couple of outliers to bring everything down. I'm not exactly well-versed in defining specs for large scale backend apps (not a back-end engineer) but it seems to me that preparing for the average would not be a wise decision?

For example, designing with an average of a million requests per day in mind would probably fail, since you get most of that traffic during daytime and far more less at the nightly hours.

Could anyone more experienced shed some light?

vmasto··on Chrome 59 has cross-platform headless support
I've been trying to test audio and video with headless browsers (namely PhantomJS) but have experienced extreme difficulty, I wonder if headless Chrome is able to support/supports already HTMLAudioElement or HTMLVideoElement or any media interface that would make, for example, testing YouTube or SoundCloud embeds easier.
vmasto··on TypeScript at Slack
I have to ask the obvious, Flow vs TypeScript. I'm sure as React users you took your time weighing the two; care to comment on what drove your final decision?
vmasto··on TypeScript at Slack
Although I don't use TypeScript (I'm looking at Flow more and more recently instead) I have to acknowledge Microsoft's huge contribution to the JS scene (and not only) with TS and VSCode, truly exceptional products.

What's more interesting to me is that everyone who converts their code into Flow or TS immediately finds at least N bugs (albeit small).

It's also quite amusing that this article came out today where HN's top article for a few hours was a bashing against Electron (and Slack specifically).

vmasto··on Electron is flash for the desktop (2016)
I'm not saying it doesn't, it's built on Chromium Embedded Framework.

The author is claiming it's built on Electron, which is false.

vmasto··on Electron is flash for the desktop (2016)
I'll give it a go to call you on "bullshit": Spotify is not built on Electron. (Surprise, the author is wrong).

It is and was, however, always built on Chromium Embedded Framework (the UI), even when you say it "was" fast.

vmasto··on Electron is flash for the desktop (2016)
> I wanted to pick on Spotify and Atom more in my blog post, but both Spotify and Atom have cleaned up their act

Can you please share how you came to the conclusion that Spotify is made with Electron? (hint: it's not)

vmasto··on Why Is the Pentagon a Pentagon?
I was under the impression that the pentagons would be 12, care to elaborate how it's only one?

e.g. http://math.stackexchange.com/questions/2121175/is-it-possib...

vmasto··on Moving from Node.js to ASP.NET Core
That statement is highly uninformed.

I would suggest starting reading from here https://github.com/WebAssembly/design/blob/master/FAQ.md#is-...

vmasto··on Moving from Node.js to ASP.NET Core
I find it extremely telling that both of the issues you linked are now included in the core language library, and what happened with left-pad will never happen again after amends were made by npm to make sure that it indeed never does.

If you want to critize JavaScript you can do better with something more substantial. If anything, the speed at which problems you linked get remedied is a plus for the language. Even more so if you take into account the extremely unique position JavaScript is in where you can simply never change an API after it goes public.

> The fact that there are so many abstractions that compile/transpile into javascript is also a big red flag

What did you expect? JavaScript is the only language browsers natively understand. If you want to write code in your favorite programming language you will have to transpile/compile it to JS.

vmasto··on Moving from Node.js to ASP.NET Core
Thankfully Yarn is here to solve most (if not all) of these problems.
vmasto··on 0.30000000000000004
As a (kind of) related matter, thought it'd be interesting to mention JavaScript is most likely getting arbitrary precision ints soon https://github.com/tc39/proposal-integer
vmasto··on SES-10 Mission
I got extremely worried as well and it wouldn't have made a difference looking at the altimeter because I have no idea about how rocket engines behave.
vmasto··on Apple Releases MacOS 10.12.4 with Night Shift
That's very weird, does anyone have any insight about this decision on a technical level?
vmasto··on An iOS dev's experience with React Native
> The promise is simple and compelling: write once, ship twice. iOS and Android all in one shot

While this is certainly feasible (largely depending on the requirements of your app), it is important to clarify that RN never promised "write once ship twice".

RN's promise is "learn once, write anywhere", meaning that the technology and mental model is what transcends platforms, not the codebase itself.

Just wanted to make this clear so as to avoid any possible frustration for newcomers after the fact.

vmasto··on Stack Overflow Developer Survey Results 2017
Note that this data excludes the vast majority of Chinese software engineers (they represent just 0.4666% of the total survey responders)
← PreviousPage 3 of 6Next →