4 ms·
The trick is to go far enough to improve readability, but not so far that the programmer has to remember all the metaprogramming or (worse) why you did it in th
by zedshaw 16y ago
The trick is to go far enough to improve readability, but not so far that the programmer has to remember all the metaprogramming or (worse) why you did it in the first place.
- drats 16y agoSpeaking of "make things as simple as possible, but not simpler" what do you think of Flask?[1] [1]http://flask.pocoo.org/ http://flask.pocoo.org/
- krakensden 16y agoHey hey, don't leave out Bottle[1], its inspiration. [1]http://bottle.paws.de/ http://bottle.paws.de/
- rincewind 16y agoWhat exactly is your problem with the Arc code? Is it that the code that handles the form comes before the code that writes the submit button? The problem is not that you have to remember the metaprogramming. I do not know what exactly `aform` expands into, but it works for me and I know what it is supposed to do. (Yay, I can make an argument from ignorance too) I would still rather use Mongrel2 than Arc in production, but readability is not the problem.
- zedshaw 16y agoWell it was mostly a joke, so you can loosen your booty a bit and have a laugh. But, having worked with the average programmer and written a book for newbs I'd say the Arc code is just harder to use.
- jules 16y agoI find the Arc version much more readable, even though I have never used Arc. It pretty clear that (aform <x> <y>) is generating a form with <x> as the target page and <y> the form itself. (onlink <x> <y>) is a link with text <x> and target page <y>. I think you got a WTF because you're thinking about a web application as a bunch of HTTP requests, instead of thinking about it at a higher level. For example you're thinking about a link like this: 1. When the user clicks <a href="url-of-the-target-page">blah</a>, he gets sent to url-of-the-target-page. 2. When the webserver sees a request to url-of-the-target-page, it does X. Arc does not force you to think at the HTTP level: 1. When a user clicks a link (onlink "blah" X), he gets X. Also, your code is not 23 lines. You are not counting the templates, which will probably double your code. Does your Tir code handle multiple requests? Does it handle the back button?
- zedshaw 16y ago> I find the Arc version much more readable, even though I have never used Arc. I find the intellectual dishonesty of fanbois irritating.
- icey 16y agoSurely people can have differing opinions without being intellectually dishonest, right?
- jules 16y agoA Roman and an Arab meet. The Arab: Look how easy this is: 1234 + 4321 = 5555. The Roman: I don't understand that. It's probably a trick, it only seems quick. How could anyone ever understand that? Look, this is understandable even though it is a little more characters: MCCXXXIV + MMMMCCCXXI = MMMMMDLV. In what way am I being intellectually dishonest? That you (along with the 6 people that upvoted you) don't understand the Arc code doesn't mean that I don't. If anyone is being intellectually dishonest it's you. You are dismissing a piece of code that you don't even understand, and do not even try to understand. Then when somebody comes along and says that he finds the 4 line piece of code easier to read than your 40+ line piece of code, you claim he's lying. FWIW, I have written a (toy) continuations based web framework in Ruby (the same technique Arc is based on). So when you still don't believe that I understand the Arc code and find it more readable, what can I say? Open your mind and try to understand how continuation based web programming works. It's not that hard. Then you'll understand real reasons why it doesn't work well in practice and you'll be able to write some honest criticism of it (and as a bonus you'll understand why news.yc sometimes gives you "request timed out" errors). Heck, I'd claim it doesn't work at all in practice in it's current rendition for the vast majority of sites. Would you still call me a fanboi? And you didn't answer my questions.
- FraaJad 16y agoIndians invented the positional numbering system. Arabs only introduced it to your part of the world.