HNHacker News
TopNewBestAskShowJobs

mambodog

4,836 karma · joined February 6, 2010

submissionscomments
mambodog··on Yarn – A new package manager for JavaScript
I can't speak for either project, but personally I would say that I don't think static typing in JS is a solved problem, and at this stage to me it seems a monoculture would be much less fruitful than a competition of ideas.
mambodog··on Yarn – A new package manager for JavaScript
> Flow, introduced 3 months after TypeScript

Do you think Flow was built in 3 months as a reaction to Typescript? Not that it was a big enough problem that two different groups of people independently decided to try to solve it? EDIT: disregard this, Flow was introduced much longer than 3 months after TypeScript. The blog post introducing Flow mentions TypeScript, and is probably worth reading for background [1]

> Nuclide instead of Atom/Sublime/VSCode

Nuclide is an Atom plugin.

> Jest instead of Jasmine/Mocha

Jest provides a superset of Jasmine functionality, and uses Jasmine as its test runner.

[1] https://code.facebook.com/posts/1505962329687926/flow-a-new-...

mambodog··on Yarn – A new package manager for JavaScript
Basically I think it comes down to:

1. In the browser we have less control over the environment the code runs in, requiring tooling to achieve a stable, normalised environment which we can improve at our own pace, rather than the rate at which browsers are updated.

2. JS has become very widely used very quickly, which means that there have been lots of hastily built things, which have been replaced by better things (and for every 'better thing' there are many alternatives which fell by the wayside), and a larger pool of people to build them.

3. It's easier than ever to build new tools (or any kind of app, for that matter), because the npm ecosystem makes it trivial to combine existing smaller pieces of code into new combinations.

mambodog··on Why Learning Angular 2 Was Excruciating
> I'd like to point out that React has had breaking changes roughly 6 or less months apart

When? Can you cite an example? Keep in mind that for most breaking changes React typically goes to a deprecation warning for the duration of a major release instead of hard-breaking changes, so in reality you have roughly double the time between truly breaking releases, generally speaking.

mambodog··on Show HN: Build your first real world React.js application
Facebook still uses Flux, and it was created specifically for large applications. The thing which is missing from this example is some kind of namespacing. In a large application, you should be naming your action types in such a way that it is not confusing which application feature they relate to, eg. if you had domain logic relating to something called 'UserProfile', you might have an action like `USER_PROFILES/UPDATE_PHOTO`. Combined with sensible project layout and file naming (eg. by domain) this should make it easy to track down code relating to a particular action. It also makes for excellent 'greppability'.

If you're using a JS typechecker like Flow (and IMO if you're building a large app, you should) you can even make use of disjoint unions to type your Flux action objects: https://flowtype.org/blog/2015/07/03/Disjoint-Unions.html

mambodog··on Create React Apps with No Configuration
Most features in boilerplates are completely unnecessary for most beginner users of React.

Off the top of my mind:

- Server or Universal rendering - Hot Module Reloading (refreshing is fine!) - (early stage) proposed JS syntax

The main thing that is missing from this package is testing, but that's a very opinionated kettle of fish.

mambodog··on Whether a Swallow Is Frightened in a Storm
This bit got my imagination going (even if the true explanation is likely something mundane):

Another, somewhat spooky example of a tagged shark demonstrates the chasms GPS technology will reveal to us in time. Off the coast of Australia, a ten-foot-long, tagged female great white shark that went by the name “Shark Alpha,” disappeared from the radar. According to the tracking device, at four o’clock in the morning, the shark was suddenly torn five hundred yards into the depths, with astonishing power and speed. Within seconds, the chip also recorded a spike in ambient temperature, from 8 degrees Celsius to 25. That is the temperature of an animal’s insides; the shark must have been eaten by an aquatic predator. The chip could be followed for the next eight days, at which point it vanished from the control monitor. It was most likely voided. Four months later, it was found on shore, bleached by gastric acid. Researchers suspect Shark Alpha fell prey to a much larger creature. It will have to have been at least five meters long and weighed two tons or more. But what was it? An orca? Orcas usually hunt close to the surface. The deepest killer whale dive on record is 260 yards. Another great white? This species has a body temperature of 18 degrees—not 25. Could it actually have been a monstrous octopod or a megalodon, a gargantuan prehistoric predator that some say may has survived, hidden in the darkest depths of the ocean?

mambodog··on PCE.js Mac Plus Emulator Running Mac OS System 7
Hi, I'm responsible for this. Most credit goes to the PCE emulator, on which this is based: http://www.hampa.ch/pce/

I wrote a blog post about the rationale behind this project: https://jamesfriend.com.au/why-port-emulators-browser

Also as a bonus, here's The Oregon Trail: https://jamesfriend.com.au/pce-js/mecc/oregon-trail.html

mambodog··on PCE.js Mac Plus Emulator Running Mac OS System 7
Yeah, unfortunately I couldn't get touchmove events to work as the emulated CPU is blocked during the gesture. You can try tapping your stylus in different places to move the mouse, however.
mambodog··on Why React/Redux is inferior as a paradigm
To be honest, this whole thing just seems like a vague rant. It's full of hand-wavy statements like 'Once you learn Elm or Cycle, getting things done will be more productive' with only vague anecdotes to back them up, with no specific examples of worked problems.

The section on JSX & the React.createElement API is a weird diversion, because these aspects are so unrelated to the high level code structure complaints that they belong in a different article. Putting that aside, this section seems unfair at best. Firstly the JSX syntax is disregarded due to verbosity[0]. Okay, not to everyone's taste. However the author then goes on to making a comparison between React's createElement/createFactory APIs and the hyperscript-helpers npm package, which is incredibly uncharitable as the former is a performant, low level API intended for building ergonomic APIs on top of, and the latter is a high level, ergonomics-centric API.

Redux is a small library, which needs to be used underneath application-specific abstractions to avoid boilerplate. Not everyone will want to come up with such abstractions themselves. I can certainly see the value for an ergonomic, high-level, Rails-like project on top of React + Redux. Maybe that's the article the author should have written.

[0] I would argue many developers actually find the verbosity of JSX helpful when dealing with large trees of components, as compared to nested function calls. The fact that JSX closing tags repeat the tag name is key to this.

mambodog··on Angular 2 versus React
> This is the year of framework fatigue.

This is the year of the framework fatigue meme.

Next year is the year everyone realises why we had frameworks and tries to salvage the mess they made last year, when they wrote an app 'without a framework' and ended up with an under-specified, incomplete, undocumented, informal framework.

mambodog··on Angular 2 versus React
The only reason you could have a problem using Immutable.js with redux-simple-router is if you're trying to make the router's state into an Immutable.js data structure, but there is no reason to do that. redux-simple-router manages it's own part of the state, and you don't need to directly mutate it. You only read it or dispatch an action to update it.

You don't need to make the entirety of your state tree an Immutable.js structure, just the parts which are managed by the reducers you write.

mambodog··on The Future of Node Is in Microsoft’s Fork
Google doesn't care about the server-side use case for V8. Microsoft, on the other hand, has some skin in the game, as they are pushing Node on their Azure platform. While I wouldn't want to see Node controlled by Microsoft (or any single vendor for that matter), it's not outside the realm of possibility that Node will be better off using (open source) ChakraCore over V8.
mambodog··on React Router 2.0.0
On the other hand, the team seem committed to making upgrading easy, with automated codemods for breaking API changes where possible.
mambodog··on React Router 2.0.0
They're trying to direct newbies away from mistakenly thinking ReactLink is the 'right way'. Seems to only exist so people coming from two way data binding centric frameworks won't immediately discard React out of hand because it 'can't do two way data binding', before they get to know the framework's ideas and realise that two way data binding is usually a bad idea anyway; a notion which is fairly central to React's design. As an experienced React dev, I've never seen ReactLink in real-world use.

See the docs page called Thinking in React [1] and grep through all the mentions of 'data flow' and you'll see how one way (circular) data flow is how React is intended to be used.

[1] https://facebook.github.io/react/docs/thinking-in-react.html

mambodog··on Discogs Turns Record Collectors’ Obsessions into Big Business
Discogs provides dumps of the database[1] which you can load up and do some interesting queries on yourself. For example, for some genres (especially electronic/dance stuff) you can do some interesting related artist suggestion by examining links through niche record labels (which tend to host similar artists). No ML required :)

[1] http://data.discogs.com/

mambodog··on React Router 2.0.0
The two way binding helpers are just there for people who want to try React without giving up two way binding (eg. people coming from Angular). They are not the recommended way of doing things, and that page says as much.
mambodog··on Introducing d3-scale
The recent more-modular approach d3 is taking (specifically, the separation of DOM selection-driven APIs from the data manipulation stuff) means you can now just use d3 with React directly.

For example, you can use d3-scale to map from data to drawing coordinates, or straight to SVG path data (using d3-path/d3-shape). You can then easily render this to an inline SVG using React (or to some other backend using React libs like react-canvas and gl-react). Building the svg elements directly this way makes it easier to attach React event handlers to them, and gives you more fine grained control, rather than using off-the-shelf components.

Here's an example combining d3-shape and d3-scale with React and react-motion: https://jsbin.com/mehata/9/edit?js,output

mambodog··on Introducing d3-shape
For example, here's something pointless I threw together combining d3-shape, d3-scale and react-motion: https://jsbin.com/mehata/edit?js,output
mambodog··on Introducing d3-shape
I've recently been experimenting with how best to leverage the wealth of knowledge which has gone into d3 within the context of React, where the conventional selection-driven APIs become a hinderance rather than a help.

Around that time, I noticed the new modular repos on the d3 Github org[1] coming together, and have since been watching with great anticipation. I'm glad to see d3 evolving for a new world where its excellent, fine-tuned collection of math and drawing functions work in concert with your rendering framework of choice.

[1] https://github.com/d3

mambodog··on Vue.js 1.0.0
People usually compare the 'size over the wire', eg. gzipped size. In these terms:

- React 0.14 is 55kb

- jQuery 1.11 is 38kb

- Backbone + Underscore (dependency) are 15kb

mambodog··on Immutable Data Structures and JavaScript
> abstracting away DOM manipulation, which was never a real problem in the first place

Until you try to build a large app and get murdered by maintainability problems (eg. treating the DOM as a store of mutable state, managing event listener binding lifecycles, etc) and performance issues (eg. DOM reads and writes to occurring in an interleaved fashion inside inner loops)

mambodog··on Immutable Data Structures and JavaScript
At least in Chrome, you can add a custom devtools formatter so you can inspect Immutable.js datastructures just like native ones: https://gist.github.com/jsdf/e27e0e467dc8db3fb1e1
mambodog··on Show HN: Kiddo Paint
If you'd like a flashback of the original Kid Pix: https://jamesfriend.com.au/pce-js/
mambodog··on The Debate Around “Do We Even Need CSS Anymore?”
I think CSS Modules[1] (mentioned toward the end of the article) provides a starting point to finding a good compromise. It deals with the scoping issues, as well as interoperability between Javascript modules and the defined style classes.

As it stands, the CSS Modules approach doesn't yet provide the same level of expressiveness which can be achieved with the styles-in-JS approach, but perhaps there is still value in evolving CSS-the-language to provide enough expressiveness while still providing an optimal syntax for style definition and facilitating static analysis and transformation specific to the domain of styling.

[1] https://github.com/css-modules/css-modules

mambodog··on GitHub had connectivity problems
I wonder if this is related to https://news.ycombinator.com/item?id=10101469
mambodog··on React Static Site
The React DnD docs/examples site is rendered in a similar manner:

https://github.com/gaearon/react-dnd/blob/master/scripts/bui...

mambodog··on How to destroy special collections with social media
Google cache mirror: http://webcache.googleusercontent.com/search?q=cache:TDYdhcB...
mambodog··on React on ES6+
If there is a particular case which you think should work but doesn't, please file an issue on the coffee-react-transform repo and I'll look into it.
mambodog··on Mongo BSON Injection: Ruby Regexps Strike Again
Not to mention this classic, which was probably his original claim to fame: https://news.ycombinator.com/item?id=3663197
← PreviousPage 4 of 23Next →