Live data from Hacker News

Five languages in seven lines, or how not to do web development

docs.google.com

11–20 of 23 posts

Re: Five languages in seven lines, or how not to do web development

#11
post #10

Nothing wrong with this example. Would you rather see XSLT? Really?

There are other ways to build HTML without templating. Take a look at Template::Refine, for example:

http://search.cpan.org/~jrockway/Template-Refine-0.02/lib/Te...

http://search.cpan.org/~jrockway/Template-Refine-0.02/lib/Te...

(Those are two different examples, which is unclear due to news.yc's URL truncation.)

Re: Five languages in seven lines, or how not to do web development

#12
Even when using serverside javascript, you still end up with at least 4 languages; javascript, html, css and occasional sql queries.

Rails is actually not that bad, letting you use ruby for everything from javascript and html templates to sql queries and configuration. The future is languages that can be tweaked to express anything like lisp, ruby, python, groovy and one day also javascript.

Re: Five languages in seven lines, or how not to do web development

#13
post #4

Earlier quoted context omitted.

Yeah I don't see the beef either - what is the counterpoint "ideal" way of doing it? One language? Because you'd have to select HTML by default... And I'm guessing that might not make for the best user experience. Also surprised they didn't include (implied) CSS.

I think you need to at least move the JS out and write it unobtrusively. Sticking 'onClicks' all over the place inside a templating language is a recipe for spaghetti.

Sure, but the point is, to put together any decent web page template, you'll need at least:

1) Your server-side language (e.g. Ruby)

2) Your templating language (e.g. ERB, which may be very similar to 1)

3) HTML

4) CSS

5) Javascript

5 languages is pretty much a minimum unless you're doing something trivial. I'll agree that the onclick should be extracted, but as has been pointed out in other places, this is a quick documentation example, so it is reasonable to use onclick there to keep it brief.

PS: Also, perhaps worth pointing out that HTML and CSS aren't actually programming languages... Should they count? probably not.

Re: Five languages in seven lines, or how not to do web development

#15
post #2

Truth be told, it's not too bad considering all it does. Each language is being used for its strengths. Programming at that level requires HTML and Javascript. Python is integrated as part of Mako; calling them separate languages is valid but questionable. (Given that the author is maximizing the number of languages, I'm a little surprised jQuery wasn't included in the list.)

I wouldn't call jQuery a language. jQuery is JavaScript.

Re: Five languages in seven lines, or how not to do web development

#16
post #15
post #2

Truth be told, it's not too bad considering all it does. Each language is being used for its strengths. Programming at that level requires HTML and Javascript. Python is integrated as part of Mako; calling them separate languages is valid but questionable. (Given that the author is maximizing the number of languages, I'm a little surprised jQuery wasn't included in the list.)

I wouldn't call jQuery a language. jQuery is JavaScript.

library/frameworky thing. It's not javascript though. Try getting help with a jQuery question in #javascript...

Re: Five languages in seven lines, or how not to do web development

#17
post #13
post #4

Earlier quoted context omitted.

I think you need to at least move the JS out and write it unobtrusively. Sticking 'onClicks' all over the place inside a templating language is a recipe for spaghetti.

Sure, but the point is, to put together any decent web page template, you'll need at least: 1) Your server-side language (e.g. Ruby) 2) Your templating language (e.g. ERB, which may be very similar to 1) 3) HTML 4) CSS 5) Javascript 5 languages is pretty much a minimum unless you're doing something trivial. I'll agree that the onclick should be extracted, but as has been pointed out in other places, this is a quick d…

They're still languages, so I think they should count, because it still takes a mental context switch when going from any language to another.

Re: Five languages in seven lines, or how not to do web development

#18
post #13
post #4

Earlier quoted context omitted.

I think you need to at least move the JS out and write it unobtrusively. Sticking 'onClicks' all over the place inside a templating language is a recipe for spaghetti.

Sure, but the point is, to put together any decent web page template, you'll need at least: 1) Your server-side language (e.g. Ruby) 2) Your templating language (e.g. ERB, which may be very similar to 1) 3) HTML 4) CSS 5) Javascript 5 languages is pretty much a minimum unless you're doing something trivial. I'll agree that the onclick should be extracted, but as has been pointed out in other places, this is a quick d…

The number of languages isn't the issue. The issue is putting them all together in the space of a few lines.

It's bad organization.

Re: Five languages in seven lines, or how not to do web development

#20
post #15
post #2

Truth be told, it's not too bad considering all it does. Each language is being used for its strengths. Programming at that level requires HTML and Javascript. Python is integrated as part of Mako; calling them separate languages is valid but questionable. (Given that the author is maximizing the number of languages, I'm a little surprised jQuery wasn't included in the list.)

I wouldn't call jQuery a language. jQuery is JavaScript.

jQuery is JavaScript in approximately the same way CLOS is Common Lisp. Sure, jQuery is implemented in and uses JavaScript, but idiomatic jQuery differs enough from idiomatic JavaScript that it might be considered another language.

...And, if that handwaving fails to convince you, jQuery's selector string format is at least as much a language as the pager formatting string that merits its own language in the article. :)

Post reply on HN