News for hackers. Stuff that matters.

tig

Re:The Arc Challenge by Jim Weirich on Thursday February 07, 2008 @08:40AM (#110902)
Yes, you can create an environment in every language to help you write very short web-apps. I still dont get the point Paul wants to make with his Arc example. Your Ruby solution looks a lot more readable to me. Also my PHP solution, which is here: http://news.ycombinator.com/item?id=108625

Maybe Paul wants to elaborate, what from his point of view the advantages of his ARC example are?

Re:Take the Arc Challenge on Sunday February 03, 2008 @06:35AM (#108625)
PHP:

  if ($S['foo']) echo "you said {$S['foo']}";
  elseif (PtoS('foo')) link('said','click here');
  else form('foo');
For me, making programs short is not a design goal. But if it would, I would do it like above. My framework then would include this functionality:

  S[] contains all session variables
  P[] contains all posted variables
  PtoS copies an entry from P to S. Returns false if P was not set.
  link() prints a link
  form() shows a form with the given fields. target is the current url.