HNHacker News
TopNewBestAskShowJobs

stupidcar

8,592 karma · joined March 30, 2014

submissionscomments
stupidcar··on Stephen King: Can a Novelist Be Too Productive? (2015)
Speaking as a relative non-snob, I'm always a bit baffled when people cite Joyce like this. I mean, he clearly had an unrivalled mastery of language, but do people actually like reading prose like that? Even his supposedly more accessible stuff like Dubliners and Portrait of the Artist just seemed so dense and obtuse that while I could objectively admire the skill on display, I never once really found myself enjoying them.

I'm not saying art should exist purely for the sake of entertainment. But, ultimately, if I'm investing the time to read a book, I need to get something out of the experience from moment to moment, and generally I find I get more from reading a bad writer with fun ideas than an expert stylist who makes no concessions to enjoyment.

stupidcar··on Making Web Components Work
That article doesn't quite support what you're claiming. The Vanilla JS implementation uses optimised DOM mutation techniques that are inspired by how the Virtual DOM libraries do things, but it doesn't re-implement a Virtual DOM. Yet it's faster than any of the Virtual DOM implementations its benchmarked against.

So the takeaway is that DOM mutation can be slower or faster depending on the techniques you use. Using a Virtual DOM library can help you improve performance, because these techniques are often baked in, but they don't intrinsically result from using a Virtual DOM: You could write a V-DOM library that didn't use them, and was slow, and you could write, for example, a static template library that did, and was fast.

In theory, a compiled, static template approach should be faster than V-DOM (or anything other than a set of totally bespoke and optimised vanilla JS functions for each app operation). Because while a compiled template does not have the turing-complete flexibility of something like JSX, it has the advantage of knowing in advance exactly which parts of the DOM can change and how, which eliminates the need to build and diff the Virtual DOM tree.

stupidcar··on The Trouble with D3
Visualisation is fundamentally the process of creating a mapping function between the dimensions of your domain data and that of the "screen" (whether it's DOM, SVG, Canvas, etc.). D3 is just a library of higher-order functions that can help you produce that mapping function.

If you can grasp this idea of visualisation as creating a mapping function, then D3 becomes a beautiful toolbox for assisting you. You decide which dimension of your data you want to represent as the horizontal dimension, which as the vertical, as color, as size, etc. You decide how you want to scale them. Then you use D3's high-order functions to create the appropriate individual mapping functions, compose them into your complete visualisation function, and pass it your domain data.

If you think of D3 as a "charting library", or a collection of visualisation classes or objects, then you're going to struggle. But the problem isn't with D3, it's that you haven't really understood the paradigm of the library.

stupidcar··on Making Web Components Work
Incorrect. This idea was a result of some early React users misunderstanding the purpose of the virtual DOM, and has unfortunately been thoughtlessly repeated ever since.

In reality, browser engineers are not that stupid. Mutating the DOM will queue a layout operation, but it will not actually occur until the current JS task has finished executing. Within a JS task, such as an event handler, an XHR completion, or a setTimeout, you can mutate the DOM as many times as you like, and it will only result in a single layout pass.

(The exception is if you try to read back some measurement from the DOM, such as an element's bounding box, after mutating it. In this case, the browser does have to block while it performs layout, but that is not something can be solved with virtual DOM).

So, what is the purpose of the virtual DOM? It was invented to allow React to provide the illusion of full re-rendering. React's authors wanted to a provide an experience similar to that found on the server, where an entire HTML page is re-rendered from scratch for every load. In that way, there is never any possibility of part of the HTML becoming stale, as it all gets recreated from scratch each time.

However, the browser DOM is not designed to be blown away and recreated from scratch all the time. Nodes are expensive objects, spanning the JS and C++ worlds. Recreating the whole DOM tree each time any part of it needed updating would be too slow. So, instead, they created the virtual DOM as an intermediate data structure. React renders the virtual DOM. The virtual DOM is diffed against its previous state, and then the changes are applied to the actual DOM tree. In that way, every component's render() method can be executed, but only those parts of the DOM that have actually changed will be updated.

It's a nifty optimisation, but it's not about avoiding reflow, it's just another method of dirty checking, similar to that done in other frameworks like Angular or Ember. It's just that React chooses to diff the data structure produced by render(), rather than diffing the model data that is later used for rendering.

stupidcar··on Making Web Components Work
For me, the biggest plus of web components is the potential simplicity of unifying the document's object model with that of your application. Every JS framework, like React, Angular, Vue, etc. seems to have a parallel OM that either wraps or renders into the DOM (Angular seems to have about 5 of them).

The result is your can never just use the basic DOM APIs and devtools to inspect and interact with your application's components. Instead, you always have to get at them through some other API, and understand how the UI and state you see in the DOM is produced and updated by some mediating layer (virtual DOM, view hierarchy, etc.). It feels like trying to get at the truth by talking with two different people, who each only possess a subset of the facts.

stupidcar··on Braces Have Made Snoring a Modern Health Problem
The article advocates changes to how children are raised — encouraging more chewing of tougher food — as a way to improve the situation. But is there any suggested intervention for adults? Perhaps more adults should be encouraged to have jaw adjustment surgery, instead of regular orthodontic treatment? Right now it seems like braces are considered the first choice, and surgery the last one, but perhaps this should be reversed?
stupidcar··on TypeScript 2.9 is now available
Yes. We develop a large Angular app. When the framework itself is written in TypeScript, and by extension, most of the ecosystem code ends up being TypeScript as well, and we have not really faced any major typing issues.

On the other hand, when writing server code targeting Node, with lots of dependencies on micro-libs, I've definitely had the experience of struggling with outdated or incorrect type definitions.

However, nowadays TypeScript has much better interoperability with untyped JS code. You can generally import an untyped JS module with the minimum of ceremony and have it Just Work (the type will be "any", so you don't get intellisense).

I find the best approach is to import types for the big libs you are using, like Express, and leave the micro-libs untyped. That way you get the benefit of types on your own code and your interactions with the framework, but can still leverage other code when you need to without giving yourself a headache.

stupidcar··on Microsoft Is Said to Have Agreed to Acquire GitHub
If centralisation only occurs due to government enforcement, then how did government itself come into existence? It's the purest example of centralisation, after all. There must be something that incentivised centralisation even in the absence of government.
stupidcar··on Microsoft Is Said to Have Agreed to Acquire GitHub
Yeah, I wanted to say exactly this. There's a different between specialisation in a market that still provides competition and consumer liquidity, and monopolistic centralisation (even when the monopolist is effectively benign).

It's like there's a middle-ground between everyone building their own automobile, and there being only a single car manufacturer on the planet. So long as have you have a few players who are genuinely competing, and you have the option to switch between them without paying an excessive penalty, then it's a good thing that a certain subset of people are working hard on building better cars than you ever could tinkering away in your garage (although you should still be allowed to do that, if you so desire).

What this requires is for governments to provide a framework of standardisation, access-to-data, data-transferability, and antitrust enforcement that allows a healthy competitive environment to emerge and persist, without either allowing a monopoly (or a cartel) to evolve, or overburdening everyone with regulation.

It's a difficult balancing act, even in more traditional industries, and anyone who presents a too simplistic "more regulation!" or "less regulation!" answer to it isn't being honest. Tech presents additional challenges because it's newer, and because it's evolving rapidly. I think it will take many more decades for the necessary level of technical understanding to metastasise through policy-making and civil administration realms until you get effective control of tech markets, although laws like GDPR are an interesting start.

stupidcar··on Apple Will Go All-OLED in 2018
The article mentions burn-in.
stupidcar··on ECMA TC39: “SmooshGate” was officially resolved by renaming flatten to flat
The "don't break the web" excuse is the same old bad-faith nonsense:

1. The number of websites using the old version of Mootools is vanishingly remote, relative to the number of existing websites not using it, and the number of as-yet-unmade websites who will also not use it (but who will be harmed by the committee's dedication to retarding the development of the language).

2. Of those websites using this old version of Mootools, the number that use flatten, and do so in a way that would definitely be broken by the introduction of standardised "flatten", and wouldn't be fixed thereafter is, statistically speaking, zero.

3. Most of the same people who are affecting concern about backwards compatibility in the case of the web work for tech giants who regularly retire products and APIs that are relied upon by thousands of people, and make backwards incompatible changes to their operating systems that break masses of unmaintained apps.

But the fact is, you can't make arguments like this to groups like the TC39 and expect to even get a hearing. Despite their occasional spiel about seeking outsider feedback they are, like any institution, happy in their long-settled groupthink positions, and reflexively frightened and dismissive of any challenge or criticism by outsiders.

You saw this when the whole "smoosh" affair first broke. There was a long, passionate, but civilised debate about it on GitHub (https://github.com/tc39/proposal-flatMap/pull/56 ) which was abruptly cut off by a TC39 committee member, who locked out non-contributors entirely, with the dishonest claim that things had become "too heated". What he really couldn't stand was the sight of the committee's dogma being challenged.

Remember that next time the representative of a standards body whines about lack of participation in the process by regular web developers. It's a lie. These groups are only interested in the opinion of outsiders if they align with a set of fixed and unchallengeable precepts, and they will revert to depressingly familiar suppression of speech the moment it looks like things aren't going their way.

stupidcar··on What Happened to the Megafauna?
Imagine if, instead of spending your childhood, teenage years and early adulthood in schools, you just spent it learning to hunt, then continued to learn and practice hunting for the rest of your life. Imagine if everyone in your family, and everyone else you knew had also spent their entire lives learning to hunt and hunting. Imagine if every genius born into every generation devoted their entire intelligence to the problem of hunting, from their first moment to their last. Imagine if this had been going on for generation after generation, with knowledge and expertise refine and passed down through mentorship and oral tradition.

Collectively, it's a level of intellectual effort that humanity has likely never brought to bear on any other problem besides, perhaps, farming. As such, it's perhaps no surprise that early humans were spectacularly successful at hunting so many of even the largest and most fearsome animals to extinction.

stupidcar··on Version 6 of Angular Now Available
I'd offer the opposite perspective: I started a recent app in React, and I wish I'd stuck with Angular.

The core of the React render model is beautiful. It's far quicker to start writing and using a new component in React than in Angular, and the functional nature of React components feels good and highly productive. At first.

But the problem is, around that beautiful core, the React community has built a mass of libraries, meta-frameworks, techniques and practices that are decidedly less beautiful. After a while, I really found myself missing features from Angular, and struggling to replicate them by wiring together a hodge-podge React++ framework. Instead of being productive, I was wasting an inordinate amount of time trying to discover what the current micro-framework de-jour was for handling a particular problem in React.

For example, Angular supports view encapsulation. So you can write CSS targeting a component, and the framework will ensure that the style rules you write apply only to the HTML rendered by that components, without leaking to other parts of the app. This really is a godsend for properly isolating components in a reusable way. With React, there's a myriad of libraries for doing CSS, but most seem to be abandoned, and none seem to offer as straightforward or as easy style encapsulation as what Angular provides out of the box.

It was a similar story with forms. Which are a rich, reactive API in Angular, but seem to be an afterthought in React. And with dependency injection, both of singleton services and components elsewhere in the hierarchy.

I expect if you go all in on Redux, you can eventually build up a reasonable facsimile of what Angular provides. But from a standing start I think Angular is a much more productive framework, just because it's actually trying to be a framework, whereas React seems to be stuck somewhere between being a UI library and a framework, leaving the community to somewhat badly fill in the gaps.

stupidcar··on Version 6 of Angular Now Available
I'm not sure what you mean by "churn for churn's sake"?

The AngularJS to Angular upgrade step is a big one. But, the latter is unquestionably a better framework once you're using it. It only needs to be done once, and it can be done gradually, if you're willing to ship both frameworks for a while. The upgrade modules they provide for running AngularJS code in Angular (and vice-versa) were a bit dodgy at first, but they are excellent now.

Once you're on Angular, there's no need for any 6-month rewrites. We upgraded about a year and a half ago, and we've kept up to date without facing any problems with backwards incompatible changes or upgrade pain. The Angular team has done a lot of work on improving the framework's internals, but the actual conceptual model and interfaces have remained stable.

Plus, if you use Angular CLI, you're also isolated from churn in the build tool world. You don't have to worry about juggling compatible versions of Webpack and its myriad loaders and plugins. It's all hidden away. Having wasted far too many hours of my life hacking on Grunt, then Gulp, then Webpack configs, that's reason enough to use Angular for me.

stupidcar··on The Fall of Eclipse (2016)
[citation needed]
stupidcar··on France’s Zone Rouge – A Forbidden No Man’s Land Poisoned by War (2015)
There's something very sci-fi seeming about the idea of a huge battlefield from a long-ago war, still too contaminated with old poisons and weaponry to safely enter. Which nature has mostly reclaimed, except in dead zones so toxic that not even plants can grow there.

And yet, this is a real thing that happened, and is a part of our past. A generation who very soon will only be ancestors the living participated in battles so destructive that they did this to the land they were fought on. I find that difficult to fathom.

Of course, humans have only gotten better at killing each other since, and WW2 was more destructive overall. But the static nature of the Western front, combined with the unrestrained use of artillery and gas, and the total commitment of manpower on both sides in places like Verdun, gave its battles an apocalyptic intensity that I think is unmatched in any war before or since. And that, hopefully, we won't ever see again.

stupidcar··on The Node.js Ecosystem Is Chaotic and Insecure
Correctly checking if a variable is odd is not quite as simple in a dynamic, type-coercing library like ECMAScript as you might think. You have to consider things like: is the variable null or undefined? Does it have the Number type? Is the number an integer? Is the integer odd? In a statically typed language, the compiler would guarantee many of these things for you, but in ES you need to do it yourself.

It's not rocket science, but it's tricky enough that you could perhaps make a mistake or overlook something. To be safe in these situations, when writing a small amount of "nearly trivial" code, programmers have generally resorted to a package manager called "Google / Stack Overflow".

This package manager works as follows: You Google for "safely check if odd in JavaScript", open the top Stack Overflow link, then copy and paste the answer (usually a single function) into your codebase. Then you add a comment saying "taken from https://stackoverflow.com...". Whenever you have another piece of "nearly trivial" code to write, you install it the same way.

ES developers thought that this workflow could be optimised a bit. To that end, they invented a package manager called "npm". Unlike the Google / Stack Overflow manager above, this lets you install functions like "is-odd" without having to manually copy and paste them from your browser. It also keeps track of where they came from, who authored them, and even lets them be updated, if necessary.

stupidcar··on Cripes, a bumbershoot
I remember first hearing the word "bumbershoot" in an episode of Frasier, used as an example of a ridiculous Britishism, and being very confused, as I'd never encountered it, despite living in Britain all my life. After some research revealed it was actually American slang that had become incorrectly thought to be British, I felt oddly offended.

To be honest though, as the British and American entertainment worlds have merged over the past couple of decades, I've found myself using more and more Americanisms, and I've kind of made my peace with that. The English used in TV and film represents the language in its most modern form, and, increasingly, opposing "Americanism" also means opposing the progress of culture, and the influence of minorities and immigrant groups, and I don't want to be that kind of stuck-in-the-mud, so I'm trying to just relax and accept linguistic progress in whatever form it takes.

stupidcar··on The latest trend for tech interviews: Days of unpaid homework
The hiring process is a response to the fact that employers cannot trust a single word candidates say about their experience. This isn't paranoia. Literally, most candidates we see cannot code, even when they supposed have a decade or more of industry experience.

If the industry wasn't so full of lying incompetents, it wouldn't be an issue.

stupidcar··on What Dockless Bikes and Scooters Are Exposing
When bikes are ridden on the pavement, it's usually because road design and/or car drivers are making the road too dangerous for them. If you think about it, the pavement is not somewhere the average cyclist wants to be any more than a pedestrian wants them there. Even without people filling them, pavements are irregular, uneven and cluttered spaces, optimised for slow-moving bipeds who can stop, start and turn on a dime. If there's a safe roadway available, cyclists will use it.
stupidcar··on [dead]
The academic background of the author of this book, "Dr Edward Dutton", is Theology and Religious Studies:

https://edwarddutton.wordpress.com/

Quite how that qualifies him to write a book on evolutionary psychology is anybody's guess. I'd give his claims about as much credence as your racist uncle forwarding "studies" regarding the supposed tendencies of his least favourite ethnic groups.

But self-consciously "alternative" news sources will seize on anything that they use to claim their biases have a rational basis, rather than an emotional one, I suppose.

stupidcar··on A game of tag that’s been going for 20+ years
Good cast though. Perhaps it's just the trailer that's cut to make it look like formulaic crap.
stupidcar··on Microsoft, Google, Mozilla, and Apple Object to W3C Fork of DOM Spec
That was the situation prior to the writing of the HTML5 spec, not a situation it created. The majority of the web was not, and never would have been parsable as strict XHTML, whatever the desire of the W3C or anybody else. And even for new content, the idea that every hand-authored file would be well-formed, or that every half-baked and buggy CMS would always produce correct markup was a pipe-dream.

If strict parsing had been enforced, we'd have a web where a large proportion of the sites you visited each day would be broken. Or rather, we wouldn't, because complaints from users would have long ago forced browser vendors to implement graceful error handling, and so you'd end up with something akin to HTML5 anyway. Indeed, it was encountering precisely this problem that made vendors like Mozilla and Opera (who, incidentally, never had billions of dollars) to lose faith in XHTML in the first place, not some masochistic desire to keep their browsers' code as complicated as possible.

stupidcar··on Microsoft, Google, Mozilla, and Apple Object to W3C Fork of DOM Spec
No, it wasn't simply a question of backwards compatibility. The W3C wanted (wants?) to pursue its own quixotic vision of a semantic, machine-readable web. One in which the needs of human users, browser user agents and use cases like web apps was of incidental importance at best.

The HTML5 spec effort that gave birth to WHATWG wasn't simply about documenting backwards compatible parsing, it was about vendors like Mozilla and Opera wanting to evolve HTML in a way that added actually useful new features, something that W3C had zero interest in at the time.

Nowadays, the W3C's behaviour seems to be driven entirely by an institutional desire to justify its own existence, and protect its revenue stream and its self-assumed position as the one-true source of web standards, by engaging in bad-faith practices like taking standards produced through the hard work of others, removing all citations, making breaking changes, and publishing it as a competing "standard".

stupidcar··on Jevons paradox
I think there is a related fallacy which is to see a current level of demand / characteristics of a market as representing a "natural" and fixed state, rather than a function of constraints such as the cost of resources. E.g. criticism of the viability of SpaceX's Falcon Heavy rocket hinged on weak demand for putting large payloads into space. But this ignores the possibility that payload sizes are constrained because it's too expensive to launch them, and that having a cheaper option will create the market for it. I'd argue that the core of successful entrepreneurship is being able to see through this fallacy, and being able to identify gaps in the market that are the result of hidden, unmet demand, either in terms of price or functionality.
stupidcar··on System Shock 1 source code released under GPL
"We are taking a break, but NOT ending the project."

Apparently you didn't read the very update you linked to.

Nor did they take the money and run; they just wasted it through mismanagement and unrealistic goals. They deserve plenty of criticism, but just because you're pissed off at them doesn't excuse blatant lying and misrepresentation.

stupidcar··on System Shock 1 source code released under GPL
> Because they've been unsuccessful in completing the reboot, releasing the sources is a way of apologizing.

Where are you getting that this release is an apology for the failed Kickstarter? Can you point to source at Nightdive saying this, or are you just speculating?

stupidcar··on JavaScript: prototype vs. class
A lot of these examples seem rather contrived, and the whole appendix has a very FUDy feel to it. It seems like the author didn't like classes in JS, and set-out to come up with some examples to justify their dislike, rather than coming to that conclusion through actually encountering these problems in the real world. Something not helped by the weaselly tone, constantly implying that it's just raising concerns, when it's clearly been written by somebody with an extremely strong anti-classes mindset.

As a simple way to define a reusable bundle of behaviour of logic, or to construct simply base-class -> specialisation inheritance hierarchy, JS classes work fine.

stupidcar··on [dead]
What exactly is the criteria here? If you go by star count, the most popular JS project on GitHub is freeCodeCamp, not React.

https://github.com/topics/javascript?o=desc&s=stars

And a number of other popular JS projects have also been excluded from this list?

stupidcar··on The Illusion of a Profitable Amazon Prime Now and Prime Fresh
We've become significantly more risk-averse as a society though. If cars were invented today, it seems extremely unlikely that the intimate mixing of pedestrian and vehicle realms would be tolerated in the way it is now. We generally only accept dangerous transportation, structures and substances if they are a legacy from an earlier age. And even then you see high pressure to reduce or eliminate them, e.g. cigarettes.
← PreviousPage 12 of 26Next →