August 2009
48 posts
Potatohead: an experimental prototype object model/framework for development with PHP. http://github.com/brendan/potatohead
Considering implementing a Diffie-Helman key exchange in php+javascript to allow secure transfer of a secret code without resorting to SSL.
July 2009
45 posts
Law of Demeter, plz. Kthx bye.
What’s your favorite approach for C-style (or PHP/Java) code? Allman style w/ 2 space indent: function f()
{ if() { x; y; }
}
I created a modifed parser syntax for Testing_DocTest so doctests need *much less* boilerplate. http://gist.github.com/158422
ps: I have a ruby question for you: How do I become rich beyond my wildest dreams?
bb: alias_method_chain :bank_account, :syphon
Engine Yard now almost owns all of Ruby, having just hiring JRuby team. I wonder if they could offer enough $$$ to Matz and *have it all*?
Hey, universe. I have a new local SF phone number now thanks to Google Voice: (415) 894-0207 — also my old 312 mobile number is gone now.
Ghetto function argument reflection in Javascript. http://gist.github.com/77096
this compiler doesn’t optimize free(malloc(sizeof(infinity)));
I can’t believe I avoided C programming for this long— and I really don’t understand why we were taught Pascal instead of C in High School.
A warning from the Unix m4 manual (section 1.1): “Beware that m4 may be dangerous for the health of compulsive programmers.”
.name is the most meaningless tld I can think of. How exactly did that get approved? No offense to anyone with a .name domain.
C programmers: is there a doctest equivalent out there for C programming? #c #doctest
The fact that people are still prefixing @ replies in twitter with single characters means Twitter is still broken.
http://www.facebook.com/config.yml Tee hee.
Falling in love with the Diffie-Hellman key exchange all over again.
Now that I’m getting familiar with C, I see where PHP gets its design patterns. Also realize I’d much rather write web apps in C than PHP.
Today I learned that C programs are actually much more readable than Java programs. Hello world in C: main() { puts(“hi”); return(0); }
Ruby Shines in Emerging Markets (from Feb 2009) - http://bit.ly/jxhyp [devs in China/India use Ruby more than twice as much as in the west]
What I love about Ruby: I’ve never checked what happens when calling Hash#merge with a block, but it totally just did what I’d want it to.
July 16, 2009: PHP migrates its RCS from CVS to SVN. THAT is some serious cutting edge tech!
I did some benchmarks to help find “best/fastest” ways to do some low-level operations in PHP and posted here http://bit.ly/7wVRr #php #perf
PHP Statement Benchmarks
I have been looking at the relative cost of executing statements in PHP to help empirically identify approaches for writing fastest-possible code in PHP. There are some interesting results here, and your mileage may vary. The benchmarks were run on a Mac using the entropy.ch build of PHP 5.3.0. The code for running the benchmarks is available at github.
seconds code (exec 100000...
In case it isn’t evident from my tweets I’ve been running a lot of PHP low-level benchmarks lately. Will post findings to the blog soon.
When I google for `ometa php` I don’t get a single result that matches my query but I get 12mil that don’t. http://bit.ly/160yTD #GOOGLEFAIL
Another PHP fun-fact: it is faster to json_decode strings than it is to build structures of ~10 or more nodes with PHP array literal syntax.
PHP internals baffle me. array_key_exists(“x”, $array_of_5k_items) is about 289 TIMES as expensive as calling @$array_of_5k_items[“x”]
FINALLY!!!! “Directive ‘magic_quotes_gpc’ is deprecated in PHP 5.3 and greater”
RT @jasonfried “Working extra long hours doesnʼt mean you care more or get more done. It just means you work more.” — agreed.
dammit, @gilesgoatboy - now you just made me fat! it’s a zero sum game!
So, $class::$method() syntax actually doesn’t parse until PHP 5.3, which means I can’t develop my work project using my own framework. :-(
unexpected T_PAAMAYIM_NEKUDOTAYIM means $class::$method() == PARSE FAIL in PHP 5.2.4 — GRRR my mixin code *doesn’t* work in <= 5.2.4 >.<
is_callable(‘a_function’) is more than 3 times as expensive as dispatching a call to a_function() in PHP.
Why is it that every time I use SOAP now, I feel dirty? Irony?
2 tags
Mixins in PHP that actually work
UPDATE: The following apparently only works with PHP 5.3 and later due to the $class::$method() syntax causing a parse error in prior versions.
The only way to get $this keyword to work properly with a Mixin approach in PHP is to use an explicit ClassName::MethodName construction from within the delegating __call method. This means literally having to express the positional arguments for each...
Working with immutable classes in PHP pushed me to start writing methods as external functions; all of a sudden I am using CLOS to do PHP OO
OH: “If you have a class that needs redefining on the fly it means you didn’t design it well enough in the first place” another kitten dies.
PHP experts, do you know if autoloading literally hits the filesystem every time even if the source.php file remains unchanged? #php
Get Your API Right: http://bit.ly/10onJJ Good article.
Heredocs really should allow for preservation of the indentation level of initial line. So ugly. It’s not just PHP that fails at this.
__whatever() is a code smell.
Why is there even a “debate” about HTML 5 specifying a video codec? Shouldn’t HTML 5 be 100% agnostic with respect to codecs!? WTF? #html5
Eric Evans on the State of DDD (Domain Driven Design) has some very interesting things to say about usability and sw dev http://bit.ly/lyTdO
PERMANENTLY OUT: using the prefix “Active” for new libraries.