TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

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

42 pointsby siong1987about 16 years ago

10 comments

jclabout 16 years ago
Truth be told, it's not too bad considering all it does. Each language is being used for its strengths.<p>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.)
评论 #492421 未加载
评论 #493078 未加载
psadauskasabout 16 years ago
So in Rails best-practices, you'd still have 3 "languages", they'd just be spread around in 3 files.<p>I'm a Haml fan, so I'd have a view template like:<p><pre><code> = paginate(@employees) %ul - @employees.each do |employee| %li = employee.first_name = employee.last_name </code></pre> and then a helper to fill out the "paginate", or some plugin to handle it for me, and finally an unobtrusive js file.<p>So I get 3 languages. The only real WTF I see here is the "onClick", and for an example in some documentation about a framework, its forgivable. Could also be broken up into separate files, because the pagination part is a bit complex for a view. Again, though, its a documentation example, on the paginator helper, no less.
s3grahamabout 16 years ago
I think "$('#my-page-area')" is #6 actually (doing a CSS-style selector probably via jQuery or something)<p>I'm not sure that it's "how not to do web development", but it's certainly "this is common: what's a better way?".
daticoabout 16 years ago
The point as I see it, normally one thinks of programming in "a" language, not 5-7 at once! Just imagine trying to rewrite this paragraph in multiple foreign languages...let's see, nouns in Japanese, verbs in French, adjectives in Russian, and the remainder in Taglish? Illustrates just how demanding web development is. And consider, not only are there best practices to follow for each real language, the conclusion reveals there must be implicit best practices (or at least opinions) for mixing them as well.
thomasflabout 16 years ago
Even when using serverside javascript, you still end up with at least 4 languages; javascript, html, css and occasional sql queries.<p>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.
gaikaabout 16 years ago
Bug in parsing: line 2 is mostly javascript, not mako.
biohacker42about 16 years ago
Python, JavaScript and HTML puts you at 3 and that's the least you need for web development.<p>Or are you supposed to do nothing but back end in Python, or just HTML front ends?
mcavabout 16 years ago
Nothing wrong with this example. Would you rather see XSLT? Really?
评论 #492750 未加载
axodabout 16 years ago
What's even more worrying is people posting here defending it. It's plain ugly.<p>Call me old fashioned, but I'm pretty much a one language per file guy.
评论 #494403 未加载
bhigginsabout 16 years ago
yikes, missing two languages. everyone knows number of lines should equal number of languages.
评论 #492602 未加载