HNHacker News
TopNewBestAskShowJobs

philplckthun

280 karma · joined January 25, 2014

Principal Engineer at Formidable, London • React (Native), CSS (-inJS), Reason • Dank Mono • urql & styled-components core team

Twitter: @_philpl Github: kitten

[ my public key: https://keybase.io/philpl; my proof: https://keybase.io/philpl/sigs/borwib-xRZK7tXkjGgyct1jcZhBkPu1H4YsjA5mRylU ]

submissionscomments
philplckthun··on Is your JavaScript function actually pure?
I believe as well that the article is imprecise, since it elaborates on a trick question and tries to just inform about the term "pure" being hard to define, especially in a dynamic language.

To be referencing an exact quote of the article to make it very clear:

  var arr = [{}, {}, {}];
  arr[0].valueOf = arr[1].valueOf = arr[2].valueOf = Math.random;
Obviously this relies on multiple function calls, so the output of the original function `sum` is still predictable. I think predictability and the absence of side effects is still a much better definition for pure functions.

It's also a necessary definition in JS. Saying that 'the same call of the function with similar enough arguments will always yield the same output' is not a sufficient definition and way too simplified.

philplckthun··on Is your JavaScript function actually pure?
Obviously due to JavaScript being a scripting language and dynamically typed, we have to make certain assumptions so that we can even consider calling any function "pure".

It's nice that André wants to warn us here about the fact that the term "pure" is more or less accurate depending on the language.

In JS it can depend heavily on previous assumptions and the context, but I'd argue that this is often only due to the arguments that are being passed to a function. A non-safe function that isn't type will always be impure in some contexts. But for sanity reasons we must be able to make assumptions about the arguments.

philplckthun··on 411 – An Alert Management Web Application
Furiously trying to go back to the last page makes me frustrated. Pretty sure that this is very high up on my personal Web app sins list
philplckthun··on Comma.ai will ship a $999 autonomous driving add-on by the end of this year
Wow! Slow down there, Satan. I can already see the headlines.
philplckthun··on Ask HN: Is web programming a series of hacks on hacks?
A good abstraction hides complexity without adding major tradeoffs. Presumably an abstraction makes it easier for a developer to reason about what is going on.

It's true that abstractions can lead to a lot of trouble when they are failing to work correctly. But when they are good they add a lot of good value. When did you last have to debug a system call, because you couldn't open a file? There are really good, old abstractions that no one thinks about anymore, since they're just really good.

A framework in web development is of course another matter, where complexity can sometimes be staggering. I believe that the lifecycle of React components is really nice. Instead of initialising X things you can think about how a single component will change over time.

There are endless examples of good and bad abstractions, I guess. But at the end of the day, we have to choose abstractions when we need them to reason about what we're doing, despite adding more points of failures.

After all, if an abstraction just enables us to think faster and more clearly about a problem, AND allows us to write less code, that means that less bugs will be in the final product, assuming that the density of bugs is constant. ;)

philplckthun··on Ask HN: Is web programming a series of hacks on hacks?
Abstractions make things more complicated? I think you're missing the basic definition and purpose of abstractions. So how do you define "almost"?
philplckthun··on Smaller and faster data compression with Zstandard
I'd love HTTP content encoding to support this and see a comparison to Brotli. Looks like it might be yet another good alternative to gzip.
philplckthun··on Show HN: A self-hosted alternative to Trello, Basecamp, and Freshbooks
The website was a bit slow to load... Like the last time, I guess? Hug of death :P

I love how simple it is. Really good job at breaking complex behaviour down into smaller interactions. I think this looks even better than Asana. Dependencies on a "parent task" planned?

philplckthun··on Fallout 4 Service Discovery and Relay
Have you got some kind of API? I'd be happy to look into connecting your map to the game. I think it would be nice to to need an app for this, but if this runs on a responsive website, that can connect to the game independently.
philplckthun··on Why you should go for React.js, instead of Angular 2.0
Sounds awesome! I really liked Meteor, but its view part was weird. Meteor+React sound like a natural dream team.
← PreviousPage 3 of 3