HNHacker News
TopNewBestAskShowJobs

bluepnume

792 karma · joined February 4, 2012

daniel@onetext.com
submissionscomments
bluepnume··on I have no side code projects to show
Part of the process for me has been to try to do as much of my job as possible in the open source world.

Naturally, I can't open-source any private business code. But if I'm doing my job right, I'm building libraries and reusable code that isn't tightly coupled to business logic -- and there's no good reason to avoid throwing all of that on github, and have it be used by as many people as possible.

Of course there are going to be companies that aren't onboard with the idea of open-source. It's taken a lot of places a lot of time to get to that stage. But are those the places you really want to work?

bluepnume··on How we solved the problem of cross-domain web components, at PayPal
Part 1, if you're interested, on cross-domain messaging: https://medium.com/@bluepnume/introducing-post-robot-smart-c...
bluepnume··on Overview of JavaScript ES6 features
Javascript's weak comparison operators aren't that bad.
bluepnume··on Introduction to asynchronous JavaScript
Hmm. An article in 2016 about async javascript without any references to async/await?

Also, using promises to make code look prettier is kind of missing the point, and can be achieved with callbacks too. The real reasons to use promises are:

1. Error handling/bubbling

2. No chance of 'double callbacks'

3. Value-oriented code

4. Easier composition of async tasks

5. Ease of migration to async/await

bluepnume··on Microsoft Edge gets native ECMAScript 7 async/await support in latest build
That said, it isn't too hard to write re-usable helpers for promise based control flow, in a similar manner to what async.js does for callbacks.

    function iff(condition, method) {
        return Promise.try(condition).then(result => {
            if (result) {
                return method();
            }
        });
    }

    function whilst(condition, method) {
        return iff(condition, () => {
            return Promise.try(method)
                .then(whilst.bind(null, condition, method));
        });
    }

    whilst(someAsyncAction, Promise.sleep.bind(null, 1000))
        .catch(err => {
            // ...
        })
Naturally you wouldn't want to re-implement all of this control flow every time you need it. But the end result is not too much boilerplate.
bluepnume··on Criticisms of Angular
How are Ember's computed properties analogous to defineproperty? The latter doesn't give me dependencies for my properties, so may as well just be functions. Ember's properties will only need to be recalculated when their dependent properties change.
bluepnume··on Promisees – JavaScript Promises Visualization
Agreed, it's syntactic sugar over es6 generators. But I don't agree that it's just syntactic sugar over promises, which is what the parent comment asserted.
bluepnume··on Promisees – JavaScript Promises Visualization
More than just syntactic sugar. async/await changes the whole control flow of a method.
bluepnume··on Ember.js Screencasts
It amazes me that Ember is not more popular than it is. Still, I can't complain -- it doesn't seem to have slowed those guys down in the slightest.
bluepnume··on The Transition to Ember 2.0 in Detail
Well... for a start, there are many existing apps written in Ember. These will get a immediate, backwards compatible boost in performance. Quite often "why not rebuild" isn't exactly going to be a trivial exercise.

For new apps, the "why Ember over React" exercise is left to the reader. They're both excellent at what they do.

bluepnume··on Do you really know why you prefer REST over RPC?
I generally use a pattern like:

GET /api/resource

POST /api/resource/action

Where 'action' is something a bit more descriptive than 'PUT' or 'DELETE' or whatever. Kind of like an object-oriented api... I'm still always dealing with resources, but I have custom actions for specific use cases.

bluepnume··on Newcomb's paradox
Sure you can. The AIs behaviour could be as simple as "Always pick box B".

The difficult bit would be designing an AI which, given perfect knowledge of its logic, would pick both boxes despite appearing to be more likely to pick only B.

In that case, you could simply have an AI with a 0.499999 chance of picking both and a 0.5000001 chance of picking B. The expected winnings would be $1,000,500.

But then, once it comes down to probability, the predictor is no longer a 'perfect predictor' any more.

bluepnume··on It's just wood
If you read between the lines, the article isn't about how anyone can build a vegetable patch, it's about how anyone can build (or do) anything, if they can just figure out that it's possible.
bluepnume··on Unpythonic Python
Ah. Thanks for pointing that out! Interesting quirk with shared global scope!
bluepnume··on Unpythonic Python
Nobody ever seems to go for the general solution:

words = ( (3, 'Fizz'), (5, 'Buzz') )

def fizzbuzz(num): for value, word in words: if i % value == 0: yield word

for i in range(1, 101): print ''.join(fizzbuzz(i)) or i

bluepnume··on Rendering Head in WebGL
Vaguely interesting: how much his emotions seem to change only based on his head/eye angle: http://imgur.com/a/6QEIq
bluepnume··on Spiffing CSS: the preprocessor made for Brits
Sorry, I thought you were being coy. To answer your question, we don't refer to all images as photographs. I think this was a joke-within-a-joke on the part of the author.
bluepnume··on Spiffing CSS: the preprocessor made for Brits
If your $LANG is en-us does your sense of humour go amiss?
bluepnume··on Spiffing CSS: the preprocessor made for Brits
Here's that regex again, except actually readable:

    (\s*|;)[\w-]*:
bluepnume··on Facebook quietly ends email address system
Someone found my wallet too and located me on linkedin. Come to think of it, it's the most useful linkedin has ever been for me.
bluepnume··on How I want to write Node: Stream all the things
It would be trivial to create a q.series or q.waterfall abstraction. The real benefits of promises are that we get back `return`, `throw`, `try` and `catch`, not that it makes our code 'look' more sequential, which is totally possible using callbacks and async.js.
bluepnume··on SteamMachines
Oh, OK, I take your point. Fair enough!
bluepnume··on SteamMachines
Velocity is a vector.
bluepnume··on SteamOS
Valve, at one point, came out to say they had no plans to support linux.

Now they don't just support linux, they're using it to stage a mini coup against microsoft.

bluepnume··on Progressive Enhancement Is Dead
Having URLs which point to specific resources is still 100% possible for javascript web apps. Take a look at Ember, as an example, those guys place a load of emphasis on URLs as 1st class citizens in frontend web apps.
bluepnume··on Is it Time to Open Source Windows?
What? Surely this falls under the free-as-in-beer vs free-as-in-speech distinction? What about RHEL? -- that operates on a paid open-source model.
bluepnume··on Is it Time to Open Source Windows?
Surely that depends on the license though? It would be possible to license open-source windows in such a way that corporations and OEMs couldn't distribute it without paying a license fee.
bluepnume··on Is it Time to Open Source Windows?
Forgive me if I'm missing something -- but how does open sourcing windows mean giving it away for free? They can still sell an open source OS, right?

If the argument is that it would be too easy to steal; well, it's already beyond trivial to pirate windows.

bluepnume··on Unsupervised joke generation from big data
Well, you certainly set your sights high.
bluepnume··on Servers of Hacker News
Makes sense, reddit is just another aggregation site. It's not too often it generates original HN worthy material.
← PreviousPage 6 of 7Next →