Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Twitto: A web framework in a tweet (twitto.org)
48 points by kenver on March 6, 2009 | hide | past | favorite | 24 comments


How about (secure?) OO version (with no error handling)?

  $c=new ReflectionClass('co');$m=$c->getMethod($_GET['m']);if($m && $m->isPublic()){$i = $c->newInstance();$m->invoke($i);}
Example usage:

  <?php
  // "Framework"
  $c=new ReflectionClass('co');$m=$c->getMethod($_GET['m']);if($m && $m->isPublic()){$i = $c->newInstance();$m->invoke($i);}

  // Controller
  class co 
  {
  	public function index()
  	{
  	    echo "index!";
  	}
  
  	public function test()
  	{
	    echo "yes, it's test.";  
  	}
  }
  
  ?>
Call:

example.com/?m=index example.com/?m=test


How about (secure?) OO version

Nice. You should call it TwitOO.


I'd have been more impressed if he also write a 2-line ORM based on SQL statements fed from browsers.


I was going to give you a lecture on why that's a ridiculously bad idea. Then I noticed your username. Then I went back and looked at the code. I see now.


Mine is a subtle humor.


love this line: » TWITTO IS NOT SECURE, DON'T USE IT FOR YOUR NEXT WEBSITE «


Yeah, because you see, Twitto is a web framework you can't use for web development. That makes it the coolest web framework around.


but you may use it for your current website


For some reason that warning makes me want to build something with it even more!


this is why i like hacker news: anything about PHP gets downvoted into oblivion on reddit.


One of the symptoms of Reddit's takeover by the same kind of idiots that comment on YouTube was the knee jerk downmod of any non-derisive mention of PHP. I hope the fact the parent comment is downmodded so quickly doesn't mean those people have arrived at HN too, now.

IMHO, attitude towards PHP is a great way to tell if someone really codes or just quotes the current hype. People that actually build stuff appreciate PHP's ease of deployment and scaling, even if its weaknesses make many coders (self included) choose other tools most of the time.


"IMHO, attitude towards PHP is a great way to tell if someone really codes or just quotes the current hype. People that actually build stuff appreciate PHP's ease of deployment and scaling"

I don't agree with this. Yes, everyone knows PHP is easy to deploy, and it's faster than the ruby/pythons etc. But it's an ugly mess with a long history of security problems and a design that flows against the principles of well designed architecture. I know plenty of people who "really code" and abhor PHP.

I know what you mean about "trendy" language snobbishness being a hallmark of someone who doesn't actually know what they're talking about, but in PHP's case I think there is a case for informed people having strong, negative opinions.

Doesn't excuse the Reddit behaviour, of course, I don't miss that one bit. Just sayin'...


Or maybe it's just because they spent lots and lots of hours doing things that made PHP (and thus them) cry.

When you spend every day for months writing methods like __get and __set and so on, and try to work around the other busted aspects of the object model, it can get to you.


Maybe the parent comment was downmodded so quickly because it adds nothing to the conversation (except self-congratulation).


Moot point. We can't downvote submissions here.


Yeah, but there's a distinct difference between the way this is handled in HN and the automatic "Beh, PHP!" in Reddit.


too bloated, but nice hack


It doesn't scale, either


I thought Perl was supposed to be the king of really low char count code!

(Sorry for the alliteration.)


One should never apologize for alliteration. It is a joy to stumble upon.


So what exactly would I use this for. Aside from shitting myself with geeky-ness


I think the point is that PHP is a web framework by itself and there is no need for a fancy framework around it.


You shouldn't be using it for anything.


cute




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: