I love the new GitHub issues, here are some ideas to make it perfect, ordered by priority:
(function (w, d, a) { | |
var $ = w[a.k] = {}; | |
$.a = a; | |
$.w = w; | |
$.d = d; | |
$.f = (function () { | |
return { | |
getEl: function (v) { | |
// helper: which is the target of this event? | |
var el; |
href2selector = (href) -> href.match(/(#.+)/)[1] | |
class App.ContentSwitcher extends Spine.Controller | |
elements: | |
'li': 'items' | |
events: | |
'click li a': 'clickLink' | |
constructor: -> | |
super |
#!/bin/bash | |
cmd-hello() { | |
declare desc="Displays a friendly hello" | |
declare firstname="$1" lastname="$2" | |
echo "Hello, $firstname $lastname." | |
} | |
cmd-help() { | |
declare desc="Shows help information for a command" |
As it stands PEAR sucks. It's complicated, clumsy and is full of utter garbage (sorry).
PHP is rapidly dying because we don't have any decent way of writing code that can easily build on the work of others. What we need is a simple, open package management system like rubygems.
We now have decent support for namespaces, class autoloading and archives. I propose we abandon
<?php | |
/* | |
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | |
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | |
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
This is just a small post in response to [this tweet][tweet] by Julien Pauli (who by the way is the release manager for PHP 5.5). In the tweet he claims that objects use more memory than arrays in PHP. Even though it can be like that, it's not true in most cases. (Note: This only applies to PHP 5.4 or newer.)
The reason why it's easy to assume that objects are larger than arrays is because objects can be seen as an array of properties and a bit of additional information (like the class it belongs to). And as array + additional info > array
it obviously follows that objects are larger. The thing is that in most cases PHP can optimize the array
part of it away. So how does that work?
The key here is that objects usually have a predefined set of keys, whereas arrays don't: