phase_9's comments

phase_9 | 12 years ago | on: Exploring an alternative to git-subtree

I have anyways seen git submodules (and svn-externals before) to be a quick and dirty workaround for managing dependencies between modules.

I've been under the impression that using an artifact management tool such as Apache Ivy or Bower provides a more manageable and scalable solution, especially in projects with 20+ developers.

How does the solution proposed by the author compare? Does it compliment a managed artefact based solution?

phase_9 | 12 years ago | on: Args.js – Optional and Default parameters for JavaScript

I've seen this style of library come up quite a few times whilst hacking away in JavaScript where developers try to introduce a sense of strict typing (I even wrote a similar one myself when I first moved over from ActionScript). In the end I learned to stop worrying and love the <strike>bomb</strike> duck typing[0].

For me; one of the "joys" of coding JavaScript is the expressiveness that comes with a dynamic languages; should you throw an ArgumentError when your function that expects a number is invoked with a String? Maybe - sure it can help catch problems early and effectively "stop-the-line" in your public API, but then again it will probably end up throwing the classic `TypeError: Object foo has no method 'bar'` for you anyway.

For "public" methods which form part of an API (especially when that API is going to be shared outside of my team) I try to make my functions handle failure early (before they delegate off to the "private" internal methods), even better if the public methods can repair any unexpected usage, ie:

  function convertToHex(value) {
    var result;
    
    if (typeof value !== "number") {
      result = convertToHex(parseInt(value, 10));
    }
    else {
      result = "0x" + value.toString(16);
    }
    
    return result;
  }
Also, with regards to default argument values, I've always felt the "native" JavaScript approach was fairly compact and descriptive when required:

  function doFoo(bar) {
    bar = (bar !== undefined) ? bar : "default_value";
  }

[0] http://en.wikipedia.org/wiki/Duck_typing

phase_9 | 13 years ago | on: Anders Hejlsberg and Lars Bak: TypeScript, JavaScript, and Dart

ECMAScript 4 was implemented in ActionScript 3[1]; a very nice language to work with IMHO. The members of the ECMAScript steering group launched into a public fracas on their respective blogs[2] which eventually ended in the draft being canned, despite the fact both ActionScript and Silverlight were already based on the standard... shame.

[1] http://en.wikipedia.org/wiki/ActionScript#ActionScript_3.0

[2] http://blogs.msdn.com/b/ie/archive/2007/10/30/ecmascript-3-a...

phase_9 | 13 years ago | on: Show HN: jQuery-Mustache Plugin

This is a small jQuery plugin that I have been maintaining for a few months now. It provides a bit of sugar when using both jQuery and Mustache templates.

phase_9 | 13 years ago | on: Google Nexus 4: Nearly flawless

True, but I find the lack of Micro-SD Card Slot to be particularly galling, especially as it's becoming an increasingly popular trend with Android handset manufacturers looking to add a hefty markup between otherwise identical models. Just ends up hurting us consumers who want to carry their music collections around with them :(

phase_9 | 13 years ago | on: Rsvp.js

Yet another promises library (: It's great that people are writing and sharing code, but it feels like people are trying to re-invent the wheel when stable, mature and well tested libraries[0] already exist for these problems.

[0] https://github.com/cujojs/when

phase_9 | 13 years ago | on: Flowplayer 5.0.0

Anecdotal, I know, but I found VideoJS to be a bit of a mess. From a code point of view, the player instance would not destroy correctly resulting in a memory leak for single-page web apps and IMHO the CSS was a pain to work with.

phase_9 | 13 years ago | on: WebRTC is almost here, and it will change the web

Yet another HTML5 "Game Changer" which has already been available as part of the Adobe Flash Platform[1] for the best part of three years.

Just saying :)

For those down-voting me; I find this attitude very strange. If the tools were present in another widely deployed runtime, but were heavily under utilised then why are people getting so excited about them this time around?

I guess some people just love to hate Flash.

[1] http://labs.adobe.com/technologies/cirrus/

phase_9 | 13 years ago | on: Security questions are salt

I don't understand why people are trying to come up with such complex solutions to Password and Security Question retrieval when portable and open source solutions, like Keepass[1][2] exist.

Just store your "random" Security Question answers alongside the login credentials - they'll be encrypted safely.

--

[1] http://www.keepass.info/

[2] http://www.keepassx.org/

phase_9 | 13 years ago | on: Backbone Aura Developer Preview

"Aura is currently missing two important items needed to help us get out a stable release. These are good unit tests and stronger documentation."

I can understand the lack of documentation, but I balk at the fact that framework developers wouldn't use TDD to guide the development :(

phase_9 | 13 years ago | on: Change your Last.fm password

I've just spent the last couple of hours creating unique longins for every site I can remember having a login for and storing them in Keepass (opensource password safe). The Keepass database is stored on my dropbox account so it's automatically synced to all machines / devices I use.

I get the impression this is going to be a bit of a PITA, but with the rate these sites are being breached it's probably a sensible move.

page 1