Building a Programmer's Rosetta Stone
Did you ever run into the problem where you knew how to do something in one programming language, but really needed to do it in another? That's what Rosetta Code is all about. A variety of programming tasks are solved using as many languages as possible. You can examine existing tasks, or create your own.
Posted to Technocrat.net- as I'm "semi-paid contributing editor" there, it hit the front page immediately of course.
SJW: a person who perceives an injustice, and while correcting it, commits a greater injustice.
Also check out 99 bottles of beer and Hello World Collection.
It's already been done. Planet Source Code does this already, and it's been around for ages. You can find code examples and complete projects.
Then for projects in the .NET set there are a number of online translators that do C#VB.NET. Very good for moving code between different types of projects.
Now, something that would be truely useful would be a service that would do translations from a wider variety languages.
Politics is the art of looking for trouble, finding it everywhere, diagnosing it incorrectly and applying the wrong fix.
I would be happy to see other types of programming represented in Rosetta Code. I only included what I already knew. Rosetta Code should be about many things I don't already know. Once the server's no longer slashdotted, stop by blog.rosettacode.org, and I'll make a point to bring up how to add your own programming tasks. (Really, you just have to add a template to the top of of the page. But there are some guidelines.)
tasks(723) drafts(105) languages(484) examples(29106)
Apple, which currently has a product called Rosetta, which allows PPC code to be executed on Intel chips by translating it dynamically or something.
I had to get it started. My hope is that other people will contribute with languages (and tasks) that they know.
tasks(723) drafts(105) languages(484) examples(29106)
Did you even bother looking at the site first? Perhaps not as it's slashdotted. The idea isn't bad, but it's just a nearly empty wiki. Not many languages, and looking at some tasks, most of the stuff wasn't very useful. For example, I looked at the file I/O task, and there were no versions for C, C++, Java, C#, VB (not that I'd want that), PHP (idem) nor anything like that - but there was a mIRC scripting version...
Might be worth posting somewhere once there's actual useful content, but just not now.
But then again, I'm sure the editors didn't even look at it either before posting. There's nothing news worthy or interesting there - yet.
Rosetta Code takes the concept behind Hello World, and spreads it to other tasks. At any rate, I think this site has already encountered a problem which is only going to escalate as it grows: code isn't cross-indexed properly at all. For example, there are many "programming tasks" with solutions in C, but there is nothing on the C page. I think this problem stems from the fact they used MediaWiki. Actually, this is (almost) intentional. I want people to be able to learn about the languages they're using. I've been filling in the pages as I've had the opportunity. (I'm a full time college student, and president of a student organization.) Check the page on GCC, for example. MediaWiki's great for something like... well, Wikipedia. But it doesn't support a cross-referenced database like this. The wiki concept is good for this site, but the server needs to be running some software designed better to the task. I'm open to suggestions. (And assistance, if it'll go that far.)
tasks(723) drafts(105) languages(484) examples(29106)
Sourceforge has hosted to Programming Language Examples Alike Cookbook project for a while now. It does something similar, filling out "Perl Cookbook" recipes for a fairly wide range of languages...
http://pleac.sourceforge.net/
Why?
Your C-language for-loop example uses the same crappy example as nearly every crappy text of the "learn C in 7 days [assuming you already know BASIC)" genre. Giving the first example this way --- as "a for-loop is something that counts, here's how you make it count" is
A for loop in C is simply the exact, beautiful, expression of the iteration concept: See? Has nothing to do with numbers.
You're saying: execute LOOP_INITIALIZER, evaluate LOOP_INVARIANT, if it's true, perform EXPERSSION, evaluate PROPELLER and go back to the part of this sentence where we evaluated LOOP_INVARIANT.
Because of this craputidinous teaching, I am constantly faced with programmers who cannot understand a loops of these types: ...and these people have freakin' degrees in computer science. That final (contrived) example, BTW, is a fine way to avoid doing stupid shit like .... So: Why is the for-loop superior in every way to this while loop example?
Look carefully.
Loop control in the for statement is on the same line of code as the loop-construct keyword. In the above while-statement, loop control is at the beginning, middle, and end of the block. That's just BEGGING for a maintainer error. Yet 99 out of 100 C programmers prefer the second form... because it looks more like BASIC... they don't understand the beauty of the for-loop... they simply think ("Oh, I don't have any numbers to count, so I'd better use a while-loop"). That's CRAP! It's broken thinking, and it encourages buggy programs.
It all comes down to people teaching to the lowest common example [denominator], rather than actually exploring the concepts behind the language.
Do daemons dream of electric sleep()?
In short, our Tables of Contents are automatically updated for us by the wiki engine. It's cool. This is find for data that has a very general structure, such as an encyclopaedia or a manual of some kind. But the Rosetta Stone concept is highly structured, cross-referencing programming languages with programming problems, and it seems to me as if this cross-referencing would be better done automatically, rather than making several Wiki pages and maintaining them manually. The site concept would be better suited to some sort of customised CMS, or perhaps something designed from scratch. The benefit of using a wiki, and why I chose to use it, is that in each of these intermediary pages, one can place descriptive information about the relationship. The net effect is that an encyclopedia forms around the structured data. This has only happened in a couple places, such as the page about LAMP, and the page about GCC, but it's something I want to see continue.
tasks(723) drafts(105) languages(484) examples(29106)
for the site to come back, you can use this.
"Beware of he who would deny you access to information, for in his heart he dreams himself your master."
There is the PLEAC (Programming Language Examples Alike Cookbook) which uses (or should use) the same examples for many programming languages.
Many languages are close to complete the provided examples.