Slashdot Mirror


Hope For Multi-Language Programming?

chthonicdaemon writes "I have been using Linux as my primary environment for more than ten years. In this time, I have absorbed all the lore surrounding the Unix Way — small programs doing one thing well, communicating via text and all that. I have found the command line a productive environment for doing many of the things I often do, and I find myself writing lots of small scripts that do one thing, then piping them together to do other things. While I was spending the time learning grep, sed, awk, python and many other more esoteric languages, the world moved on to application-based programming, where the paradigm seems to be to add features to one program written in one language. I have traditionally associated this with Windows or MacOS, but it is happening with Linux as well. Environments have little or no support for multi-language projects — you choose a language, open a project and get it done. Recent trends in more targeted build environments like cmake or ant are understandably focusing on automatic dependency generation and cross-platform support, unfortunately making it more difficult to grow a custom build process for a multi-language project organically. All this is a bit painful for me, as I know how much is gained by using a targeted language for a particular problem. Now the question: Should I suck it up and learn to do all my programming in C++/Java/(insert other well-supported, popular language here) and unlearn ten years of philosophy, or is there hope for the multi-language development process?"

39 of 371 comments (clear)

  1. It's a big umbrella by cptdondo · · Score: 3, Interesting

    You can do either. Either way you gain and lose. I personally have a hard time with the kitchen sink approach, preferring C as my programming environment. This leaves me in the cold as far as contributing to, say, mythtv, but then I can contribute to other projects, like lirc.

    So it all comes out in the wash. When you come to a fork in the road, take it.

    1. Re:It's a big umbrella by jerep · · Score: 3, Interesting

      I agree, I've done both a lot of shell scripts, web scripts and compiled languages programming; it all comes down to what your goal is, there's no perfect combination of languages for every scenario.

      Personally I prefer having a core program written in a compiled language (C++, D), with a bundled library for scripting (LUA, Python) for I do mostly cross-platform programming these days.

      However, when doing system admin tasks and automation, nothing beats shell scripts, it takes too much time to write and maintain compiled executables for simple tasks.

      On a side note: I also recently found out about rdmd a few days ago, you might want to add that to your shell's arsenal ;)

  2. Depends, really by Shados · · Score: 4, Interesting

    Not really "tool based" programming like the unix stuff that was mentionned...but for example where I work, they combine languages. Our .NET stuff will be a mix of raw intel assembly, managed C++, C#, and F# for the algorithms. Mixing purely functional languages with procedurals languages with some functional features seem to be gaining momentum in algorithm heavy fields.

    Then there's the occasional java program that will invoke perl scripts for jobs, for example.

    Its definately there for large projects. Its just that with the power of more modern environments, the projects have to be MUCH larger before they start warranting to take the overhead of mixing languages/tools to gain efficiency. The extra tools, testing, integration, installation, dependencies, etc that are involved are not worth it for "small" projects (and again, by today's definitions, a "small" project can be quite large, hehe)

    1. Re:Depends, really by Shados · · Score: 5, Interesting

      I was introduced to functional programming via C# 3.0, with the lambdas, LINQ, and better delegate support. Not quite "real" functional programming, but its a nice gateway drug, and have been hooked since then (thats background info just to say I'm no expert, but no dummy either).

      F# is pretty slick. Its basically a "real" functional language, that still allows it to be easy to integrate with "real business", including databases, IO, and has great support for tooling since its based on .NET. So its pretty much the "perfect" functional language, for the "real" world. (I know many are better from a theoretical or scientific point of view, but i'm talking purely pragmatic here).

      That said, I didn't use it much. What I can say, is we have an army of PhDs implementing -extremely- complex algorithms here (functions being passed around with several douzens levels of nested function types, to do very, very complex modeling in a couple lines of code...), and they swear my F# now (they've been using it since early technology previews, and are getting ready to push large amounts of code in it in production...its working awesome, supposingly).

      Sorry I'm vague on the details... but what I can say, is its good enough for one of the largest linux-centric company in the world to shift some of its code to it. Nuff said :)

    2. Re:Depends, really by Shados · · Score: 3, Interesting

      Very good question. I personally looked at Scala and thought it looked pretty good, but that I didn't try at all (just read the documentation). If I had to guess, I'd say its a mix of Microsoft support (which, while I know i'm saying this on Slashdot, is actually pretty damn good, and you have tons of support calls included with MSDN subscriptions, volume licensing agreements, etc), the fact that the language is just really well designed, the better, faster interop with native code (so if you have to do something in C/C++/Assembly, you won't lose 90% of the performance bonus in the interop layer), and that some of these algorithms have to be integrated with thick client software on desktop machines, as Office plugins, etc.

      The last 2 are probably the biggest deal. You know for sure you can interop (well) with anything and everything, that it can run on the servers (most are Unix, and its by far the preference, but we can put a Windows server without affecting users if we really need to) and on the client integrated with basically anything. Almost anything that can be extended will support some kind of COM/COM+ or .NET interop model of some kind. Doing it with Scala is not impossible, but far more annoying. And if the F# code needs to be distributed, WCF tends to be better than many alternatives, etc etc.

      So in short (and again, its just a guess. I always tend to be quite curious too when a Windows solution gets selected over a Unix one, since we're not locked in on Windows much if at all), easier to extend, and better corporate support.

  3. StupidPeopleTrick by StupidPeopleTrick · · Score: 5, Insightful

    The more languages, the more of a pain for support, debugging, and dev hand-off. If the solution is going to make money, make time to think of how you can grow the business (I.E hire developers and develop a position description). Things in this perspective get ugly when you have 5 components developed with 5 different languages.. - SPT

  4. do not sweat it and enjoy! by jackb_guppy · · Score: 4, Informative

    The world ebbs and flow. One day it C, another RPG or CL or ADA or PHP or ...

    Do what you like to do.

    What you may want to, is join a project that is more inline with Linux as whole versus a single app. Ubuntu or another general distro, or help with a small single use distro like IPCop. They should be glad to have some one like you help out.

  5. One time..... by phantomfive · · Score: 5, Interesting

    One time at my company, a programmer who must have been in his 50s came in with a resume that had no less than 25 programming languages. I was interviewing him, so I asked him, "Which of all these languages do you like most?" I figured he'd have some nuanced answer dealing with precision in Ada or flexibility in Lisp, or the happiness of Perl. Nope. "Shell scripting" he said. My jaw nearly dropped. He said, "It easily lets me tie all these different building blocks together. No other language can do that." He didn't end up working with us but it was one of the most educational interviews I ever did. I like interviewing more experienced programmers, even if they don't end up working for us, just because something interesting ALWAYS happens. I could tell you stories........

    As for the question, I think in part he's right, it is good to have a separate mailer from the browser from the calendaring program, and have ways for them to communicate. Some systems do work in this way, for example, most chess programs will let you change your chess engines, separating the front end from the back. Might want to check how they do it. Other programs on OS X will let you manipulate variables and send messages using applescript or automator. Also, on OS X, there's no reason to not use awk or sed. But definitely learn C++ and Java, they're used everywhere and once you know one, the other's not too difficult.

    Maybe if you were more specific in the question you asked we could answer better? Or were you just trying to encourage all programmers on slashdot to program more modularly?

    --
    Qxe4
    1. Re:One time..... by FlyingGuy · · Score: 5, Insightful

      And the main problem I have found with young guys is they have absolutely no appreciation for talent and can't stand it when they are in a position to hire because quite frequently it eclipses their own by an order of magnitude (that's a gross generalization, of course, and not always true). But the by far the biggest problem I have found to be more and more true these days is that some kid manages to get himself hired because he has a degree in java, manages to keep his nose clean and then gets to hire more talent as the project gets bigger and in most every case they turn down anyone with a vastly superior skill set that was born more then 3 years before they were because they prefer a quiet well lit office that doesn't stink of BO and stale junk food. I might be wrong, but somehow I doubt it very much.

      Now you are probably thinking, "Must be some old fuck" and you would be right I am part of the over 50 crowd who has a very current skill set and has 30 years of programming experience to back it up. I am a consultant and I am frequently hired by CEO's and CFO's who are at their whits end with the "kids" that got hired by the other kids that got the job then decided the lights were brighter and more sparkley someplace else after talking management into using the latest and greatest hair brained library written in a language that uses tabs for scoping.

      Mostly what I am is a janitor, a very very well paid one, but a janitor never the less, cleaning up messes left by kids.

      Don't take offense because one of these days you (if you are any good) will be doing the same thing in 30 years and why? Not because you "need" the money but because you, like me, will hopefully have some ethics about our craft.

      --
      Hey KID! Yeah you, get the fuck off my lawn!
    2. Re:One time..... by swillden · · Score: 3, Insightful

      using the latest and greatest hair brained library written in a language that uses tabs for scoping.

      I'm with you for all but this. And, BTW, I'm 40, with 20 years of experience. I was skeptical about Python, but I've recently started working on a significant project written in it, and I think it's a fine language. It does require a decent editor to keep the indentation clean (and the recommended practice, BTW, is not to use tabs at all for indentation, only spaces), but assuming you don't abuse the dynamic nature of the language, Python code tends to be some of the clearest and most readable of any language I've used.

      Python is a fine language (and not a particularly new one, being roughly contemporary with Java). Like any sufficiently-powerful language, inexperienced programmers -- and especially very *clever* inexperienced programmers -- can make a huge mess.

      I'm sure that's little consolation when faced by such a mess, but (and I'm sure you're fully aware of this), the problem is the messmakers, not the toolset.

      --
      Note to ACs: I usually delete AC replies without reading them. If you want to talk to me, log in.
  6. Yes by H0p313ss · · Score: 5, Interesting

    Should I suck it up and learn to do all my programming in C++/Java?

    Yes.

    In my 10 years of professional development I've covered many languages, but the last three doing nothing but Java have been the happiest. The second happiest was doing nothing but C++. There's a wonderful economy of scale to focusing on a single technology, you don't waste time on the glue.

    --
    XML is a known as a key material required to create SMD: Software of Mass Destruction
    1. Re:Yes by Anonymous Coward · · Score: 4, Insightful

      meh...

      In my 23+ years of professional development, administrative and engineering roles, I've found that you stick to what you're best at, and learn new things in between...

      Unless the command prompt disappears, there will always be shell-scripting and that strung together happiness of well written, single-purpose shell scripts doing their jobs together as though a well orchestrated symphony.

    2. Re:Yes by harry666t · · Score: 4, Funny

      $ PS1=""

      Oh, no! The command prompt disappeared.....

  7. Eclipse by setagllib · · Score: 4, Informative

    Eclipse is a fantastic platform for multi-language development, especially if your primary languages are C, C++, Python, Ruby, etc.

    All you need to do is create a C++ Makefile Project, then use the makefile to wrap your build system (e.g. ant, scons, actual makefile, whatever). You can build any number of binaries and launch them (or scripts) from the powerful launch profile system.

    Basically, Eclipse projects have "facets" - they can cram in features from multiple language development kits and mostly remain compatible. You still sometimes have to do the glue work yourself, but in general C/C++/Python are very easy to mesh. It is therefore easy to have a project with C libraries being loaded by Python, and so on.

    --
    Sam ty sig.
  8. Python by Pope+Raymond+Lama · · Score: 4, Insightful

    You need to go no further.
    Python gives you the Rosetta stone for a project combining any other languages you'd like.

    It is a very high level development language, and does have a vast common library, able to "talk" tens of protocols, you can call directly any module compiled into a dynamic library with the CTypes module.
    Also, if your application or parts of it run in the Java VM, no problem, python is there in the form of "jython", enabling you to use this dynamic, multi paradigm and interactive language directly from inside the JVM, with all its standard library, plus full access to any java classes you have in there. Oh..you do you use .net? Ditto - there is ironpython!
    Ah, you need to exchange data from parents of your app in the jvm with native code in .CPP? Use libboost or ctyypes to interface python with the .cpp, and soem xmlrpc to talk with a module in the JVM (oh, it would take you 10, perhaps 12 lines of code to write two methods in python which use the standard library to talk back and forth between both running enviroments.

    Plus, connectivity with the automation interface of hundreds of other software - including OpenOffice, GIMP, Inkscape, all of KDE software through DCOP (kde 3) and DBUS (KDE 4), easy communication to any windows software which does havea COMM interface - and, it even works under GNU/other unixes - just run your windows app and win32 python under the wine emulator (the apps "think" they are ont eh windoews, but sockets and network ports are on localhost across windows and native apps)

    Anyway -- too much to try to write in such a shrot space. It obviously have all you are askign for and certainly goes beyond that.

    And, pronably you don't know Python yourself , or you would not need to ask such a question - souyou might have the impression itr is a "script" language jsut like some dirty linear scripting tools around one have to sweat a lot of hacks to insert a "for" and a "if" statement. Not such. It is multi paradigm and de-bureaucratized, but it supports a full OO model, written in from scratch, not shoehorned in a later stage of the language like happened with PHP or Perl. Everything in Python is an object. Even integer numbers, and it can give you more flexibility with your classes and objects with features such as meta-classes, computed properties, and such than the majority of OO languages out there.

    And before one says "ruby", just a thing: "readability counts"!

    --
    -><- no .sig is good sig.
    1. Re:Python by smallfries · · Score: 3, Insightful

      I'd agree with this completely. I've worked on a few large multi-language projects, and had to combine flavours of asm, C, C++, perl, prolog, bash, maple, haskell, java and a few others together to get what I want. After years of working this way, and stumbling over the questions posed in the article (integrating build processes, dev environment etc) I had my arm twisted into using Python. What a joy it has turned out to be.

      As someone with a background in functional programming (most of my PhD was implemented in Haskell) the "functional" programming support in Python is a bit barren - but list comprehensions and bound methods are powerful enough for most tasks. The shell integration is nice, and the regexps are simple enough that I hardly touch perl these days (thank god...). Sage replicates most of the functionality that I would use maple or magma for.

      A sibling (AC) poster complains that Python is not "the one true language" (tm) that the parent asserts it is. Well the parent makes no such assertion. I would assert that if you want a single True Language then Python would be a good candidate for you. But if you like multi-language programming then Python is good glue. Personally I like it as glue, shockingly other people may have different uses for it. Lastly, a general word on the whole monolithic application vs small tools in multiple languages. This isn't a new debate that has sprung up in the past decade. It has always been there. There isn't even really a debate, because the two approaches are building tools for disjoint sets of users.

      If you eat your own dog-food, it's vital that you have the quickest turnaround time possible on adding new features and trying out new ideas. In a sense you are continually prototyping, never finishing. You are your own end-user, although occasionally other people may pretend. As a result your target audience is highly literate in the languages that you are using, and wants to maximise the power of the tools with a programmatic interface. The unix-philosophy was constructed to service this case.

      If your target user is a non-programmer, who simply wants to be able to perform a task then you will need to wrap up the functionality in a non-programmatic way. GUIs are the best way (so far) of doing this. Because there is no intention of exposing an external call interface the overhead of mapping from language to language becomes pure overhead and there is a natural tendency towards a single monolithic language approach.

      The interesting gap between these two areas is when your target audience spans the non-technical and the technical. This is where monolithic applications with APIs and scripting interfaces appear. I've got to say that AppleScript is quite cute in this area, purely because it's pervasive enough that it reminds me of Arexx all those years ago...

      --
      Slashdot: where don knuth is an idiot because he cant grasp the awesome power of php
    2. Re:Python by Vornzog · · Score: 4, Interesting

      Just to expand on a couple of your points:

      But if you like multi-language programming then Python is good glue.

      If you eat your own dog-food ... You are your own end-user, although occasionally other people may pretend.

      If your target user is a non-programmer, who simply wants to be able to perform a task then you will need to wrap up the functionality in a non-programmatic way. GUIs are the best way (so far) of doing this. Because there is no intention of exposing an external call interface the overhead of mapping from language to language becomes pure overhead and there is a natural tendency towards a single monolithic language approach.

      Almost 100% of *my* code is python these days, but I use it glue together any number of my old scientific applications that are often written in C. You can turn an archaic, unusable program into a slick, modern GUI or web service with very little code.

      Most important here, though, are your points about who your target audience is. I think the submission author is missing that point, and it deserves to be made in no uncertain terms.

      I am a scientist and a programmer. When I am writing for myself, I want to spend time on my data, not my program. So, I bang something out unix style - command line only, text I/O, move on with life. Usually, that happens in Python, but it might be in C, R, MatLab - whatever. Programs from my PhD are almost strictly command line. My co-workers from that part of my life had to learn command line if they wanted to work with my stuff. And you know what? They all did. Some of them got quite good at it, and I had more than a few inquiries about learning to program - they all saw the utility of what I was doing.

      After finishing my PhD, I've worked a little for a start up and a government agency, both based on my PhD research. In both cases, I've played the role of the scientifically literate programmer. My users are somewhat tech savvy, but with few exceptions, they don't want command line tools.

      A few of my old tools are still in use, though, just because they do one thing so very well, and a handful of people took the time to learn them. In return, I save them hours every day, which make those few tech savvy souls very happy.

      The trend - what is likely to keep me employed for years to come - is building GUI/web programs for people who are good scientists, but don't understand.

      I take a hybrid approach. What my end user sees is a standard Windows GUI. They happily click buttons to find some raw data, and then their analyzed data pops up automatically in Excel.

      Behind the scenes though, my code is an amalgam of programs, most of which can still be run command line, just like they always could. The GUI code is wxPython, and it quite happily runs on Windows and Linux. I think it would run on a Mac, too, but I haven't had occasion to try it yet. It looks native in all of those environments, it never does anything to scare the users, and yet I can still do most of my analysis command line when I need to.

      I'm currently developing a DNA sequence database. User interaction will all be web-based, data analysis will largely be a mixture of Python, MatLab, and C programs behind the scenes. My users won't have to care how their data gets analyzed - it'll just magically show up in the form they need it. They focus on further analysis and interpretation. Given who my users will be, this is a Very Good Thing(tm).

      The point, though, is that my programming spans everything the submission discusses. These approaches aren't orthogonal. Pick the right one for the code you are working on.

      If you are coding for yourself or for very tech savvy scientists, stay command line. It's easier to code and debug, and you'll get more done.

      If you are selling to Joe Sixpack, a GUI with a Staples-style 'Easy Button' is probably the right choice. Add advanced options as stand-alone

      --

      -V-

      Who can decide a priori? Nobody.
      -Sartre

  9. Heh. I'd love to pick an environment by NotQuiteReal · · Score: 3, Interesting

    Sure, I'd love to pick to do "all my programming in X".

    I'd be even more productive, if I could just master "one thing". As it is, I have to use C, C++, C#, sometimes VB, perl, csh, bash, html, ASP.NET, AJAX, Qt, oh, forget it.

    I do ok, doing everything, jack of all trades, and fool at none (or something like that), but I have a nagging feeling that I'd be a GOD if I could concentrate on just one... or broke.

    Oooh, shiny! (wanders off)

    --
    This issue is a bit more complicated than you think.
  10. You can by Anonymous Coward · · Score: 4, Insightful

    Well, this ain't going to be a Slashdot pleasing answer, but .NET would seem to be the best environment for multi-language programming. There are also a number of languages that work in for the Java Virtual Machine. There's Groovy, Scala, Jython etc.

  11. Do both. by Skreech · · Score: 4, Insightful

    You already know one philosophy. You don't "unlearn" it by learning another. You just learn more. Gain experience!

    1. Re:Do both. by Tablizer · · Score: 4, Interesting

      You already know one philosophy. You don't "unlearn" it by learning another. You just learn more. Gain experience!

      I don't think that's entirely true. I find the more languages I know the more times I accidentally write a statement from the wrong language or pause because I mix up the syntax in my head and have to remember which was which. There are more erroneous paths for neuron signals to travel down. I congratulate you for having a photographic mind, but we are not all that lucky.
           

    2. Re:Do both. by pgn674 · · Score: 3, Informative

      Not necessarily. In psychology, interference theory proposes that people forget information because of competition from other material. One kind of interference is retroactive interference, which occurs when previously learned information interferes with the retention of new information.

  12. Cross platform programming and multiple languages by drolli · · Score: 4, Interesting

    Ok. Im not a CS genius, and a matter of fact i am seeing this from purely practical point of view. I am a experimental physicist, and as such i program measurement and evaluation software. I always (at least since 1999) work cross-platform, which means that all applicable parts (e.g. if i dont hav a daq driver for linux, then obvioulsy the application will have no daq) of my applications run on linux and on windows, be it just for easier testing.

    My experiences which worked turned out to be pretty much the generic one you would expect

    a) Use ANSI C (not C++) for the vectorized operations and interfacing to the system level
    b) use a cross-platform scripting language (in combination with SWIG). (tcl, python, jython)
    c) If you feel like it, use java.
    d) If you can affort it use a already existing Framework which does what you want (in my case: matlab)
    e) Refrain from anything platform specific, unless you have to use it.

    My best experiences in terms of multi-language+multi-platform where

    -tcl+C (Since i started to use tcl in 2007 i always wondered why i did not do that earlier. tcl/tk is lean, easy, fast and
    quite stable)
    -java+jython+C

  13. Yep by Sycraft-fu · · Score: 5, Insightful

    Becomes a real problem if the multi-language thing is more or less "You use what you like." So you get one dev who likes some obscure language and uses it for his little part. Everything works well so nobody cares. Then he leaves for a different job some day. Time comes around to update his part... and nobody has any idea how to. None of the other staff are skilled in that language. Now you are in for a world of hurt while that gets sorted out.

    Multiple languages for their own sake isn't a good idea. Any time you choose a programming language for a project, there should be a reason. That includes the initial language, but certainly applies to any other languages also used. For example suppose you have a web package that's written in Perl. You chose it because your package deals with a lot of text processing and Perl does that well, and also because your target platform supports Perl. Ok, good choice. There are other legit choices, but that's a fine choice. Now you have a client app that goes with it. Perl doesn't work well for that, so you choose C#. You choose that because the client app needs only to run on Windows, isn't speed critical, and needs to be easy to develop a GUI for. Also a good choice.

    However you then decide to add a new feature to your server side of the program. You chose Ruby because it is new and seems neat. Bad choice. The server portion is already written in Perl, why add a new language? The "Because it's neat," is a horrible reason. Will Perl not do the job? Then why add more complexity.

    Just sticking in new languages at semi-random on a project will do nothing but make it much harder. If there's a real compelling reason to have multiple languages, ok then great. That certainly does happen. However just saying "Let's use more languages for fun," is just setting yourself up for hard times.

  14. So you want to learn object oriented now? by Antique+Geekmeister · · Score: 4, Funny

    That sounds like an unfortunate step into another layer of short-lived languages. Learn how to actually program: learn C.

  15. Shell scripting + Python works for me by lbates_35476 · · Score: 4, Interesting

    I've been programming for going on 35 years and have tried a BUNCH of different languages and approaches. I'm glad I've finally settled on writing virtually 100% of my code in Python (using C only when performance is an absolute must). That plus some shell scripts seems to work for almost any project that I've come across in the last 5 years. Python brings lots of tools, good support system, etc. and I'm finding that concentrating on a single language means I'm deepening my understanding with every program I write and adding to a robust personal library of reusable functions and classes that make writing bulletproof code a pleasure. I can be VERY productive because of the high level nature of the code. It is almost like writing pseudo-code once you get a good understanding. I write for Windows and Linux (not much on the Mac). I've written Windows Services, COM objects, GUI programs (with wxWindows), as well as normal batch programs and scripts. On Linux I've written daemons, GUI programs, and background batch processing scripts. What is great is that I only need the one language. I have just never felt at home in the GUI IDE world that seems so popular with some.

  16. Re:Languages by Antique+Geekmeister · · Score: 4, Insightful

    If I had serious text processing, I'd use Perl. And do.

  17. Re:Languages by FishWithAHammer · · Score: 3, Informative

    Graphics means using a well supported library, so Perl/Tk is the better choice than Java/Swing.

    Um...I do not think "well supported library" means what you think it means. Tk is old and crufty. Swing isn't much better, but if you're doing graphics you're almost certainly doing it with SDL or some other accelerated system, and you wouldn't use Swing for that either.

    --
    "You can either have software quality or you can have pointer arithmetic, but you cannot have both at the same time."
  18. Re:Languages by 1gig · · Score: 4, Insightful

    Graphics means using a well supported library, so Perl/Tk is the better choice than Java/Swing.

    Um...I do not think "well supported library" means what you think it means. Tk is old and crufty. Swing isn't much better, but if you're doing graphics you're almost certainly doing it with SDL or some other accelerated system, and you wouldn't use Swing for that either.

    Tk is not as old and crufty as you think. It has been updated allot recently

    Java/Swing actually has a very fast fully accelerated OpenGL drawing pipeline that is even supported on Linux. And yes many graphics heavy applications are buildt using Java/Swing The problem with swing is that it takes some heavy study time to learn how to do it correctly and not make your interface suck. But done correctly Java can keep up with most things out there. It's the done correctly part that is hard.

  19. Are you a programmer or not? by Weaselmancer · · Score: 3, Insightful

    Learn new things.

    The more stuff in your toolbox, the faster you can solve problems. Yes, I know you can solve a lot of the problems you face with the tools you have. It's true you can solve any realistic problem in any Turing complete language. But would you really want to write a pinball simulation in Cobol?

    Learn more languages, and you'll develop a feel for when they're appropriate. I've been known to spend a day looking at different languages before starting a project. It saves time later on.

    --
    Weaselmancer
    rediculous.
  20. Brittle glue code by cerberusss · · Score: 4, Insightful

    In my experience, using multiple languages in a project will force you to write sizeable amounts of glue code. These processes will have to communicate one way or another and they all have their particular way to do so. So, your glue code is often not that simple but deals with interprocess communication for which a protocol will have to be devised (could be simple, but nevertheless).

    Now if that was all, then so be it: write glue code. However, I found most programmers do not heavily check for errors in their normal code, where you have things like exceptions and return values at your disposal.

    This becomes much worse when doing interprocess communication. The normal language constructs aren't there, you're communicating using a self-defined protocol. Often this is invented on the spot and does not include a proper way to catch errors and deal correctly with them.

    So in my opinion: don't shy away from using multiple languages, but remember that you need a decent amount of time for what could be quite complicated glue code.

    --
    8 of 13 people found this answer helpful. Did you?
  21. Re:Languages by CarpetShark · · Score: 4, Funny

    If I had serious text processing, I'd use Perl. And do.

    I have serious text processing to do every time I see perl's syntax ;)

  22. The Unix Way was never good at everything by AdamInParadise · · Score: 3, Insightful

    The Unix Way is a perfectly valid method to develop administrative, text-based tasks targeting a single, well-known platform, but does not scale well toward the development of other types of applications.

    First, compared to modern languages like Python or Java, shell scripting sucks. The syntax is awkward and it can only manipulate bits of text. The world has moved on from text. Today, I want to be able to process complex structures, which in many cases cannot be converted to a simple text format.

    Second, modern languages have huge libraries, so usually there is no need to use anything but those libraries. Furthermore, using those libraries reduced compatibilities issues. When I develop for the Java 6 platform, I know the code is going to work on every single platform with support for Java 6: Windows, Linux, Solaris, you name it. With the Unix Way, you have to make sure that every single function of every single tool you use is going to behave in the same way on every single platform. This is of course a huge pain in the ass.

    But there is no need to fret. You quote Python: from my point of view, it is one of the platforms that can be used exclusively, so your experience is perfectly valuable. Regexp are pretty much the same everywhere.

    But I do not really understand your problem. If you're developing applications, you should know all that already. If your software development experience is limited to administering systems, shell scripting is always going to work for you. I guess that in this last case, you may want to try to pick a singe platform (say, Python) for all your dev needs and see how it goes.

    --
    Nobox: Only simple products.
  23. Yes, .NET may actually be the best bet by benjymouse · · Score: 3, Insightful

    What good are multiple languages if all inter-language integration have to be funneled through some narrow C-like basic model?

    The problem is not with the languages but rather with the platform on which they are based. As long as the common denominator is C memory blocks or opaque text-serialized objects, integration is always going to be a pain.

    Sometimes language pairs are supported by an asymmetric relationship (one of the languages often being C). Using objects/features from one language is usually easier in one direction than in the other. Often there are severe restrictions on the layout of objects/functions. Examples of this is how PHP can use some C based functions/objects, provided they adhere to the "PHP way" of laying out objects. Using PHP functions from C is considerably more involved and certainly does not qualify as minimalistic.

    The problem is that these bindings are often just pairs, excluding other languages from richer integration. Sure, you can integrate other languages with C as well, but rarely will the object layout of one language align with the layout of another language. This makes multi-language integration a pain. Going (down) to C level loses a lot of meta information and complicates going up the abstraction chain to another language. Essentially this is a hub-and-spoke problem with the hub being too weak. Another example is Java/JavaFX. It's quite easy to use existing Java classes from JavaFX, but going in the other direction requires a number of ceremonies. And this is still just a pair. Even though the Java platform has been used to implement a rich set of languages, the basic problem is still there: The "hub" (Java) is too weak to describe objects/functions on a the level which would let you pass objects from Jython to JRuby to Groovy to JavaFX to Scala. Java's generics are incompatible with the generics used in Scala. Java (and also the VM) does not support unsigned integers.

    Java was always designed to be an abstraction over the underlying platform not to integrate with it. This philosophical difference was actually at the center of Microsofts dispute with Sun over the direction of Java. Microsoft wanted the language to evolve in the direction of facilitating integration with the platforms (one in particular) while Sun wanted to abstract away the world outside Java and have everything remodeled in Java. Microsoft enhanced their Java implementation with the "lacking" features, Sun sued and won and Microsoft completely left Java and went on to design .NET.

    Your example illustrates that at least in the area of multiple programming languages, the .NET platform is much more evolved. Unlike Java, Microsoft designed .NET as a multi-language platform from the get-go (although initially for multiple statically typed languages).

    The .NET Common Type System (CTS) and common language runtime (CLR) were always (and still is) more advanced and feature rich than the primary driving language, C#. The CTS already supports generics variance (C# and VB don't yet) as part of the platform. (aside: Scala generics while being define-site with variance are merely an internal Scala thing and not compatible with anything else; Java generics based on type erasure are merely a compile-time only and as such doesn't exist for anything else).

    The latest development in .NET is to incorporate support for dynamic languages into .NET. C# 4.0 and the CTS will lay out a common principle (a "dynamic" interface) which theoretically can accommodate most known static languages, hybrid languages and dynamic languages on a very high level.

    This will enable any language which adhere to this specification to participate in a high fidelity hub-and-spoke architecture. You will essentially be able to pass a IronRuby object to IronPython, C#, VB, F#, Eiffel etc. and interact with it there while still relying on the Ruby

    --
    Reading slashdot one-liner: (irm http://rss.slashdot.org/Slashdot/slashdot).rdf.item | fl title,desc*
    1. Re:Yes, .NET may actually be the best bet by shutdown+-p+now · · Score: 3, Informative

      Really. So how are you going to represent classes with multiple or "mixin" inheritance in a language that only has static single inheritance? Or how are you going to map classic objects with modifiable state to stateless, side-effect-free languages like Haskell? I'd imagine that that's not going to be pretty, no matter what the underlying runtime can supposedly do, because the unpretty-ness is a function of the semantic gap between the languages themselves, not of some feature set (or lack thereof) in the runtime.

      Yes, of course. What .NET really did was to standardize on some common feature set and model. Languages are still pretty distinct, and e.g. F# has a lot of stuff that simply doesn't map well to anything in C# land; but they have some common ground, and that common ground is much more high-level than what we had in C. What more, this approach is extensible - they needed to add dynamic languages such as Python and Ruby in 4.0, and the existing conventions did not cover that, so DLR was born; and now C# and VB are also moving to it in the next release, and any other future dynamic language on .NET likely will, too.

      This comes at the expense of languages themselves having to support that common model. For some it's natural, because they were designed around it - see C# and VB. Others - C++ and F# - are different, and they essentially have to add some subset specifically for dealing with that model; so e.g. in C++ on .NET you still have full power of ISO C++, and it does compile to CIL bytecode, but it's unusable from other languages; and then you have C++/CLI, a set of language extensions that allows you to create and use CLS-compliant types. That separation is very distinct and clear. With F# it's somewhat more blurry, but even so, there are some clear differences between the traditional FP constructs that are F#-specific on .NET (ADTs, curried functions, and tuples, for example) - which don't map nice to any other language; and the F# object model, which pretty much follows CLS closely, with only a few twists.

      On the whole, it's hard to say it's a perfect approach, but it certainly provides for better multi-language interop than the traditional C FFI solution. Pragmatically, it works.

  24. Re:Languages by TheTurtlesMoves · · Score: 4, Informative

    Properly written swing is fine, and i have used without complaints from clients. It looks and performs rather well with openJDK. The problem is that 99% of swing out there are by 1st year students learning how to write any code at all, let alone competent GUI front end. But it is just another gui api with all the pros and cons that seem to come with them all.

    --
    The Grey Goo disaster happened 3 billion years ago. This rock is covered in self replicating machines!
  25. gphnzykrzwki by fforw · · Score: 3, Interesting

    peut-être.. Although many Ergebnisse sont loco.

    --
    while (!asleep()) sheep++
  26. Re:Languages by ericlondaits · · Score: 3, Interesting

    For many years now I've successfully developed with a multi-language model in Windows...

    I do my low level code in C++ and encapsule it in a COM/ActiveX object, which I then can call from a Javascript script launched by the OS (through WScript.exe), server-side ASP pages and client-side DHTML pages or HTML Applications (HTA files). Both the "classical" COM/DCOM/ActiveX architecture and the new .NET were made to support integration of different languages and low level and high level code.

    It's also possible to integrate Windows COM components and DLLs through Python scripts.

    Through this model I developed quite a number of reusable parts which in practice I was able to integrate to a variety of projects. Having this separation between low level code and high level scripting as "glue" works great for me... it forces a layered design, makes for smaller binaries and cuts a lot on compilation times.

    --
    As a Slashdot discussion grows longer, the probability of an analogy involving cars approaches one.
  27. Re:Huh? by gbjbaanb · · Score: 4, Funny

    Anyway, there's plenty of room for multi-language programming. One example of this is SOAP. Another example is CORBA.

    is this your argument for or against multi-language programming? :)