次の方法で共有


Programming Languages Side By Side

I’ve been thinking about a parallel programming language textbook for a while now. Not for parallel programming but I’m not sure how to phrase it. What? OK let me explain. One of the popular Bible study tools is a parallel Bible where several translations are printed side by side with each other. That way someone can easily compare how different interpretation teams have looked at the same Bible verses. What I have been thinking about for some time is a textbook of sorts that covers multiple programming languages in a similar parallel fashion. Each concept would show side by side examples in multiple languages. This way students would see different implementations – different syntax – for the same concepts. In theory (completely untested so far) this would build both a greater understanding of the concepts and make it easier for students to transition from one programming language to another.

From there is gets complicated. What languages and how many languages? Handling C++, C# and Visual Basic seems like a logical easy combination since all three languages are built into the Visual Studio IDE. Is there enough of a difference in early stages between C++ and C# though? Certainly in some areas like class creation and OOP concepts. Should Java be included realizing that a second IDE would be required? How about something like Small Basic which is largely a subset of Visual Basic?

How about completely different paradigms? F# will be in the next version of Visual Studio so would permit the easy (ok relatively speaking) inclusion of a functional programming language. That might over complicate the book though. I need input on that one. Is it worth trying? Similarly how about a graphic beginners language like Scratch or Alice? Some concepts would not translate at all but some of the early ones would fit in nicely.

How about some historic languages like FORTRAN (still often used in scientific programming) or COBOL (still used for many legacy applications with believe it or not some new development still taking place)? Not sure about the development environments for those though.

Help me brainstorm on this a bit please. Are you interested in seeing something like this? What would it include to make it useful?

Comments

  • Anonymous
    April 09, 2009
    The comment has been removed

  • Anonymous
    April 09, 2009
    For my money, looking for languages all supported in a single IDE is a bit counter to the thrust of the idea. One of the things that makes side by side Bible translations so helpful is the range of viewpoints. Using multiple Catholic translations can be a bit illuminating, but when translations favored by very different denominations always helped me more. Similarly, I'd like to sse not a cluster around Visual Studio, but say C# vs Objective C vs Ruby vs Java vs Javascript vs Python vs ANSI C vs Smalltalk vs FLEX. You can't run all of them parallel through all examples, but if you pick the ones that best serve to illuminate a particular issue, it would really help in teaching. Of course if the book is going to be published by Microsoft, say, or Apple, then a structure that much more resembles a Bible study tool for Catholics or LDS members would be more appropriate. But recall that I was an agnostic who hosted the Bible study and discussions notesfile at DEC all those years ago and worked on PATHWORKS a product targeted at Vaxen, Macs and PCs and making them talk. I have a natural bias towards ecumenism in various realms.

  • Anonymous
    April 09, 2009
    I'd probably look for a third party publisher. I have written and published though Cengage in the past for example. Initially I assumed that people might want to create/compile/rn all examples but that may not be the case. So including examples from several languages and letting people select which ones to build might be a way to go.

  • Anonymous
    April 09, 2009
    Comparative languages are a great idea. I used to teach a course like this in our second year. The idea was to get students thinking about other paradigms, and how languages are influenced by the aims and priorities of their designers. At the end I got everyone write a pitch for a particular requirement as a representative of a given language, I remember some really good submissions from companies like "Eiffel Experts" and "Smalltalk Systems". Great fun. If it was me I'd look at Smalltalk (objects with everything), C/C++ (speed and danger), Prolog (just the facts and rules ma'am), Forth (polish Reverse?), F# (functional fun) and JavaScript(because it's there, OK). I wouldn't make that much distinction between C# and VB.NET really, because they have so much in common. I would not make this an introductory text. It is best to teach one programming language well (my preference is C#) and then move into the craft of programming later. I would see it as something you read once you thought you knew what programming was about.....

  • Anonymous
    April 09, 2009
    Older parallel-text Bibles, like the Complutensian Polyglot Bible of the early 16th century, don't have parallel translations, but, rather, have the text in different languages: Hebrew, Greek, Latin, etc.

  • Anonymous
    April 09, 2009
    The comment has been removed

  • Anonymous
    April 09, 2009
    It would appeal to me if it was a side-by-side of a mainstream language vs. a newer less-well-known language.  The perfect scenario for me would be C# vs. F#, and the book would basically be a "learn F#" book for people who already know C#. Depending on how you implement it, you may have to stick with different languages in the same world (.NET for example), so that the code really does the exact same thing, from two different languages' points of view. If you tried to compare something like C# and Java, for example, you'd find issues on any non-trivial code when C# uses the .NET BCL since it's not in the Java world, and anything that uses the Java base classes since they're not in the .NET world.  You'd be showing how to accomplish tasks in both languages, as opposed to how to accomplish specific lines of code in another language.  Then it's just more of a "how to accomplish task X in language Y" book, except with two languages.  For example, reading text from a textfile - there are a dozen ways of accomplishing this in .NET, and probably as many ways of doing it in Java - but do each of the strategies map one-to-one between the two languages, when talking about side effects, file locking, how the text is stored in memory, etc.? For my money, I'd say C# vs. F# would be an amazing tool for C# developers to learn F#.  (Same on a lesser scale for C# vs. VB.NET, or C# vs. MC++, or even C# vs. J#).  The idea of comparing unrelated languages would be interesting, but in my opinion, not as special as C# vs. F#.

  • Anonymous
    April 09, 2009
    The comment has been removed

  • Anonymous
    April 09, 2009
    Rosetta Code is my site.  I've been meaning to programmatically export PDFs on a quarterly basis, and sell hardcopies via a POD service as a kind of fundraiser for it.  Haven't gotten around to it for a combination of technical, temporal and financial reasons. The content is GFDL, of course, and I would honor the license right down to listing contributors.  I'd be happy for advice or assistance; As it was, it was going to be little more than an arrangement of the best task pages, for some heuristically-determined value of "best". (Perhaps based on popularity determined from analytics data, or by example count.  Not sure.  Plenty of ideas and options.)

  • Anonymous
    April 10, 2009
    You must be a VB programmer if you think that C++ and C# are similar enough to be able to omit one or the other. :o) Needless to say, I would keep both.  In addition to the language differences, these two languages also differ in terms of the libraries that are used.  Specifically C++ developers typically use the standard C and C++ libraries, whereas in C# of course you're using .NET.  Big difference there, even for getting started. I think Java is also important, due mainly to its popularity.  If you cover C/C++, C#, VB, and Java, you've covered probably 3/4 of the market.  I think it is a mistake to try to go into the "long tail" after that. Maybe some other commenters already mentioned this, but IMO the majority of the learning curve in learning a new language is learning the APIs of the supporting environment.  For example, I've been using C++ for about 20 years, and I consider myself an expert in that language.  Many of those years have been programming against the Win32 APIs, and I have to admit, I still need to refer to MSDN quite a lot when calling Win32 APIs.  Same for C# and .NET.

  • Anonymous
    April 10, 2009
    You must be a VB programmer if you think that C++ and C# are similar enough to be able to omit one or the other. :o) Needless to say, I would keep both.  In addition to the language differences, these two languages also differ in terms of the libraries that are used.  Specifically C++ developers typically use the standard C and C++ libraries, whereas in C# of course you're using .NET.  Big difference there, even for getting started. I think Java is also important, due mainly to its popularity.  If you cover C/C++, C#, VB, and Java, you've covered probably 3/4 of the market.  I think it is a mistake to try to go into the "long tail" after that. Maybe some other commenters already mentioned this, but IMO the majority of the learning curve in learning a new language is learning the APIs of the supporting environment.  For example, I've been using C++ for about 20 years, and I consider myself an expert in that language.  Many of those years have been programming against the Win32 APIs, and I have to admit, I still need to refer to MSDN quite a lot when calling Win32 APIs.  Same for C# and .NET.

  • Anonymous
    April 10, 2009
    Mr. Thompson, the term you're looking for is "<a href="http://en.wikipedia.org/wiki/Program_Chrestomathy"program chrestomathy</a>." If you're wondering which languages you should include, it depends on what you're trying to accomplish.  Are you trying to teach your reader how to learn to adapt quickly between languages of similar paradigm and idiom, or are you trying to teach your reader to consider multiple paradigms while coding and potentially recognize when a different paradigm might be more suited to a given task? I can think of a book structure that might accomplish both.  Take three <a href="http://www.rosettacode.org/wiki/Language_Comparison_Table">paradigms</a>, and find two (perhaps three) languages for each paradigm.  Then create a series of 48 tasks, and solve them in each language for the paradigm you've chosen.  When laid out in the textbook, each of these tasks would be missing one or more of the examples you prepared; The exercise for the reader/student is to find an appropriate solution for the missing language(s) for each task.  The Instructor's Edition would contain all of the missing code, but with the caveat that the student's submissions needn't be statement-per-statement identical with the solution code. Personally, I think having more than one language per paradigm is important, at least in the training phase, to help the student identify and distinguish where a program written in a functional programming language is different from a program written in an object-oriented language because of the paradigm, and not just because of differences in the language syntax. And don't worry too much about the development environment.  Yes, it would be nice if you could package Visual Studio Express with the book.  But that doesn't preclude you from including ActiveState Python, MinGW (It's not just a C/C++ compiler) or GHC.  Throw in JEdit to provide a more comfortable editing environment in the languages that VS doesn't support. As far as language and syntax comparisons within a paradigm set, beware the dangers of strict translation; Yes, you can get code that works in both languages, but it's not likely to take advantages of the features that each language provides to make the programmer's job easier and his code more elegant.  In fact, this is why so many languages (C++, Python, Perl, etc) have support for multiple paradigms baked into the language; They know There's More Than One Way To Do It, and allow the programmer to find and use the best one for the problem at hand. For a set of paradigms, I would suggest considering declarative/logic programming, functional programming and procedural programming.  Object-oriented programming <em>might</em> be a useful thing to compare against, but I'm not sure how many common procedural languages <em>don't</em> have OO coding as part and parcel to them; The only common case I'm aware of is the use of C for kernel-level and embedded programming. If you're interest isn't in academic training of thought process flexibility, but rather in the ability to switch back and forth between languages of similar paradigm (Which is likely to be a much more marketable book), then I would probably go with C++, Java, C# and either Ruby or Python. Likely Python; While there is certainly a lot of buzz around Ruby, and there are certainly plenty of job opportunities out there for Ruby programmers, I tend to see more useful code written in Python.

  • Anonymous
    April 11, 2009
    The comment has been removed