Slashdot Mirror


Moving a Development Team from C++ to Java?

Nicros asks: "I work for a company that is working toward an FDA approved software development process. We have always used C++ in a Windows environment, and we have more than 6 years of code, applications and libraries developed. Because of our long and convoluted software development history, our existing architecture is difficult to manage for a group of our relatively small size (5 FTEs), and development times are rather slow. Our IT director has made the decision that, to speed up development times, we need to re-architect all of our existing code, from C++ to Java." What would be the best way to go about handling such a migration? In a general sense, how would you go about moving a development team from one language to another? "Our IT director has hired a 3rd party (offshore) company assist us with this migration, and they have recommended that we change from C++ to Java, Spring and Hibernate. We are all professional programmers here, so learning Java is not a problem for those of us who don't know it. The real question is: what do we gain from moving to Java? Or conversely: what do we lose by moving away from C++? Additionally, will one language or another really help us to get FDA approval?

I personally am a bit suspicious of this solution. I find it more likely that the problems we have would persist across languages or architectures (lack of time and resources leading to buggy code, lack of direction from marketing, and so on). However, having not gone through this process before, I would be interested to hear any thoughts, stories of similar experiences, or pros and cons."

204 comments

  1. Here's an idea by prurientknave · · Score: 2, Funny

    Send the IT director on a one way trip to Basra

    1. Re:Here's an idea by __aaclcg7560 · · Score: 1

      The IT Director is probably expecting an all-expense paid vacation to Hawaii if six-years of C++ code is successfully converted. Any long-term implications related to this project probably isn't being considered beyond the vacation package, and will probably be someone else's job after the IT Director is promoted to Vice President. Happens all the time.

  2. Logic check by greywar · · Score: 5, Insightful

    OK so you all have years of experience in c++, 6 years of code, etc. Consultants who are familiar with jave recomend changing to java. And changing development languages and re-doing all of this will save you time? I just don't buy that, to me it sounds more like it will make those offshore consultants more money. You're going to spend the next couple years re-writing all of your old work, not getting things done.

    1. Re:Logic check by dhasenan · · Score: 4, Interesting

      Agreed. You might see benefits if you start using a language that interfaces well with C++, though--perhaps Python? That would allow you to keep your existing work and continue using C++ while exploring more platform-independent and possibly quicker systems for development.

      Switching suddenly to Java, though, is a bad idea if you don't already have the expertise.

    2. Re:Logic check by commanderfoxtrot · · Score: 4, Informative

      This is probably a good place to mention SWIG: open source, mature - SWIG is an interface compiler that connects programs written in C and C++ with scripting languages such as Perl, Python, Ruby, and Tcl. It works by taking the declarations found in C/C++ header files and using them to generate the wrapper code that scripting languages need to access the underlying C/C++ code. In addition, SWIG provides a variety of customization features that let you tailor the wrapping process to suit your application.

      From the FAQ:
      Designed to work with existing C/C++ code. SWIG requires little, if any, modifications to existing code. For the most part, it encourages you to keep a clean separation between C/C++ and its scripting interface.

      I haven't used it myself, but it sounds like it could help. At least you might be able to re-use your C++ code from Java.

      I think it's lunacy to rewrite 6 years of code in a new language just for the sake of it.

      --
      http://blog.grcm.net/
    3. Re:Logic check by Threni · · Score: 2, Insightful

      > Consultants who are familiar with jave recomend changing to java.

      Why not find some consultants who like C++?

    4. Re:Logic check by Anonymous Coward · · Score: 0

      Yes, check out the SWIG Python bindings for Qt and VTK. Both of these toolkits are C++, and neither was originally intended to be later SWIGified. Writing Qt or VTK apps in Python is pure joy. Drop back to C++ for whatever occasional heavy lifting you need. It all works together very well. Even inheritance-based use of qt-designer.

    5. Re:Logic check by kupci · · Score: 1
      Good idea, wrong tool. From briefly reviewing the site, SWIG seems to start from the idea that an IDL is a bad thing. That makes me suspect of the rest of the project architecture. Abandoning the idea of an IDL might enable you to hack out a solution quickly, but the disadvantage is you've lost the loosely coupled design of CORBA. From Steve's article:
      Utlimately, your take on mapping's place in middleware comes down to whether you accept the assertion - as I do - that enterprise computing systems tend toward diversity and heterogeneity. Those who understand and accept this assertion readily accept the need for mappings and the limitations they present. Those who continually strive to homogenize their computing systems, on the other hand, are essentially fighting a losing battle because they're swimming upstream against ever-advancing technology and ever changing business requirements. Change is, of course inevitable. Part of planning for change means making your middleware applications as loosely coupled and flexible as possible, and good mappings play an important part in achieving those goals.

      Now, it might be fine for quickly whacking out a way to connect your favorite scripting language to C++, but for a commercial, production application I would go with a more proven, standardized solution such as CORBA. There are many excellent open source implementations (another good reason for using a standardized spec), such as omniorb.

    6. Re:Logic check by nuzak · · Score: 1

      > From briefly reviewing the site, SWIG seems to start from the idea that an IDL is a bad thing.

      You need to review more. SWIG defines its own C-like IDL. It's not terribly good, but neither does it require the concept of interfaces or a repository of the same. It's an FFI generator, not an ORB My only beef with swig is that the FFI it actually generates is kind of grotesque (it depends on the language I suppose). But it sure is easy.

      CORBA is a god damned monstrosity. I had a big paragraph explaining why, but I'll just illustrate with an example: IOR:000000000000001149444C3A464950412F4D54533A312E 3000000000000000010000000000000054000101000000000C 3139322E3136382E302E350007CE000000000018AFABCAFF00 00000223429867000000080000000000000000000000010000 00010000001400000000000100200000000000010100000000 00

      (slashdot will wrap that one for sure). That's just one object reference in the wacky-land of CORBA.

      --
      Done with slashdot, done with nerds, getting a life.
    7. Re:Logic check by try_anything · · Score: 1

      That's a great idea. If the attractions of Java are unit testing, error handling, and memory management, maybe it would be just as good to hire a C++ coach who can introduce unit testing, Boost smart pointers (or garbage collection, even), and exceptions and be a good-natured coding standards Nazi to make sure your guys use those wherever they're appropriate. Of course, this doesn't do any good if you're already writing excellent C++.

    8. Re:Logic check by Anonymous Coward · · Score: 0

      SWIG Sounds like a giant hack and adding complexity where it just isn't needed. Keep your code encapsulated. If you really need to call a PERL process set it up and run it with a scheduler or make a request to the operating system to call it. Although if you're writting in C++ Chances are you don't need to because you are developing applications that DON'T need to access low level areas.

      Just my opinion

    9. Re:Logic check by Cyberax · · Score: 1

      There's a MUCH better library for Python-C++ integration. See http://boost.org/libs/python/doc/index.html

    10. Re:Logic check by Darth+Liberus · · Score: 1
      The parent is dead on.

      One question that's been brought up, but hasn't been said loudly enough, is this - why not blend Java with the existing C++ code? A team at the company I work for was faced with a similar situation, and after a bit of experimentation and thought decided that the most sensible path forward was to rewrite the GUI in Java, design some nice JNDI wrappers for the components that the GUI would have to interface with, and leave the rest alone. By doing this they've given their customers the appearance of having a shiny new application (Swing looks a million times better than the godawful 90's hangover they had before), and at the same time they didn't have to throw out a bunch of thoroughly debugged code.

      --
      Beauty is just a light switch away.
    11. Re:Logic check by try_anything · · Score: 1

      +1

      Boost.Python is well designed, well documented, and has an active mailing list. Getting started can be a real pain, but it's a one-time cost. (If you have any trouble getting it to build or building your first project, you'll find it extremely helpful to read through a basic introduction to Jam, the build tool used to build Boost.Python extensions.) After a very difficult start-up, it's been all roses for me.

      Also +1 to scripting language integration in general. I love being able to bring up a command line, load up a C++ module, create instances of my objects, and play with them. It's an enormous help in prototyping, debugging, and getting a new developer started.

    12. Re:Logic check by kraut · · Score: 1

      SWIG is useful, but less useful with C++ than with C. It also doesn't cope well with modern C++.

      While I'd back using Python in conjunction with the existing C++ code, boost::python seems a better option. It looks like a bit more work upfront, but designing the interface properly is better than hacking headerfiles to get around SWIG limitations. Don't get me wrong, SWIG is great, but it just doesn't cope well with complex headers.

      As for moving to Java:
      1. Switching the language is not going to solve your problems.
      2. If you insist on switching the language, and you're tied to MS anyway, why not use C#? Same kind of language, and unless portability is important, you might as well continue using the MS toolchain you're familiar with.

      --
      no taxation without representation!
    13. Re:Logic check by FellowConspirator · · Score: 1

      This is also easy to implement for Java. I had written a toolchain while working for my first post-graduate employer that would write JNI binding code that would allow you to freely mix C++ and Java code by writing bindings based on the C++ headers or Java class files.

      At the time, it was used to blend together some fairly complex C++ algorithms with some Java code that provided a uniform UI (at the time, AWT-based).

      It worked great. I seem to remember that it took less than a week to slap together. So, coming up with a Java-SWIG is eminently doable by someone with a passable knowledge of both languages.

  3. Resume by pete-classic · · Score: 5, Insightful

    Sounds to me like the best case is that some salesman has convinced your management that Java is a cure-all. The worst case is that your management has decided that this is the first step in off-shoring your job.

    In either case my advice to you is the same: Polish up your resume.

    -Peter

    1. Re:Resume by Vegemite · · Score: 3, Informative

      You are handing your entire code base to an off shore firm to port to java. You are supporting your C++ product while giving this outside firm your technical expertise on all your coding decisions. When this rewrite is done, what is the point of having your development team around? Get your affairs in order! - Veg

    2. Re:Resume by Ozwald · · Score: 5, Insightful

      This is a common tactic by consulting companies. It always follows the same flow, never fail:

      1) consulting company hires a lot of junior/intermediate coders for his company that only learned Java or C#. C++ skills and experience avoided in favor of knowing the latest .NET/Java technologies.
      2) an expensive consultant comes in to analyze an imperfect system
      3) this person makes all kinds of suggestions, says nice things about management, says "use lots of UML"
      4) says his devs are really good C++
      5) brings in his coders to help fix bugs, charges lots of money for diagrams never used
      6) consultant coders fail at fixing bugs, claim that code base is too fubar'ed to maintain
      7) convince management to "port" code to Java/C#.
      8) consultant coders soon have more knowledge of the system than the old devs because knowledge isn't shared properly (no more UML)
      9) management becomes too afraid to let go consultant coders because they know more about the system than the devs (despite costing atleast twice as much)

      I can't count how many times I've seen this because the city I used to live in had atleast 2 massive consulting companies that made this their business model. I imagine it's even worse when it goes off shore to India because all the knowledge is looked away in peoples' minds thousands of miles away. Such a huge mistake for management to lose all they paid for for nothing.

      Oz

    3. Re:Resume by DoofusOfDeath · · Score: 0, Offtopic
      $337,000,000,000 spent. Osama Bin Laden is still on the loose. I WANT A REFUND!
      I suspect the dead or maimed soldiers, Iraqi's, and their spouses, children, and parents want one as well. But they lost more than tax dollars, so we should let them get first in line.
    4. Re:Resume by Anonymous Coward · · Score: 0

      I suspect those the died over the decades at the hand of Saddam, those that died at the hands of the Taliban, not to mention the Americans that died on 9/11 would disagree with you.

      But then, you've forgotten about that, haven't you? You're obviously pro-dictator.... Why don't you put your money where your mouth is, and actually go live in one of those places?

      I know why, then you wouldn't be able to bitch anymore.

    5. Re:Resume by pete-classic · · Score: 0, Flamebait

      How do you intend to refund a person's life, limbs, or family members?

      -Peter

    6. Re:Resume by Arandir · · Score: 2, Informative

      My story is remarkable similar, even down to the FDA approval. Except that we were doing realtime embedded Unix in C/C++, and management wanted us to do realtime embedded Windows XP Pro in C#/.NET. It was decided (by non-engineers) that it would be easier to port over the Unix/C++ code to WinXP/C#, than to start from scratch. This was five years ago. We still don't have a new product out.

      p.s. An hour ago as I was walking to lunch, I overheard one of upper management on his cell phone saying, "they're all old school Unix people, they don't know how to use Windows tools." I have no idea if he was excusing or blaming us, but I suspect the latter.

      --
      A Government Is a Body of People, Usually Notably Ungoverned
    7. Re:Resume by Anonymous Coward · · Score: 0
      That's one way to look at it. Another way is to say that volunteers who consented to risk, should get in line behind taxpayers that said, "I'd rather not" but had their money taken by force and wasted anyway.

      But I would indeed agree that the taxpayers who said "Yes, I approve this" should be very last to get refunded.

  4. Don't by AuMatar · · Score: 5, Insightful

    You have working code in C++. Throwing out all that work will take years and millions of dollars. Even if Java doubled your productivity (it won't- you don't have experienced Java developers so it will greatly reduce your productivity) it would take over a decade to break even if you ever did.

    Never rewrite working code. Refactor, rewrite subsystems if absolutely necessary. Otherwise leave it as is and if you really want to experiment with Java, do it with new tools.

    --
    I still have more fans than freaks. WTF is wrong with you people?
    1. Re:Don't by dhasenan · · Score: 1

      Of course, this doesn't apply if each application is relatively small and irreducible--you just use Java for the next product that's commissioned and go from there.

      You'll still lose initial productivity from learning the new language, but it won't cost a complete code library if that library doesn't exist. And if the next product happens to be similar enough to a previous one that you could rework the old one easily, you could still use C++ on it, since the developers are experienced in both.

    2. Re:Don't by AKAImBatman · · Score: 4, Insightful

      You have working code in C++.

      Actually, he said that it's *not* "working" per se. He already stated that it's difficult to manage, and (I presume) full of bugs. This is a common issue for companies, especially if the original developers didn't fully understand the dynamics of the concept when they first coded it. (I believe the military saying is, "No plan survives contact with the enemy.")

      In those cases it can make a lot of sense to do a ground up redesign and rewrite. You can still use the original code as a reference, as well as grab useful code snippets. But the key is to shake out all the cruft that has built up in the system. Without this sort of step, your development staff will simply need to grow and grow. Before you know it, you'll have 200+ programmers, and your company will look like SAP's development floor.

      As for moving to Java, that's difficult to say without knowing their specific problem. If they, for example, have their own Web Application Framework, they might save huge amounts of development time and money by moving to a more standard platform. If there's nothing they can pare down, then they're probably wasting their time. It's hard to say without knowing more.

    3. Re:Don't by Marillion · · Score: 5, Insightful
      Initially, I'm inclined to agree. Swapping out a language to fix problems isn't fixing the problem. It's like those companies that move all the boxes the org-chart every so often trying to solve the problems of their company - those boxes at the top. The problem is poor development processes.

      There are two kinds of Software Development Processes: 1) Manager centric and 2) Developer centric.

      All the stuff we do at our company for Sarbanes-Oxley is classic Manager Centric SDP. It's about tracking the track every inch of code, who changed what, who had business authorization to put it in. Developers loose productivity over this, it's tedious, it doesn't improve quality, it doesn't prevent errors, but it does keep the auditors happy which does keep management happy.

      The SDP's that benefits developers are things like Agile Programming. Among the cornerstones of Agile are Test Driven Development and frequent iterations. These are the processes that focus on preventing bugs in the first place.

      I once worked for A Company that wanted all of #1 and none of #2. They got what the deserved. You need a measure of both with a dash of flexibility.

      Software development processes have almost nothing to do with the choice of language. That said, it's been my observation that there are lots of really smart people working on Java to improve the development process. Eclipse is amazing with code completion, on-the-fly error tracking and refactoring. JUnit (comes with eclipse) is a benchmark Test Driven Development system. If you must switch languages, invest in the training to make those tools productive!

      --
      This is a boring sig
    4. Re:Don't by foobarbaz · · Score: 2, Insightful

      > But the key is to shake out all the cruft that has built up in the system. Every little bit of cruft is a bugfix that you'll have to make again.

    5. Re:Don't by Anonymous Coward · · Score: 2, Insightful


      >You have working code in C++.

      Actually, he said that it's *not* "working" per se.


      It's working a hell of a lot better than the java code that hasn't been written yet.

    6. Re:Don't by Anonymous Coward · · Score: 2, Insightful

      In those cases it can make a lot of sense to do a ground up redesign and rewrite.

      No, it doesn't. While you're doing the rewrite, you have no product to sell, unless you maintain the old version in parallel. After the redesign phase, you'll find that the new version is buggy and incomplete, after all it's a new programm. When it is finally ready for premiere, you'll find that meanwhile the competition has driven you out of the market and that you developed a bad case of second system effect. The new system will have none of the old bugs, but a lot of new ones. Additionally it will usually eat more resources to do not-quite-the-same thing as the old one.

      Never, never throw away you only asset, the program. Refactor it while keeping it alive, but never throw it away.

    7. Re:Don't by RingDev · · Score: 1

      So true. The problem here is not the programming language, it is the architecture. If his team just haphazardly switches to Java they'll just blow 5 more years and wind up in the same boat. What they should do is review the app and the customer's needs, re-evaluate the architecture and sub system, and firm up the requirements and tech documentation. Then start from scratch in the language of choice (although I would recommend sticking with C++ since that is where his team's strengths are). Grab code as needed from the existing product, but the architecture is the single most critical aspect of large application development.

      -Rick

      --
      "Most people in the U.S. wouldn't know they live in a tyrannical state if it walked up and grabbed their junk." - MyFirs
    8. Re:Don't by Tim+C · · Score: 1

      Every little bit of cruft is a bugfix that you'll have to make again.

      Not true - some will be fixes for fixes that were poorly implemented (perhaps in a rush to hit a deadline, then forgotten about), some of the cruft will be for features that are no longer used (or perhaps even available, if other parts of the app no longer use the code at all), and so on.

    9. Re:Don't by b17bmbr · · Score: 1

      I've been workign with java for abotu 7-8 years, and I'm not knowledgable in c++, but wouldn't JINI work for alot of the libraries? Or, shouldn't much of the code be cross-compilable? GUI code will not be, but wouldn't alot of the algorithms still be useful? As for java, what I've found (from talking to c/c++ developers) is that java handles so much of the nuts and bolts internally. For example, creating a socket is simply

      Socket s=new Socket(IP_ADDRESS, PORT);

      File I/O is simply

      FileInput(Output)Stream or FileReader(Writer)

      c++ gives you alot more flexibility, while java basically hides the internals from you. Object Streams are just that. It is harder to write language neutral client/server applications in java, as it's alot easier to send a byte array as an Object stream rather than a Data stream. Plus, java offers the Buffered streams which again, take care of many problems.

      If there is specific CPU instructions that are in the code, they'll have quite a bit of difficulty, but converting 10,000 lines of c++ will not create 10,000 lines of java. They could very well scrap alot of code and use the existing java libraries.

      --
      My problem? I was perfectly gruntled, until some numbnuts came by and dissed me.
    10. Re:Don't by jthill · · Score: 1

      I'm not sure he meant it the way you took it. I've more than once gotten really, really pissed off at a few thousand lines of code when I was trying to fix its Nth should-have-been-simple problem and just rebuilt it. It was never the whole ball of wax. If you already know what the code's supposed to be doing, you've got the very familiar and (mostly-)working bad example right in front of you, it's a neatly severable chunk and you're angry enough, it goes fast and the result is rock solid. That kind of thing is of course deep into easier to ask forgiveness than permission territory.

      --
      As always, all IMO. Insert "I think" everywhere grammatically possible.
    11. Re:Don't by bwt · · Score: 1

      Never rewrite working code. Refactor, rewrite subsystems if absolutely necessary.

      Those two sentences are polor opposites. The second one is correct, the first one is bunk. It's completely rediculous to say "never rewrite working code" -- by this logic all apps last forever regardless of operations cost and opportunity cost. In this world, all apps would still be Cobol and Fortran.

      To the original question -- yes you can rewrite your app. There are three ways to do it
      A) code the whole thing from scratch in parallel
      B) cut off functional pieces of your existing app, encapsulate them behind platform independent API's and reachitect the pieces individually to the new platform
      C) cut off layers of your existing app, change the layer to layer communitcation mechanism

      Despite what people here say, there can be advantages to A) because you have the freedom to change the basic architecture. However, option A) is much more risky and more expensive. It really helps to do A if you have good requirements documentation for the existing system. Unfortunately, the development style for option A is very likely to be waterfall since nobody will use it until you turn the existing system off. This makes it's chance of failure and it's cost of failure bigger. It almost always causes strife between the "new" team and the "old" team to do this.

      Option B is much easier to mitigate risks, but it will take longer. You will have to refactor the existing platform code in order to support it. The total amount of work is probably more, but it can come in smaller chunks and the cost of a mis-step is not as catastrophic. You'll get some benefits from the new platform sooner and upon completion you'll have a more modular architecture as a bonus.

      Option C is like option B but instead of spliting up the refactoring along functional lines it goes by technical lines. How easy or hard this is depends greatly on the extent to which you've respected good OO design in what you have now and have separated the concerns of your app into layers.

      A key architectural decision for option B or C is whatt platform independent interface mechanisms to use. Without knowing more about your code, it's impossible to say what the right way to do it is. It depends on what mix of web, GUI, and systems interfaces you have, how you've represented your business and persistence logic.

      Option B and C aren't necessarily exclusive.

      All of these options incurr short term expense for long term ROI. That kind of situation ALWAYS requires very dynamic management. You need an executive sponsor who can make a business case for why continuing on the existing path doesn't work for the business. You are getting a lot of crap answers here because slashdotters only look at the techncial side of things. In the real world, business drivers are much more likely to control the decision. There is a lot of political heat no matter what route you take, and you will need an executive to shield you from this. If you have weak management you will fail and it will be a disaster on multiple levels.

    12. Re:Don't by jgrahn · · Score: 1
      I've been workign with java for abotu 7-8 years, and I'm not knowledgable in c++, [...]

      No, because if you were ...

      As for java, what I've found (from talking to c/c++ developers)

      ... you would know if you had talked to C programmers or C++ programmers. They are not the same. Good C is as dissimilar to good C++ as good Java code is.

    13. Re:Don't by Anonymous Coward · · Score: 0

      If you're considering Java, just be sure that you're considering it for the right reasons.

      One reason that is pretty much never right in my experience is "Java is better than ",
      where the value of is of course usually C++.

      It might be true that the Java platform might have some canned tools that are more applicable
      to your particular problem, today. But don't confuse that with the language. An expressive
      language is compelling because it gives you tools that work for your future problems, too.
      Finding libraries and adopting modern C++ will give you a lot of miliage.

      The reason I'm cautioning you here is because I've seen too many shops that move to Java
      because of a toolset, only to be royally shafted once they realized that it wasn't a
      silver bullet. C++ is likely more than adequate for whatever you're doing. Investment in learning
      to apply it more effectively will surely be cheaper than trying to port that much code,
      and retrain your staff.

      Good luck!

    14. Re:Don't by aminorex · · Score: 1

      If you're confusing JINI with JNI, then I have to question both your claim of experience in Java and your familiarity with C++.

      --
      -I like my women like I like my tea: green-
    15. Re:Don't by aminorex · · Score: 1

      While they may be polor opposites they certainly are not polar opposites. The first says, if it ain't broke, don't fix it. The second says, if it's broke, here's how to fix it.

      And yes, there are lots of happily running, productive applications in COBOL and Fortran.
      COBOL is thankfully dead, but lots of new ones are being coded in Fortran-2005 every day.

      --
      -I like my women like I like my tea: green-
    16. Re:Don't by b17bmbr · · Score: 1

      I'm not knowledgable in c++

      I think I made that clear. Sorry about the typo reagrding JNI. but no, I'm not overly familiar with it as I don't code in c/c++.

      I've been working with java about 7-8 years

      That's mostly been developing applets to small applications mostly used at my school, etc. For example, the librarian at my old school wanted a to keep track of all the old multimedia crap (tape players, slide viewers, crap like that) we had laying around, and didn't have any funds. So I wrote a quick app a few years ago. Since we didn't have a spare computer to install a database on (and even if we did, the district would never have allowed a linux install with mysql!!) jave seemed like a perfect choice. Easy to serialize the objects, write, update, save, print reports, etc., simple UI. Really nothing to write home about, but kept her from tons of paperwork and helped her out alot. As far as I know, she still uses it. Another teacher wanted a way to take her classes in the computer lab and show them slides and text for science type stuff, planets, cells, etc. Wrote a simple server and client, did one thing, only one thing, and it worked. Small footprint and a small .jar. Again, nothing fancy, nothing extravagant, but a solution. And for those, java worked perfectly. Was there a "better commercial" version? sure. I've done other small projects like that. Am I a "professional"? hardly. My original post was more a question, that I didn't know the answer to, regarding using JNI and java's libraries.

      geez, admit you don't know something, and people take more offense. perhaps it can't be done, perhaps java would be impossible to migrate to. Maybe the specs are for cross-platform rather than windows specific. I heard somewhere that Apple is still making computers. Now, where'd I hear that rumor?

      --
      My problem? I was perfectly gruntled, until some numbnuts came by and dissed me.
    17. Re:Don't by cyber-vandal · · Score: 1

      Sorry to break your heart but COBOL isn't dead, not quite yet, there are still way too many backend systems written in it for it to go away any time soon.

    18. Re:Don't by aminorex · · Score: 1

      COBOL is as dead as Latin. There is no significant growth in the literature in either language.

      --
      -I like my women like I like my tea: green-
  5. Java by Toba82 · · Score: 0, Troll

    Why switch to Java? That really IS a damn good question.

    --
    I pretend to know more than I really do by mooching off google and wikipedia.
    1. Re:Java by Joe+The+Dragon · · Score: 2, Insightful

      You are being outsourced

    2. Re:Java by Toba82 · · Score: 1

      And the solution is to do most of the stuff you already did over again to... increase productivity?

      --
      I pretend to know more than I really do by mooching off google and wikipedia.
  6. What is your current application environment? by batkiwi · · Score: 2, Insightful

    Since you mention Spring, I'm guessing that you're writing web applications. If you're not, then you need to tell your manager to jump off a bridge, as he has no idea what he's talking about.

    If you ARE writing web applications, then I would guess that moving to spring and hibernate from a completely from scratch c++ framework will result in much shorter development times. Serverside is where Java really shines in both performance and in ease of development.

    Either way, we need more details.

    1. Re:What is your current application environment? by Anonymous Coward · · Score: 3, Informative

      Please ignore the parent. Spring (http://www.springframework.org/) is not a web application framework.

      There are probably a lot of gains to be made by switching. If your people really are as good as you say then the language itself wont matter much and you are gaining a lot of libraries and knowledge from the massive amount of real development being done in java.

    2. Re:What is your current application environment? by Anonymous Coward · · Score: 1

      They're probably NOT in a web environment. It's just that all those rice and curry chop shops have a set technology religion and toolset. 95% of their projects are web projects. If you move them out of that environment, they don't know enough to reevaluate their toolset and use the appropriate hammer. Sounds like they hired the same people my current employer hired. They're 100% Java/Spring/Hibernate. That's all fine since we're a web-based content publisher. My problem is that a bunch of overpaid, outsourced sand-farmers couldn't write the application right the first time and they were co-located in our building. How are a bunch of overpaid sand-farmers 12 time zones away going to succeed a second time? Bitter? Yes. Because I lost my job to them? No. Bitter because I'm forced to deal with the f-ed up data model that they left in their wake....

    3. Re:What is your current application environment? by Joseph+Vigneau · · Score: 4, Informative

      Since you mention Spring, I'm guessing that you're writing web applications. If you're not, then you need to tell your manager to jump off a bridge, as he has no idea what he's talking about.

      I disagree- containers like Spring are useful for all sorts of applications, not just web-based ones. Stitching components together via configuration files, combined with aspects and "inversion of control" makes it a lot easier to build maintainable and extensible applications. There's nothing in the core Spring framework that shoehorns you into writing web apps.

      That being said, the OP should probably stick with C++, unless there are much more compelling reasons than "the offshore consultants said to use Java, Spring, and Hibernate".

    4. Re:What is your current application environment? by Furry+Ice · · Score: 1

      Java is a lot nicer than C++ on the server-side, but it has one huge drawback: it doesn't play nice with existing C++ code. It doesn't really play nice with anything else at all (except for scripting languages which run on the JVM, especially the ones that compile to Java byte-code).

      With a large C++ code base, you're much better off looking at languages like Ruby and Python that have simple and stable C/C++ interfaces. Don't be fooled by the fact that Java has JNI. It's not easy to use, and will usually make your JVM unstable, which is made much worse by the fact that Java rarely uses multiple processes, so that a bug in JNI will bring down your entire system, where with something like Ruby on Rails, a segfault in native code would bring down just one fastcgi process, and the others would continue on their merry way.

      If you DO end up going with Java, don't even bother looking at JNI. The most effective way to get reuse with legacy code it to turn your old code into standalone servers and have your Java code communicate with them over TCP. This can end up being a serious burden to implement, but it works well.

    5. Re:What is your current application environment? by dusik · · Score: 1

      >> "If you're not, then you need to tell your manager to jump off a bridge, as he has no idea what he's talking about."

      Dude... if we all had the capability to tell all our bad managers to jump off a bridge and replace them with good managers, most of us would probably be writing code instead of bitching on slashdot! ;)

    6. Re:What is your current application environment? by pebs · · Score: 1

      Since you mention Spring, I'm guessing that you're writing web applications. If you're not, then you need to tell your manager to jump off a bridge, as he has no idea what he's talking about.

      Spring is useful for all kinds of server-side development, not just web apps. It's also useful on the client-side as well.

      --
      #!/
  7. Why by gerbalblaste · · Score: 1

    would you want to do a silly thing like that? Is C++ resticting you from doing something theat java will allow you to? From this idiots point of view you gain no advantage from switching platforms(languages, etc.) you just accrue profit for an offshore company.

  8. General Thoughts by AKAImBatman · · Score: 4, Insightful

    In general, rearchitecting a system can be a good way to update it for your current needs. The key however is to architect, not simply recode the exact same design. You need to see what your needs are in a system and decide what it is that you could meet if you could just change the basic approach.

    In your specific case, however, I'm a bit concerned about the track your company has taken. My concerns are:

    1. You're going to have a separate company working on your codebase when they have no intimate knowledge of how it *should* work.

    2. No one in your team is an expert in Java. This is problematic because good Java code has a very different profile from good C++ code. (Mainly due to auto-optimizations and garbage collection.) Things that were good ideas in C++ may actually hurt you in Java.

    3. Your lack of knowledge in Java is going to guarantee that Java's features won't be put to full use in the design. Which means that you may end up short of your maintainability goals.

    4. Blindly accepting a framework is a recipe for disaster. Unless you clearly understand the framework you're working with, you will tend to try and fight it instead of working with it. This will result in a lot of unnecessary hacks.

    My best suggestion for your company is to get a Java architect on staff who's also familiar with C++. (It's okay if he's a consultant as long as he's planning to be on-site for the next year or so.) Postpone the project for a few months while he gets up to speed on what your system does and what it needs to do. Once he's up to speed, he can work with the staff to develop an architecture that will meet the needs of your company and your platform. Use the outzourcing company for busy-work ONLY. Make sure that the API specs are well defined before you send ANYTHING to them for coding.

    As for the FDA approval, rewriting isn't a magic wand. You need to ensure that their requirements are taken into account during the architectural design phase. Otherwise you may fail to meet the goals.

    I'm not sure if your boss will agree to getting a highly paid Java architect to join your team OR to postponing the project, but thats the best advice I can give you. I presume if you already knew the answer you'd be championing it instead of asking us.

    Good luck to you! I hope it works out.

  9. Don't re-write anything! by GoSmalltalk · · Score: 3, Insightful

    Hi:

    Re-writing your codebase is *usually* a one-way trip to bankruptcy. If forced to change languages, always dicey, you might want to try the following:
    1. Mine the code so you have documented interfaces
    2. Create wrappers where neccessary to facilitate access by *new* code
    3. Write new functionality/apps in the new language
    4. As your apps force change of the wrapped-code, evaluate the cost-effectiveness of a re-write of that piece only

    And, most-importantly, use Test-Driven Development; you must mitigate the huge risk that your management has mandated.

    Good Luck, you have your work cut-out for you.

    Thanks!!
    Joseph Bacanskas [|]
    --- I use Smalltalk. My amp goes to eleven.

    --
    Joseph Bacanskas [|] --- I use Smalltalk. My amp goes to eleven.
  10. A bit tangential by JanneM · · Score: 4, Insightful

    A tangential comment: You say a large part of your problem is a convoluted, complex architecture that's been growing for some years. That happens - in fact, it's probably inevitable to some extent, whenever you have a codebase that needs to change as requirements and use-cases do.

    And to solve that problem, doing a redesign and rewrite (or a close analogue) is probably a good idea, no matter what language you'd be doing it in. You need to get rid of all cruft, strange corner cases and mismatches between the envisioned architecture and the reality. Look at any large, well established OSS project and you'll see that they've done that too, sometimes more than once. And if you're going to rebuild from the ground up, more or less, you might as well take advantage of the better tools that's become available as well. And from C++, any of the newer development languages - whether Java, C# or even Perl/Python/Ruby - would probably be a step up in development speed and maintainability.

    Of course, OSS projects are also a showcase for how wrong it can go. You do need ample time and resources to do it - a rush job will just make the new system as bad as the old one, but with all-new problems in addition to the old ones. You also need serious constraints. Without them you'll inevitably succumb to feature creep ("wouldn't it be nice if we could..."), which will kill the system just as surely as a crappy reimplementation would.

    For every OSS project out there who did a redesign and rewrite and came out stronger, faster and better for it, there is a project that started a redesign just to get rid of cruft, went off into the design neverland and never appeared again, suicided by the endless opportunities that rewrite gave them.

    I think the use of Java is beside the point. The opportunities and pitfalls lie with the redesign and reimplementation. The tools are just an implementation detail.

    --
    Trust the Computer. The Computer is your friend.
    1. Re:A bit tangential by JWhitlock · · Score: 1
      I agree. The problem is not the language but the process. The offshore company probably has a better designed and documented process (it is a huge selling point for many offshore industries), but your team has the experience. What you need is to implement a constant improvement process, either by transfering all your work to an offshore company (your bosses' solution), or create and refine that process in house.

      I would recommend buying six copies of "Working Effectively with Legacy Code", by Michael Feathers. Perhaps with Refactoring: Improving the Design of Existing Code by Fowler et al. Or, you can just buy one copy now, and the other five later.

  11. lobotomy by Xtravar · · Score: 3, Funny

    Give the team a lobotomy. That'll do it!

    --
    Buckle your ROFL belt, we're in for some LOLs.
  12. your best solution by yagu · · Score: 1

    Your best solution, if you can find people with enough sway would be looking into getting your IT Exec fired. Really.

  13. What you gain from moving to Java by Anonymous Coward · · Score: 0

    [quote]The real question is: what do we gain from moving to Java?[/quote]

    About a gig of memory use.

    1. Re:What you gain from moving to Java by mcvos · · Score: 0, Troll
      [quote]The real question is: what do we gain from moving to Java?[/quote] About a gig of memory use.
      Not if you write your code well. IMO C++ is obsolete for enterprise applications. Java is just as fast, more flexible, and there are tons of good frameworks for all sorts of things.

      The question is, can you afford to switch to Java? Can you afford the redesign, rewriting that much code, retraining the programmers? Then again, can you afford not to? If you've got a huge, complex framework that's hard to work with, and there's an easier Java framework that fits your current needs perfectly, a switch could be a really good idea.

      It depends entirely on the situation. I wouldn't trust managers and offshore consultants to make this decision, but if the programmers say the current situation is unworkable, and a switch to Java will help solve your problems, then it may be a good idea. Have your best architect delve into the possibilities of Java frameworks, and listen to him. Or hire a new architect with more Java experience, if your architect doesn't know enough about Java.

      There's no simple yes or no answer to the question. I really love Java, and I think C++ for enterprise applications is obsolete, but there are still many situations where a switch is going to be a really bad idea.

  14. Oh my. by Jerf · · Score: 5, Insightful
    Or conversely: what do we lose by moving away from C++?

    Six years of C++ development, and all the corresponding skill development.

    Even with the C++ to guide you, and assuming you had all the manpower to do the full conversion to Java that you had to write the C++ in the first place, you'll need at least a third of that time again to re-write the whole thing in Java, most likely. And that's being conservative; if you're good with C++ it's extremely likely to borderline-certain that you have used idioms that will translate poorly or effectively not translate at all into Java.

    That's a shitload of stuff to just throw away to be buzzword compliant.

    My suggestions would be to do one of two things.
    1. Research JNI and see if that would allow you to incrementally pull things over to Java as you need them, while leaving the rest C++. C++ is so wonderfully... ahh... I'll go with "powerful" that it's hard to tell how things will interact, but if you can pull things over incrementally, you can at least not toss everything all at once. Because that's a guaranteed recipe for disaster.
    2. Research your choice of Python or Ruby. My recommendation would be the former as it's more mature in a lot of little ways (and some big ones, like Unicode from what I hear). There are several technologies for using C++ objects in Python. I presume there are some in Ruby. Incrementally wrap pieces of your code in Python handlers as you need them, write Python or C++ as the situation warrents. There are other such languages to consider too; you'll have to evaluate them for your needs.
    The key word here is not Java or JNI or Ruby or Python; those are really incidental to my point. The key word is incremental. Incremental might succeed. Attempting Total Switchover is just writing a check to the consultants for no return this decade.

    And while you're incremental-ing and maybe wrapping, be sure to write unit tests if you haven't already got them. If you do manage to not toss out your entire code base, a good first step for any of this is to write unit tests on the parts of the code you're going to manhandle.
    1. Re:Oh my. by Reality+Master+101 · · Score: 1
      Research JNI and see if that would allow you to incrementally pull things over to Java as you need them, while leaving the rest C++. C++ is so wonderfully... ahh... I'll go with "powerful" that it's hard to tell how things will interact, but if you can pull things over incrementally, you can at least not toss everything all at once. Because that's a guaranteed recipe for disaster.

      Exactly what I was going to suggest. Throwing everything out is just complete insanity. If he can't talk them into fixing their processes rather than looking for the "silver bullet", then they should take an incremental approach. Either rewrite a small subsystem or (preferably) add a new subsystem in Java into the existing framework. If that's successful, then do a gradual, planned, architected rewrite of old code.

      Speaking of silver bullets, getting this idiot manager a copy of "Mythical Man Month" and highlighting the chapter on "No Silver Bullets" would probably do some good.

      Not that rewriting a project is always bad (in fact, it's often a necessary part of the evolution of a product), but doing it because you think some new language is going to solve all your problems is just stupidity.

      --
      Sometimes it's best to just let stupid people be stupid.
    2. Re:Oh my. by 0xABADC0DA · · Score: 3, Interesting

      Six years of C++ development, and all the corresponding skill development. ... That's a shitload of stuff to just throw away to be buzzword compliant. ... The key word is incremental. Incremental might succeed.

      Let me be the lone voice to call bullshit. Story poster is obviously inexperienced and trying to be diplomatic (if for no other reason than pride). What we have here is almost certainly a big steaming pile of crap.

      Their development has slowed to the point where they are going to ditch the whole thing. It's too late to save this code. Putting a nice interface on it will just exacerbate the problem because anything you try to do will either expose the underlying crap and bugs (ie mfc, .net forms) or be as much work as a re-write.

      Just take a look at Windows for an example of what happens when you try to incrementally evolve something like this: 6 years with basically no innovation because updating anything is so slow and difficult. Meanwhile both Apple and Linux have made leaps and bounds, Apple by ditching their massive investment in OS 9 and Linux by shunning backwards compatibility. Linux doesn't have binary kernel drivers because mapping better stuff to old mistakes is even harder than keeping a zillion drivers up-to-date. I'm always getting "kernel too old" messages trying to make binaries that run everywhere. It sucks, but imho it's a huge reason why Linux is advancing instead of stagnating. The only reason Microsoft is still around is because of lock-in; if poster's company doesn't have a lock on the market and given their codebase they will fail if taking the incremental approach.

      I think it's painfully obvious that whatever it is they are doing (I'm guessing some database + COBRA junk) is something that shouldn't be written in C++ in the first place. For example, poster does not mention performance at all. C++ *can* be a lot faster than Java at some things and is a pretty good choice for those (action games for instance), but if you are not even slightly concerned about it then that's a pretty big tell that using C++ for it is a huge mistake. Ideally they would write most of their code in Python or Ruby or similar, but it sounds like this could be out because of client issues. So Java or C# is probably the only realistic language to code in.

    3. Re:Oh my. by Jerf · · Score: 1

      Just take a look at Windows for an example of what happens when you try to incrementally evolve something like this: 6 years with basically no innovation because updating anything is so slow and difficult.

      With respect, you've mistaken "incremental" for "maintaining backwards compatibility at all costs". They're not the same at all, and I'd never suggest trying to maintain any sort of backwards compatibility in this context.

      Your post makes complete sense if you make that substitution.

      I routinely make incremental changes to my software that aren't backwards compatible. Often (and increasingly) my unit tests tell me what things I may have forgotten about that use it. I just finished one just before checking Slashdot for a break. In fact, more often than not I don't keep backwards compatibility; I've really been trending towards the thought lately that it's a trap, not a good idea, looking great in the short term and completely killing you in the long term.

    4. Re:Oh my. by greg_barton · · Score: 1

      This is so far the lone voice of truth in a herd of anti-Java zealots. The guy obviously asked this question to get reinforcement for his objections to the switch. I mean really? What other answer did he expect from /. ?

    5. Re:Oh my. by 0xABADC0DA · · Score: 1

      I give Windows, Apple, and Linux as prototypical examples of different approaches and where they can lead. Apple threw out their system almost entirely. Linux makes their code better and rewrites whatever gets broken by it. Windows just continues on with what they have, trying to tack onto it. Note that Windows model is not "backwards compatible at all costs", for example WINE has better support for older programs than Windows.

      I point these models out to note that a complete rewrite can work well and produce the best end result. Another good approach is the continual rewrite as exemplified by Linux. What they currently have is like Windows.

      I am not mistaking the point, which is good in general, but rather pointing out that you are assuming that they have somewhat separate modules that can be re-written or replaced one at at time. You're assuming that they can write test cases, when the reality may be (and my guess is) that they have outputs that they are not even sure are correct. And lots of vestiges that shouldn't be carried over into anything new.

      My one suggestion for the story poster for going forward is to take the linux model in the future, regardless of whether this particular software is scrapped or not. Don't let the code stagnate, keep taking a little bit of time here and there to rewriting parts to be 'better' (not a huge amount of time, but enough). This is where parent's unit testing, iterative changes, etc come into play and are a good idea. If you "waste" 10% of your time all along making the code better, but then get new features added in 1/2 the time you way ahead of the game.

    6. Re:Oh my. by TheOtherChimeraTwin · · Score: 1

      Shhhh! He might want to have his boss read this. Don't let on that the fix is in.

  15. FDA? by hackwrench · · Score: 1

    That puts a whole new spin on "eating your own dog food".

    1. Re:FDA? by Nicolay77 · · Score: 1

      I don't want to make or eat dog food (java or whatever the managers wanted for me). I want to make and eat crunchy and tasty nice cookies (Python or Ruby could be it).

      I decided that, and understood what the term "dog food" really meant when reading this:

      I Have a Feeling We're Not In Emerald City Anymore by Henry G. Baker.

      --
      We are Turing O-Machines. The Oracle is out there.
  16. Process != Language by bssteph · · Score: 5, Insightful

    You say you're looking to achieve a "FDA approved software development process." And your IT director decided that Java is the magic bullet.

    This should be setting off some kind of warning in your head.

    A software development _process_ has little to do with implementation language. What you're looking for is a way to verify that you and the rest of your developers can rigorously apply software engineering principles in your organization and (reasonably) predict cost, development times, etc.

    You should have your developers reading the Capability Maturity Model, not books on Java. The government loves the CMM. I'd suspect a critical organization like the FDA would want CMM Level 5 (as hardcore in software engineering as you can get) out of your _organization_.

    That is, the process is people, not implementation language. Java being the green light is a load of malarkey (or at least, it should be).

    1. Re:Process != Language by jcoleman · · Score: 1

      The point here is that a different implementation language would better serve the needs of the desired process. If they're trying to move to an Agile model, which it sounds like they are, then Java using Spring and Hibernate will assist in that process. Spring especially is designed to make best practices more easily attainable. Following best practices makes the code more maintainable. IMO, maintainable code equates to fewer bugs & happier developers that can spend more time understanding the problem domain. This seems to be what they're going for.

      Even if this transition does take a year or more, they're already losing money because of their current process. The technologies mentioned are built around a better process, so using them will at the very least help them change their mindset. I'm not saying that C++ can't be used in such an environment, but it seems that it'd be that much more difficult - especially since their code base seems to need rewriting anyway.

      Coleman

    2. Re:Process != Language by sadr · · Score: 1

      Speaking as someone who does life critical software development, the LAST thing they are going to be able to use with FDA approval is an Agile process.

      These processes are all about mega-reams of documentation, proof that you've done all kinds of analysis, and audits of all of your process.

    3. Re:Process != Language by jcoleman · · Score: 1

      Agile doesn't mean no documentation. It means less documentation, sure. It doesn't mean no analysis, it doesn't mean no audits - it means that these things should be done when they make sense and in ways that make sense. Having this sort of requirement from the customer means that it should be done. There's no reason that agile development methods shouldn't be used. For the most part, agile development methods are best practices anyway. This means EXTENSIVE unit testing (written BEFORE the implementation classes), EXTENSIVE interaction with the customer, and documentation that actually matches the implementation (remember, if documentation and code don't match up, they're both wrong). Said documentation can be extensive as well.

      Part of agile (to me, at least) is taking away the tedium of development - automating the build and deployment, especially. Having a automated, documented, and repeatable build process seems like it would pass any audit. This also lets you analyze the health of your projects more easily too. It all comes together with Agile...

    4. Re:Process != Language by sadr · · Score: 1

      While I'll certainly agree that certain best practices that are also used by Agile can be applied in a safety critical environment, I think the biggest problem is that safety critical processes tend to have more people, and more non-developers, involved than pure agile methods can easily handle.

      Many of the advantages from Agile come from the fact that you are strongly encourage to ASK to the person who's the expert how something works. You pair program. You communication verbally. This doesn't leave the paper trail needed to do a safety analysis on your changes.

      Agile methods also eliminate redundancy in documentation by writing as little documentation as possible at high levels, and using lower level forms (such as unit test cases) to express them precisely.

      This doesn't scale well to larger organizations. Somewhere around 10-20 developers is usually given as the threshold, although I think I've seen a few numbers higher.

      It also doesn't scale well to an environment where you have safety engineers, certification engineers and systems engineers who have to read the requirements and understand how they change especially if those people do not read code. (Not to mention the people at the certifying agency.) In fact, the people who are certifying (testing) the product against the requirements are not ALLOWED to be the people who write the code in our environment. This means a very detailed requirement specification has to be written (vs. use cases on index cards.)

      And things that are a very good idea, like refactoring often, become a bigger issue when you have to document every change so that several different people can analyze the safety implications of your code change. There can be significant regulatory implications with significant customer expense if you decide to touch too many functions in the system, even if the external system behavior does not change.

      If you run through the extreme model, about half the things Just Don't Work (or at least are Very Insufficient) in a safety critical environment. (And things like automated builds and solid SCM are a no-brainer in ANY environment, and are pretty much required in a safety critical environment.)

      Certainly minimizing the documentation, audits, etc. is a laudable goal, and we do as much of it as possible. And everyone should take advantage of best practices as much as possible. And automating as much of the process (both for the developer and the organization) is a fine thing. But I have yet to see a safety critical process that is even close to Agile.

  17. Update the resume by duffbeer703 · · Score: 1

    So you're overwhelmed by the C++ workload, so you're porting the whole kit and kaboodle to Java? Your management is either retarded or getting ready to offshore everything.

    --
    Conformity is the jailer of freedom and enemy of growth. -JFK
  18. Unfortunately, you're solving the wrong problem by sfjoe · · Score: 1

    Moving from C++ to Java is irrelevant. The nut of the problem is your poor software engineering. Moving to Java will not magically solve that and your IT Director is an idiot for thinking it will. You probably already knew that so my pointing it out isn't all that helpful. If your existing C++ architecture is difficult to manage, your new Java architecture will also be difficult to manage. The best thing you can do is to throw everything away. Use your current code as a prototype to illustrate desired end-user functionality but do NOT try to replicate it. Re-write from the ground up and throw away all the mistakes that have been made.

    --
    It's simple: I demand prosecution for torture.
  19. If you are asking this question on Slashdot by SocietyoftheFist · · Score: 1

    You and your manager are obviously not as experienced or capable as you think you are. You really think you are going to port 5 years of code to Java? What guarantee do you have that this off-shore outsourcing company isn't going to just bolt with your code? Who do you know that has worked with them. How did you come to work with them? You sound like you don't know your own requirements.

  20. Also: "Things You Should Never Do, Part I" by Jerf · · Score: 1

    In addition to my other comment, be sure to read Things You Should Never Do, Part I from JoelOnSoftware.

    People have varying opinions on his work, but in this situation, if you can't answer his objects you should not rewrite.

    1. Re:Also: "Things You Should Never Do, Part I" by Lumpish+Scholar · · Score: 1
      ... be sure to read Things You Should Never Do, Part I from JoelOnSoftware.
       
      People have varying opinions on his work, but in this situation, if you can't answer his [objections] you should not rewrite.
      Agreed; but what should you do instead?

      A good answer can be found here and particularly here: rewrite it a bit at a time, adding unit tests as you write or rewrite code. Like the "rewrite from scratch" plan, you'll spend a lot of time working on functionality you already have. Unlike that plan, you'll have a system with all the functionality and increasing quality, rather than one system with decreasing quality and another with partial functionality (and probably no better quality, but that's another comment).
      --
      Stupid job ads, weird spam, occasional insight at
    2. Re:Also: "Things You Should Never Do, Part I" by bwt · · Score: 1

      This is interesting. It is a article from April 2000 criticizing netscape for rewriting their browser. I don't think that, with the benefit of hindsight, I can agree with his conclusion. I think he was very short sighted. Firefox is a very good browser and it would not exist if they hadn't done this. Had Netscape continued to code the original code base, their market share decline would have perhaps been a little slower, but it would have been more inevitable. As it stands, six years later, firefox has some momentum because it is techncially superior to IE because of the code rewrite.

    3. Re:Also: "Things You Should Never Do, Part I" by GorillaTest · · Score: 1

      Did you miss the point that they squandered their place in the market as a result of doing this? For all practical purposes, they torpedoed themseleves. They went through the same thing with Netscape 4.0, which was a total re-write. The product was late and their place in the market began to erode. So as I see it, at least twice they eroded market position for the satisfaction of throwing out Joes old code. "Never could read that code, and I didn't like that guy anyway"

  21. Resign by Anonymous Coward · · Score: 0

    This sounds like one of those no-win situations. You'd be crazy to rewrite all your stuff in Java, from scratch. If you have no choice, resign and go work somewhere less insane.

  22. How are you validating? by bill_mcgonigle · · Score: 4, Informative

    Before you go and hire a bunch of off-shore'ers you need to hire an on-shore FDA compliance expert who can walk you through developing a CFR 21 Part 11 compliant development process. The funny thing about the FDA process is it doesn't recommend best practices rather it forces you to make a plan and stick to it (and document that). They want a paper trail should anything go wrong more than anything else, so problems can be indentified and fixed. You ought to do a bang-up job as well, for your company's competitiveness, but that's optional.

    Expect to properly validate all your code with good test cases. This is probably a good thing for moving languages. Write a test case for the C++ code, validate that the C++ code works, implement the Java version, make sure the test case results are still the same. The JUnit tools might be helpful here, though I haven't used them personally.

    Java gives you some advantages to write more robust code, especially among collaborators. But you can thwart that by doing try { } catch (Exception e) {} instead of catching the real exceptions. That's a matter of coding practices - you ought to mandate people catch actual exceptions thrown and call them girly-men if they don't. If you mandate it in your process they have to follow it or you won't be compliant.

    I also find Bugzilla to be very helpful in an FDA-complaint process, using the VERIFIED status to mean 'validated'. CVS is really important, or probably Subversion today.

    Over all you'll probably feel like you've done a better job as a software developer by using a good FDA-compliant process because bean counters can't force you to cut corners, though good work can be tedious. Beware they don't fool you into working crazy hours to make up for the additional workload.

    --
    My God, it's Full of Source!
    OUTSIDE_IP=$(dig +short my.ip @outsideip.net)
    1. Re:How are you validating? by ultranova · · Score: 1

      Java gives you some advantages to write more robust code, especially among collaborators. But you can thwart that by doing try { } catch (Exception e) {} instead of catching the real exceptions. That's a matter of coding practices - you ought to mandate people catch actual exceptions thrown and call them girly-men if they don't. If you mandate it in your process they have to follow it or you won't be compliant.

      There's a problem with this: some Java code (including Sun's JVM class libraries) throws exceptions beyond what the documentation claims. Specifically, ImageIO.readImage() (or whatever it was called) throws completely random crap when fed malformed image data. Understandable, as it apparently delegates the actual work to modules, but forces the developer to either catch Exception or watch his application crash and burn.

      Yes, I know, code that throws undocumented exceptions is buggy, but knowing that doesn't help you any when you need to interface with that code.

      --

      Forget magic. Any technology distinguishable from divine power is insufficiently advanced.

  23. Common Tips by Anonymous Coward · · Score: 0

    Here are some tips for things you'll likely run into:

    - Use Lazy Loading and Background Class Loaders to hide the slow class load times from your user. First impressions count!
    - Use A Splash Screen (eg. launch4j) if a GUI app
    - Expect to set minimum hardware requirements for your customers.

  24. Take it from a Java guy new to J2EE by MikeRT · · Score: 2, Interesting

    J2EE before things like EJB 3.0 is pure crap. Convoluted, difficult to grasp crap. Research the lightweight frameworks and give them a shot first. They're much more straight-forward and Javaesque than old J2EE. Java was supposed to be a simplified C++, but older J2EE actually made it quite complicated, and really unnecessarily so.

    I'm not trying to troll, as I actually like Java and think it's a solid language. I'm just not going to lie to you and say that the JCP people were sobre when writing up the older J2EE specs.

    1. Re:Take it from a Java guy new to J2EE by Anonymous Coward · · Score: 1, Interesting

      Yep. I used to hate working with Java several years ago because of EJBs and confusing, impenetrable frameworks with dozens of XML files. I've since looked again at Java. Things have improved.

    2. Re:Take it from a Java guy new to J2EE by Nemi · · Score: 2, Funny
      Research the lightweight frameworks and give them a shot first.

      You mean something like, say... Spring and Hibernate? What a good idea! Why didn't he think of that??

  25. Why change? by Fred+Nerk · · Score: 3, Interesting

    My professional advice would be to stick with what you've got. If it's 6 years worth of C++ code, it's probably going to take roughly that amount of time to get to the same place with Java.

    It'll be slightly quicker because you already know what you have to duplicate, but more than likely you will go through the same bugs and teething problems that were already solved years ago all over again.

    If you get this offshore company to redevelop in Java, they are going to hand you a pile of code which you don't understand (because you're all used to C++), and don't have any stake in. Your developers are going to be less interested in fixing other people's bugs than their own (that's my experience anyway).

    I think you'd be better off spending the money to hire some local contractors to cut down your codebase. Keep the language and functionality the same, but any project which has grown over 6 years is going to have crud that can be removed or rewritten. Spend your time imroving what you've got rather than starting again.

    Also my experience of one offshore dev company was that they cut & pasted some open source (GPL) code, changed a few lines then tried to charge me for 3 months of development work.

    --
    Anything is possible, except skiing through revolving doors.
  26. Marginalise rather than rewrite by Anonymous Coward · · Score: 0
    I'm going to follow the trend and say that you shouldn't ditch and rewrite unless you haven't gotten anywhere, which I doubt.

    You've got some abstraction between interface and app logic and database, presumably? Choose a meta-language (Java, .Net) that will let you talk multiple languages (I'd suggest C# and Managed C++ via .Net/Mono).

    This way you can reuse and marginalise the other language over time.

    Basically we're all asking you to apply evolution, rather than revolution.

  27. business cost of finding more developers by coyote-san · · Score: 2, Insightful

    Something overlooked in the trenches is that there's a very good business reason for switching from legacy C++ to solid Java (spring/struts/hibernate).

    Finding employees.

    Not because of "oh, I'm too good for C++" jerks. Just the simple fact that most recent development has been in Java, not C++. (C is also increasingly hard to find.) That's important when you're looking to expand your staff or replace departures -- it's harder to find people who are current in C++, and harder still to find good people who stayed with C++ instead of migrating to Java.

    Same thing with using standard packages like Spring and Hibernate. They may not be the best technology, but they're almost always good enough and you can find good people who know how to use them.

    As for outsourcing... huge mistake with a project this small. Besides the nightmare of managing a small team in a distant timezone, development teams this small need a lot of soft skills specific to the deployed environment. You could get around that with a rock solid spec, but I doubt that's the case here.

    --
    For every complex problem there is an answer that is clear, simple, and wrong. -- H L Mencken
    1. Re:business cost of finding more developers by Anonymous Coward · · Score: 0

      You're insane if you think "most recent development has been in Java". It's a fact huh?

      Lets get this straight. If you work on web stuff and similar software then maybe, maybe Java is more popular (I would argue PHP, Ruby, Python have more code written per day than Java). But web development is a tiny fraction of software development.

      How many PS2, XBox, or whatever games are written in Java? What about office applications like Photoshop, Word, Excell, Oracle, etc, etc, etc? What is Firefox written in? Trust me, Java isn't that big a deal and C/C++ are bigger than ever.

    2. Re:business cost of finding more developers by heinousjay · · Score: 1

      You're just plain stupid if you think that PS2 development trends have anything to do with business needs.

      --
      Slashdot - where whining about luck is the new way to make the world you want.
    3. Re:business cost of finding more developers by Anonymous Coward · · Score: 0

      Yes, it's easier to find programmers who know Java. Finding GOOD programmers who know Java is just about the same level of difficulty as for C++. There may still be more of them out there, but you have to sort through a lot more crap.

    4. Re:business cost of finding more developers by Anonymous Coward · · Score: 0

      You have got to be joking, right? Thats what sucks about programmers, they are so language dependent. It sounds to me, since they are going for compliance and all, that they need a software engineer as opposed to a code monkey. "Learning a language" comprises less than 5% of a developer's time. What would really benefit you is if you went through Personal Software Process and Team Software Process training, check out Watts Humphrey. He may be crazy detail oriented, but I think most of us are on the lazy/sloppy end of the spectrum as opposed to the restrictive/management overhead end of the spectrum and could benefit from some defined processes

    5. Re:business cost of finding more developers by jythie · · Score: 1

      PS2 development trends have quite a bit to do with business needs, within the console development community.

    6. Re:business cost of finding more developers by coyote-san · · Score: 1

      It's not LANGUAGE dependence, it's LIBRARY dependence. I was an extremely productive C developer because I knew the obscure (but standard) libraries and tools and could do something in a few days that would take others months (or longer!) to code and test.

      I've made the transition to Java over the last few years. I knew Java syntax within a week (and thought some of the "obscure" stuff was irrelevant), took 6 months to learn the J2SE library (aha, I should use this class!) and another year to really understand how to use it properly. Over the same time I went from seeing anonymous inner classes as dangerous to a critical (and robust) solution to some common problems.

      The software engineering process wouldn't speed this up at all, not unless you were able to set up a mentoring system with somebody who really knew his stuff.

      BTW even the software engineering process can change between languages. Good shops will always do unit testing, Java provides incredibly rich - and standard! - support via junit, jmock et al.

      --
      For every complex problem there is an answer that is clear, simple, and wrong. -- H L Mencken
    7. Re:business cost of finding more developers by coyote-san · · Score: 1

      Let me more precise -- I'm referring to workstation and server software, not kiddie-pool web sites or games. Don't get me wrong, the latter are important in their own niches but you don't run SME (small to medium enterprise), much less large enterprise or scientific software, on top of PHP. Five FTE developers is on the low end of SME, but my current team is smaller and our client base is 80k professionals.

      I've been tracking the local job listings for years and the job listings probably split 70% java, 25% C++ (100% legacy) and 5% C (100% kernel and device driver). The recruiters I keep in contact with have been presenting positions with the same rough split -- even though several of them know that I'm very good at Unix/C development. If the C market is expanding none of us have seen it.

      I don't think it's a temporary shift either. Nearly everything I did in C/Motif would now be done in Java/browser, and much of the backend stuff would use Java as well since the way we think about the problem has shifted.

      (P.S., you're joking with the 'office software' comment, right? Doesn't the fact that you can name the handful of products that dominate their niche tell you something? How many developers does all of Microsoft, Oracle, Adobe, etc. account for -- maybe 1% of the total competent talent pool?)

      --
      For every complex problem there is an answer that is clear, simple, and wrong. -- H L Mencken
  28. Which "C++"? by neutralstone · · Score: 3, Insightful

    Are you talking about Standard C++ or Microsoft++? There's a considerable difference, especially in recent years.

    Microsoft likes to present a lot of its own extensions as "C++" features. In particular, they like to present C++/CLI (a.k.a "CLI++") keywords as "C++" keywords.

    And then there are the managed extensions. (But even Microsoft has deprecated those in favor of CLI++.)

    Going back even further, there's MSVC 6. Lots of people still use it, but it's just too old for anyone to expect it to be close to Standard compliance.

    What compilers do you work with? Do you set compiler options to disable extensions and run in a "strict" standard-conforming mode? Do you use more than one compiler?

    Do you make judicious use of the STL? Do you use any part of Boost? (If not, you should seriously consider taking some time to learn about these best-of-breed libraries that are available *for free* and for which support is available from multiple consulting firms.)

    Did you give up trying either of those libraries before trying out STLFilt? (If so, go play with it. You'll probably want to give generic programming a second try.)

    Have you and your team read any of the *good* C++ books? E.g.:

    http://tinyurl.com/puhjb

    http://tinyurl.com/ru625

    http://tinyurl.com/mrdgo

    http://tinyurl.com/ounbe

    Have you invested in static analysis tools? (E.g., PC-Lint, etc.)

    Most of the C++ programmers who cut their teeth on Windows learned a watered-down version of the language by way of the Microsoft libraries (e.g., MFC, which should *not* be mistaken for a model of modern C++ interface design). If that describes most of the people on your team, you should seriously consider migrating from "kinda-C++" to Standard C++.

    1. Re:Which "C++"? by nickos · · Score: 1

      Hmm. I agree with you about C++/CLI, and I remember how bad standards compliance used to be in earlier versions of Visual C++, but more recent versions of Microsoft's C compiler (since Visual C++ 7) are amongst the most complete compilers as far as standards support goes (couldn't find an authoritative link - sorry). IIRC, MS even hired one of the STL guys to help them in this regard.

    2. Re:Which "C++"? by neutralstone · · Score: 1

      It's true that Microsoft took a big step towards Standard compliance with VC 7. However, there are still (even in VC 8) a lot of subtle areas where they are bested by both EDG and the GNU people.

      Anyone who has been compiling only with VC 7 should try using a copy of GCC/MinGW with '-pedantic' and Comeau with '-A'.  Chances are that the code won't compile, and chances are that a majority of the errors will result from code that really is ill-formed according to the Standard.

      But of course it's possible to write a Standard C++ program using VC 7/8.  The question is whether Standard C++ features are being exploited.  Most people who don't use modern libraries like the STL and the Boost libraries haven't really migrated to Standard C++ *in spirit*; they're just using a "better C" and taking advantage of some features that support object-oriented design.

    3. Re:Which "C++"? by nickos · · Score: 1

      Ahh yes, gcc.

      where
      x ? : y
      is equivalent to
      x ? x : y

      Handy, yes. Standard, no.

    4. Re:Which "C++"? by neutralstone · · Score: 1

      Yes, the '?:' extension is non-Standard.  But note that I *did* specify use of GCC with its '-pedantic' option.  Using that option and an example using '?:', I get:

      $ g++ -pedantic -c a.cpp
      a.cpp:4: error: ISO C++ forbids omitting the middle term of a ?: expression

    5. Re:Which "C++"? by johnrusk · · Score: 1

      On the other hand, if you are using MS C++, and want to move gradually to a more modern language, what about this:

      Move to CLI++ (i.e. the new MS Managed C++, not the old one which came out with 1.1). That gives you your entire codebase, still in C++, but running within a managed environment. Then:

      - write new bits in C# if you like
      - re-write some old bits in C# if you like

      In both cases, you should get relatively seamless interop between new code and old. If you haven't read about the new MS Managed C++, look it up. Its a vast improvement on the older one. (No more "standard" than any other MS C++, but an impressive feat in terms of combining good C++ and good .NET support in a single language).

      Admittedly this is not Java at all. But it does give you a very smooth migration path to a Java-like language - with no need for any "big bang" re-write. (Of course, if your boss _wants_ a big-bang re-write, that's another story... both in terms of how you might do it, and whether you _should_ do it!)

      --
      http://www.agilekiwi.com - Agility and .NET
  29. I think Joel says it best... by danpat · · Score: 4, Interesting

    "Things you should never do, Part 1": http://www.joelonsoftware.com/articles/fog00000000 69.html

    1. Re:I think Joel says it best... by mav[LAG] · · Score: 1

      I agree with Joel but I can't help thinking that his attitude taken to the extreme is precisely what's wrong with Windows: millions of lines of legacy hacks, bugfixes and two-page functions that nobody really understands anymore and that few can fix or audit for security problems.

      I heartily agree with an earlier poster who suggested SWIG. Keep the C++ codebase and maybe refactor the bits that really need it but do all new development in a scripting language like Python or Ruby, using SWIG to wrap the existing code. I've done this before on a somewhat smaller scale than the submitter and it really worked well. You're not wasting manpower and experience either: maintenance and improvement of the C++ code will be needed.

      --
      --- Hot Shot City is particularly good.
  30. Re: Moving a Development Team from C++ to Java? by Anonymous Coward · · Score: 1, Funny

    Subject: Moving a Development Team from C++ to Java?
    Body: No.

  31. What advantage does he think he'll get with Java? by Anonymous Coward · · Score: 0

    http://developers.slashdot.org/article.pl?sid=03/0 2/09/1347215&mode=flat&tid=108 Sun doesn't even like Java.

    I agree with the other posters who think this is a bone headed move. Polish your resume indeed. Don't wait, leave as quickly as you can get another job.

    If, for some reason, I were desperate enough to want to re-write working code, I would consider a language that provides some real advantage. I like Python for most things because it is fast to write. It is also easy to produce nearly self-documenting code. That isn't what your boss asked for though; so just leave now and beat the rush.

    If this hair brained scheme works and the company still exists a year from now, post another article so the rest of us can eat crow. ;-)

  32. Java Spring and Hibernate are great, but... by Anonymous Coward · · Score: 1, Insightful

    ...That doesn't justify moving from your existing platform to Java. It sounds to me like the problems are your in your management and process, not your platform. If you can at least implement improvements in your process (tighter testing, then re-factoring) you could spend your time improving your existing codebase instead of trying to move all of that logic to a new paltform.

    As for the off-shoring, if your management thinks it is a good idea, it's time to find a new manager. They have to be looking at it as a purely cost-saving solution and are not considering the hidden costs of trying to work with people half way around the world. Many companies are discovering that off-shoring is too expensive to do half-way; you either farm to whole project out to India, or you do it all in-house and add contractors as needed. Anything else can easily get to be more hassle than it is worth.

    For comparison, I have been working almost exclusively with Java for most of it's life, and have really enjoyed using Spring and Hibernate, which both add a lot to the Java platform. That said, I can't think of any reason why I would have faith in a decision to abandon one platform for another after six years in the name of efficiency. That is the kind of decision that could only come out of poorly-informed management.

    If I were you, I'd start looking for a new manager or a new job.

  33. Consider using SWIG by wuzzeb · · Score: 1

    I would agree too, rewriting everything in Java just means wasted time programming, wasted time debugging, and wasted time testing. Now, for me at least, the best solution is to do all future development in some managed, garbage collected language and use your existing C++ code from inside that language.

    While directly using JNI or the Python C API is possible, the SWIG Project reads C++ headers and generates the neccissary code to use that from Java, Python, or many other languages. It works on Windows and UNIX. While it isn't 100% magic, it is about 92% magic with just a little bit of extra directives and stuff you need to tell SWIG about. For a huge project, the automation SWIG provides really makes it possible to use a huge C++ library from inside Java or Python (or Ruby, etc).

  34. Framework is the way to go by wysiwia · · Score: 2, Interesting

    As others have already asked, what environment you currently use is critical for any development strategy. Simply switching from C++ to Java will gain you nothing, what counts is what better framework you want to use. Since you only mentioned Windows I guess you just use plain MFC but since you also mentioned Java I guess you need to divert to a cross-platform solution.

    In case your future environment has to produce binary applications you are IMHO best of if you switch to the wxWidgets framework (http://www.wxwidgets.org/). Since you already have C++ knowledge and wxWidgets is quite easy for Windows developer it shouldn't be a big problem to become familiar. I'm quite sure with wxWidgets you are equally efficient as with any Java framework but don't have the disavantages of Java.

    You can use wxWidgets regardless of any platform consideration, if you just want to stick to Windows or to Linux or whatever, it doesn't matter. But if you also follow the guidelines of wyoGuide (http://wyoguide.sf.net/) you can move your code anytime to another supported platform and just release it. As long as you just use the features of wxWidgets there's no need to recode anything on other platforms ever.

    If you want to see how well this approach works try out my samples (wyoEditor http://freshmeat.net/projects/wyoeditor/, wyoFiler http://freshmeat.net/projects/wyoeditor/) or look into Audacity. Or look out for the commercial application Xara. There's probably no alternatives for cross-platform development as if you do single-platform development as with wxWidgets/wyoGuide. And keep in mind, no Java disadvantages.

    O. Wyss

    --
    See http://wyoguide.sf.net/papers/Cross-platform.html
    1. Re:Framework is the way to go by shutdown+-p+now · · Score: 1

      Actually, to get as closer to Java as it gets with C++, Qt is quite a bit more helpful than wxWidgets - assuming you do not mind GPL. While wxWidgets claims to be a C++ framework, it uses a subset of C++ coming directly from the stone age - no templates, for example (this makes collections particularly annoying to work with), and MFC-like message maps for event handling. Qt is not really a "proper" C++ framework either (in a sense Boost is, for example), but it is not afraid to use many nicer C++ features where it's convenient. The tools available are also generally better, especially the Qt Designer visual UI editor.

    2. Re:Framework is the way to go by Nicolay77 · · Score: 1
      I see no reason to be closer to Java, as I'm more productive in C++ (with wxWidgets) than in Java, in the kind of applications where you can use either.

      I guess you evaluated both toolkits but you have written real code only with QT. In my case I evaluated both and I have written real code only with wxWidgets, so take my bias into account.

      I agree that MFC message maps are ugly, but they are not obligatory, in fact I use none of them in my new wxCode. I have code like this in the constructors (or wherever is needed):
      Connect(ID_Add, wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(tparticles::OnAdd));
      It's just convenient for some people used to the MFC maps.

      And the fact that it uses no templates, is an advantage to me. (FAST compilation, smaller exes)
      WX_DECLARE_OBJARRAY(probnominal, probsnominal);
      WX_DEFINE_OBJARRAY(probsnominal);
      is no harder to write than
      typedef std::vector<probnominal> probsnominal;
      I see no difference using one or the other except for this, so it's a non issue to me.

      I can do someTextCtrl << "number: " << someintvar; if that's what you mean by nice modern stuff.

      And yes, the wxWidgets license is a GREAT advantage (one of the best licenses ever).

      And about your remark about a subset of C++ coming directly from the stone age:
      Templates are good and nice, when used like in the STL but they are not necessary, just like multiple inheritance is nice to use sometimes, but should not be overused just because C++ has it.
      And everything should not be a class (like in Java, ughh) when it's not necessary. Some classes don't need to be part of a class hierarchy, and some classes don't need getters and setters.
      And templates are much harder to debug, both for the programmer and for the IDE.

      Using just a subset of C++ is the right way to use C++ IMHO.
      In fact, sometimes using it just as a better C is the right way.
      And you still have the full power of C++ when you need it, which is not all the time.

      So, my point is (for the guy with the problem): wxWidgets is a very good option (IMO much better than java if you have a C++ codebase) an you should evaluate it without any bias.
      --
      We are Turing O-Machines. The Oracle is out there.
    3. Re:Framework is the way to go by shutdown+-p+now · · Score: 1
      wxWindows is not really any further from Java-esque programming style than Qt. Both frameworks try to replace rather than complement standard language and library facilities. If you want to see a pure C++ UI toolkit, Gtkmm is probably the closest we have to it. Though neither Qt nor wxWidgets prohibit you from using the advanced features of C++ if you want to (generic programming, and by extension STL & Boost etc).

      I have written real code in both wxWidgets and Qt. In fact, I have written more in wxWidgets, though admittingly not with the latest major version. It was my experience with wxWidgets that prompted me to look into Qt, but back then the main trouble was the lack of free version of Qt for Windows. Once it was taken care of with the release of Qt4, I do not see any reasons to prefer wxWidgets over Qt unless you're developing a proprietary application, but do not want to pay for your framework.

      Regarding templates. "Small EXEs" claim is untrue - assuming the compiler handles templates properly (all modern ones I know do), it will expand templated classes into the same code as wxWidgets macros. "Faster compilation" is also of marginal importance - it's not the era of 486s anymore. As for code brevity - the point you missed is that C++ templates do not require typedefs, and, in fact, I much more often just use the full type declarations inline: they rarely repeat - usually you only declare an member variable once, which is where you have to spell out the type, and then refer to it from other places.

    4. Re:Framework is the way to go by wysiwia · · Score: 1

      I guess you evaluated both toolkits but you have written real code only with QT. In my case I evaluated both and I have written real code only with wxWidgets, so take my bias into account.

      I neither have enough QT practice to decide what's better. I've asked several QT people (including Trolltech and a leading KDE developer) to submit QT sample code for wyoGuide but so far nobody volunteered. I don't know why nobody did but it would be a nice sample for a comparison.

      I agree that MFC message maps are ugly, but they are not obligatory, in fact I use none of them in my new wxCode. I have code like this in the constructors (or wherever is needed):
      Connect(ID_Add, wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(tparticles::OnAdd));


      I don't care that much if they look ugly but I prefer to have all events concentrated in one place than to search for all "Connect" in the code.

      And yes, the wxWidgets license is a GREAT advantage (one of the best licenses ever).

      Yes, IMO for a cross-platform framework it's the only possible one. The LGPL is barely acceptable but the GPL isn't more useful than any closed source license.

      So, my point is (for the guy with the problem): wxWidgets is a very good option (IMO much better than java if you have a C++ codebase) an you should evaluate it without any bias.

      That's exactly my point as well, QT might be equally suitable, but wxWidgets is far better than any Java solution. Still one point I have to stress again, I've you want to build good cross-platform applications you have to conform to the wyoGuide guidelines. Only then can you develop on a single platform and more or less just move the code to other platforms. Only then becomes your application usable by ordinary users, only then will your application fit well with others.

      O. Wyss

      --
      See http://wyoguide.sf.net/papers/Cross-platform.html
  35. why java? by Anonymous Coward · · Score: 0

    if you're going to change languages, move to
    python or ruby

  36. managed C++ by m874t232 · · Score: 1

    Technically, the best solution for this kind of migration could be moving the code to managed C++: you keep your working code, the managed environment may find bugs you didn't know about, and you can do new development and rearchitecting in a more productive language. A big practical problem with that is that the only mainstream managed C++ solution comes from Microsoft and you may not want to be tied to Microsoft platforms (I don't).

    But that's probably the only generic advice one can give you. Beyond that, deciding whether Java or anything else is the right choice depends on too many factors.

  37. Experienced or not? That's the question. by Maljin+Jolt · · Score: 1

    If it's a highly experienced C++ team, they will be disgusted with Java. Expect team morale going low. But if they are quite inexperienced, Java will make their life easier, morale up.

    --
    There you are, staring at me again.
    1. Re:Experienced or not? That's the question. by try_anything · · Score: 1

      I think a better question is, are the C++ coders writing the kind of C++ code that was typical ten years ago?

      If so, they haven't adapted to new C++ practices, and there's no way they'll adapt to Java. They'll write terrible Java and be miserable.

      If not, then they'll adapt to Java pretty quickly. Some of their C++ techniques won't be possible in Java, but they'll figure out the strengths of Java in a few months and start writing good Java code.

      Oddly enough, the more modern C++ elements you see in your codebase that don't have direct analogs in Java, such as template metaprogramming and RAII, the more optimistic you should be. Those items show that your programmers have learned and adapted to new paradigms and can be expected to adapt well to Java.

  38. No reason why by Wolf+von+Niflheim · · Score: 0



    This seems like some sort of panic reaction: "IT problems, let's hire a third party, they'll know what to do." Looks like they lost fate and had an "Out with the old, in with the new" feeling.

    Frankly I don't see why switching to a different language and rewriting everything would be faster and more economical than rewriting parts, finetuning and sticking to the same language. Especially considering the fact that that language is C++, would it have been brainfuck, well that would be another story.

    Just my thoughts

    --
    In Soviet Russia elephant rides you!
  39. Bad idea by DarthChris · · Score: 1
    FTFA:
    I find it more likely that the problems we have would persist across languages or architectures (lack of time and resources leading to buggy code, lack of direction from marketing, and so on).
    You hit the nail on the head here. In fact you'd probably be worse off since you've mostly got to learn Java etc first, and a management willing to throw six years of code down the tube is probably not going to give you time to do silly things like learning new languages. You'd be better off rewriting sections of your existing code so as to clean it up.
    --
    Don't you just hate it when people reply to your signature?
  40. A couple of advices by Aceticon · · Score: 2, Informative

    From somebody that DID do C & C++ and has been doing mostly Java for a number of years now:

    - Get an experienced Java Developer/Designer/Architect inhouse at least for preparing and doing the migration. Put that person in a team-lead/team-coach role or at the very least use him/her for high-level design and for code reviewings. No mater how good you guys are, when you move to a different language AND more importantly a new set of libraries and frameworks, if you do it on your own you're going to make all the mistakes a "new guy" does which means a lot of going back and forward as you figure out that your initial design doesn't quite work with Hibernate/Spring/J2EE/whatever.

    - Develop a couple of some small apps first, just to get some experience with the language itself - take a week or two doing it. Try and use the libraries/frameworks you wanna use in the main project - for example, if you wanna use Hibernate to access the database, do a small app that works with it.

    - If some of you guys are still using non-object oriented features from the C side of C++, you're going to have problems moving to Java. The simplest solution is using loads of static methods in an auxiliary class. DON'T! Generic auxiliary methods in Java are the exception, not the rule in most applications.

    - Beware of thread safety. Multi-threading is a built-in feature in the standard Java libraries, and when using some of the major frameworks (J2EE for example, both the web side and EJBs) or having to deal with asynchronous events from multiple external entities (for example the server-side of a multiple-user client-server app) it is almost guarante that some of your methods WILL BE called by multiple threads simultaneously. If you make auxiliary methods at the class level (or worse, in a generic class), beware of them keeping state - in a multi-threaded environment there is no guarantee that said methods will be called in any given order, even if the your code looks like it will never do otherwise. The only way to control multi-threaded access to resources that have state is to either not share them (ie put the auxiliary methods in an object or encapsulate state in an object that gets passed to the methods) or carefully using synchronized blocks and methods (very few people know how to do the last one properly). Fortunatly, good OO encapsulation avoids most problems with multithreding.

    1. Re:A couple of advices by MythMoth · · Score: 1

      If they really do go ahead with this stupid, stupid idea, then I second all of the well made points in the parent post.

      --
      --- These are not words: wierd, genious, rediculous
  41. Do it incrementally. by Anonymous Coward · · Score: 0

    I need more information to offer much more advice than this but one of the many things that Java is pretty good at is calling native code. So if I were you I would start by writing a bunch of wrappers onto your existing C++ libraries and start doing new development in Java. As you need to add/modify functions you can port that portion of your library to Java and so on. Its a nice language and pretty easy to pick up from a C++ background. Get hold of a copy of Thinking in Java by Bruce Eckel as a starter tutorial and look out for a new addition of Effective Java by Josh Bloch.

    The big plus point you'll get from Java whatever you are doing are:

        1) Decent refactoring support in all the major IDE's makes it a lot easier to avoid your current problem in future. Check out Jetbrasins IDEA for a start.
        2) Garbage Collection easy memory management.
        3) Threads a real joy when writing multithreading apps. The implementation is minimal and elegant. The simple way that methods can be protected from concurrent update, the equally simple semaphore and critical cod mechanisms, the very easy way of creating a rendezvous between two threads, all combine to make this a good language feature.
        4) Exception Handling. Main thing here is the finally block in Java. Every try block can have a 'finally' clause. Any time such a block is exited, regardless of the reason for that exit (e.g. execution could proceed out of the block, or an exception could pass through it) the code in the finally clause is executed. Checked exceptions are more controversial but I like them and think they tend to lead to more robust code. At least they force you to consider error handling as you go.
        5) Amazing collections of open source libraries Jakarta common is a good place to start.
        6) Huge vendor support.
        7) Seriously cross platform. All my Java code is developed on Windows machines but runs on Linux, AIX, Z/OS etc. I haven't had a problem moving from one to the other in years.

    Having said all of this no tool is ever going to fix poor practice so you might want to think about why your code base ended up being (by the sounds of it) such a mess in the first place.

    1. Re:Do it incrementally. by Profound · · Score: 1

      C++ finally block:

      {
              class Finally {
                      ~Finally() { // stuff goes here.
                      }
              } foo;

              try {

              } catch {

              }
      }

  42. Allow a year by Chris_Jefferson · · Score: 1

    Based on one sample of personal experience, I would say you should allow about 1 year to convert all your code to Java, get it back to the state it is now, and work through the hundreds of minor bugs that are certain to crop up. That is I think one of the most important things to consider. Do not underestimate how long the conversion will take.

    By moving to Java, the main things you gain are garbage collection, and generally much better memory protection. Yes I know in theory you can do these things in C++, but it can be easier when your language handles it for you. You also lose all the complex template-foo you can do in C++, which you can either decide is an advantage or disadvantage :)

    --
    Combination - fun iPhone puzzling
  43. What a great solution by mwvdlee · · Score: 1

    So the solution to the problem of resource shortage is to spend a lot of resources rewriting code.

    On another topic: I have professional experience with both Java and C++. Not a lot; about two fulltime years each. The thing is; Java has a lot of theoretical benefits and will theoretically run at about the same speed. Perhaps in 10 years it will, but right now I can see no technical reasons to prefer Java. The real reason is, presumably, an outsourcing one.

    --
    Slashdot social media options: AIM, ICQ, Yahoo, Jabber and Mobile Text. Why no MySpace?
  44. Been there, done that... by bigmouth_strikes · · Score: 1

    Apart from the C++ part, a former employer of mine did this back in, oh... 2000 or so. Numerous projects were started to move the monolitic behemoth of a product to a componentized Java version.

    A complete waste. Tens of thousands of man-hours and millions later, only miniscule parts were rewritten, albeit without the possibility to interoperate with the legacy code.

    Just like it sounds from you, this is a internally triggered initiative, not something that came from sales or marketing. Chances are noone wants the product when you're half-done in a few years.

    My advice: start looking for another employer. Maybe after you've taken all the Java training and certifications...

    --
    Oh, I can't help quoting you because everything that you said rings true
  45. When it all goes wrong... by Beek · · Score: 1

    As others have suggested, be VERY suspicious if it isn't an incremental switchover. I have a feeling that won't happen for you, and the offshore company is going to enjoy your company's money a lot.

    When it all goes wrong, please do a little write up of the events and submit it to The Daily WTF.

  46. Have you learned from your mistakes ... by Lumpish+Scholar · · Score: 2, Interesting
    ... only to do even worse this time?

    Seriously, that trick (pretty much) never works. I remember one project where six developers in a row said, "This code is unmaintainable, it needs to be rewritten from scratch." Think about it: it was rewritten from scratch five times, and each time, the result was still so bad that the next maintainer gave up on it.

    Here are some questions for the IT director's boss: When has this director done something like before? How successful was it the previous time(s)? What mistakes were made in those cases that you can learn from this time around? What mistakes were made in the development of your current system that you can learn from this time around?

    (Are you risking your job by going over the IT director's head? News flash: your job is already at risk.)

    You guys are about to be squeezed seven ways from Sunday.
    • The IT director is counting on offshore outsourcing to replace the system; it's probably planned as a one-way trip, and (if successful) likely to go that way even if that's not the plan. (The director's job is as likely to be relocated as yours is.)
    • The offshore guys are calling the technology shots, for their convenience, not your benefit.
    • Worst of all, the director has given up on maintaining the software; if someone can't manage maintenance, they probably can't manage a major greenfield development project, either.

    You're probably psyched about getting to learn new technology. Well, get psyched about this: odds are, the project will fail, the IT director will be fired, his or her successor may be even worse, and you guys will not be fired, but instead will still be left trying to clean up the mess you currently have.

    Fight it; you have nothing to lose but a job that's about to get a lot worse.
    --
    Stupid job ads, weird spam, occasional insight at
  47. Been there done that by SysKoll · · Score: 2, Interesting
    I used to work in the Software Group of a large (large!) company that had developed its flagship application server mostly in C++, starting from the late 90s. We had a huge bugginess and productivity problem. The bug fixes were coming too slow and we had persistent quality issues. Furthermore, we could not port our C++ code to the umpteen platforms that marketing wanted to target.

    In 2000, we made the decision to move to Java. Moving to Java was painful at first. We managed to introduce new Java code while reusing the old C++ parts for a while, but we finally rewrote everything in Java. The Eclipse IDE boosted our productivity considerably, and the product is very successful. So I guess it makes sense.

    --

    --
    Mad science! Robots! Underwear! Cute girls! Full comic online! http://www.girlgeniusonline.com/

    1. Re:Been there done that by kupci · · Score: 1
      Cool, I think this is what the poster was interested in, folks who've actually made the switch successfully.

      Furthermore, we could not port our C++ code to the umpteen platforms that marketing wanted to target.

      See, here you have a requirement that was fulfilled by Java. That's a good reason. Also, you don't mention whether the system was completely rearchitected or not. Anyway, from the reasons given for this guy's question, I don't see a clear requirement, just somehow they think things will magically work better in Java. With many of the new libraries and frameworks like Boost and Qt there isn't the disparity as there once was, perhaps. I'd suggest they define their requirements, goals, develop a prototype (keeping in mind Alexander Cockburn's excellent advice on prototypes - if the prototype doesn't work, don't assume everything will magically work once it's in production!), and also, as you did, reuse the libraries as much as possible, using CORBA or some similar solution, until they can switch over completely.

      The Eclipse IDE boosted our productivity considerably, and the product is very successful. So I guess it makes sense.

      So what were you using before, vi? Emacs? Maybe if you had switched to Visual Studio (and Eclipse supports C++ too) you could've save alot of trouble ;)

    2. Re:Been there done that by SysKoll · · Score: 1
      The Windows people were using C++ IDEs, the Unix-side (and mainframe people) were using emacs, vi or XEDIT. Using Microsoft tools would have garanteed that we'd have painted ourselves in a corner and get trapped in an MS environment. The ultimate goal was to have portabiliy.

      Funny you mentioned CORBA, we used it extensively in the C++ version.

      For what it's worth, another word of wisdom. Our product had a critical application install and monitoring GUI console that was written initially by Windows people and just ported over to different platforms. As most Windows programmers, these guys were blissfully unaware of enterprise requirements, especially reliability and serviceability. Their interface was a clickfest. A scripting language was added as an afterthought but was never really successful, because it only gave access to a fraction of the functionality exposed by the GUI.

      As a result, we lost customers who absolutely refused to introduce a 20-click and 100-keystroke application installation process in their critical systems, because they felt it was too error-prone, especially if done several times day after day for every app deployment. We were only able to win these customers once we had a full scripting capability to supplement the graphical console. There again, Java was a boon, because JMX makes it relatively painless to introduce script-based controls into server components.

      --

      --
      Mad science! Robots! Underwear! Cute girls! Full comic online! http://www.girlgeniusonline.com/

  48. stay on target! by abes · · Score: 3, Insightful

    Well, to agree with just about everyone else here, for the whole team to learn Java, get used it its quirks, etc. is going to take a good amount of time. One thing that it does sound like, is that there is a library issue -- your current library is unmaintainable, and perhaps the ones Java provides takes care of that. Maybe that can cover for the time it takes to learn Java (since it's based on C++, it's not so difficult, but at least last time I checked, it lacks many features that you'll have gotten used to in C++).

    Main sticking points (since it's been years since I've last used Java, someone will probably have to correct this):
    * lack of templates
    * lack of double inheritence
    * everything is a pointer (both good and bad)
    * you have to be aware of garbage collector for optimizations
    * more verbose: both libraries are verbose in nature, and syntax can be a bit more verbose

    I think most issues people have with C++ can be solved with the right library. Want garbage collection, use a garbage collection library. Or use the STL (check out boost too!), which has just about all the container classes you could possibly want or need. Roguewave has also always provided a good amount of commercial quality C++ libraries. And don't forget QT. Way way way better than any interface provided by Java. I'm not a big fan of Swing (or AWT) at all.

    If you want to talk in terms of productivity, one method of sticking with C++ (although it sounds maybe the decision was made already) is to use a hybrid (come on, everyone else is doing it!). I use the boost::python library a whole lot (though there is SWIG, Weave and Pyrex as well). All my optimized code stays in C++, and everything else is in Python. I know Python isn't the fastest language in the world, but I don't have to worry about that. If I need to read in a configuration file, write a quick XML parser, etc. -- easily done in Python.

    Python is far from a perfect language -- I get bitten by the whitespace issue quite a bit (yes, if you stick with one editor it's fine, but you might always have that luxary, and some editors insist on using tabs). It is definitely one of the more complete interpreted languages with a huge amount of libraries written for it. Also boost::python, like all template library will slow your compile down by a lot. On the other hand, you compile your code less, since most of your work is in Python. And Python takes 1 day to learn.

  49. Dear god, no. by MythMoth · · Score: 2, Interesting

    I'm a full time Java consultant who used to be a full time C++ consultant. I like the Spring framework, and I've written a book on Hibernate. And I think this idea is just insane.

    Take your existing system and build upon it incrementally. If it is full of bugs, replace the buggy components incrementally. If you can't figure out how to maintain it in this incremental manner, I guarantee that the big-bang solution is going to be a total disaster anyway.

    And this is all setting aside my reservations about the wisdom of outsourcing a project like yours.

    Good luck. You are going to need a lot of it.

    --
    --- These are not words: wierd, genious, rediculous
    1. Re:Dear god, no. by MythMoth · · Score: 1

      PS...

      Ask your offshore development outfit how many C++ developers they have. And how many Java developers. I'll happily bet you $100 that they have at most a couple of C++ devs, and that this is the reason for their "recommendation". Given that they won't have the expertise on hand to understand the logic of your existing system what are the odds they'll do a good job of the rewrite?

      --
      --- These are not words: wierd, genious, rediculous
    2. Re:Dear god, no. by anomalous+cohort · · Score: 1

      I've seen stuff like this before. Poorly architected system gets rewritten in another programming language. This is a no-fault, blameless way of throwing out the old, useless system and replacing it with something that is, hopefully, better.

      If you claim that the old system is too crufty for a reasonable maintenance cycle, then someone might get their feelings hurt and strive to defend the old code. A language change is more politically acceptible because C++ can't defend itself from being bashed.

      The truth will set you free, however. If the old system is bad because you have a bad architect and that architect is setting the architecture for the new system, then after great expense, you will still have a loser.

      If the old system is crufty because of six years of scope drift and the current architect is good, then figure out why the old system is crufty and incrementally refactor it until the maintenance cycles become reasonable again.

  50. Thank you for saying this... by lorcha · · Score: 1
    ...so I didn't have to. As a Java guy, I can say for certain that Java is NOT going to solve the OP's issues. They're just going to be trading a few million lines of bad C++ code for a few million lines of worse Java code.

    OP should read what you wrote on CMM. Anyhow, I doubt the FDA would require CMMI Level 5. Probably Level 3. But what do I know? Also, if the work is for the government, they probably shouldn't be offshoring it.

    --
    "Avoid employing unlucky people - throw half of the pile of CVs in the bin without reading them." -- David Brent
  51. Hypothetical question: by Ihlosi · · Score: 1
    Never rewrite working code.



    What if:

    1. The "working code" is several kB of sparsely documented assembly for a completely different (and old) CPU.

    2. The people who wrote it have long since left the company.

    3. The "working code" was obviously designed, written and debugged over period of several years by several people, while you have six months to come up with a new working solution on your own ?



    Of course, no one would ever end up in a situation like this. Never ever *COUGH*irewrotethewholedamnthing*COUGH*.

    1. Re:Hypothetical question: by QRDeNameland · · Score: 2, Insightful
      GP>>>>Never rewrite working code.

      What if:

      1. The "working code" is several kB of sparsely documented assembly for a completely different (and old) CPU.

      Then it's not really "working", at least not in the environment you need it to.

      2. The people who wrote it have long since left the company.

      Unless it's written in such an obscure language that you can't find anyone to maintain it, you're probably still better off hiring someone to try to get a handle on your existing code than to make someone reimplement from scratch. Plus if the only people who know anything about your code are long gone, then the code must not have needed much maintenance anyway.

      3. The "working code" was obviously designed, written and debugged over period of several years by several people, while you have six months to come up with a new working solution on your own ?

      Then you have already ignored the "Never rewrite working code" advice in the first place. Good luck.

      --
      Momentarily, the need for the construction of new light will no longer exist.
    2. Re:Hypothetical question: by nacturation · · Score: 1

      1. The "working code" is several kB of sparsely documented assembly [...]

      3. [...] you have six months to come up with a new working solution on your own ?


      Six months to rewrite several kilobytes of code? Damn!

      --
      Want to improve your Karma? Instead of "Post Anonymously", try the "Post Humously" option.
  52. This says it all by Anonymous Coward · · Score: 0
  53. Why Java--why not .Net by Anonymous Coward · · Score: 0

    Food for thought--you have 6+ years experience in writing C++ apps. This means you know the framework and hopefully the ins and outs and the gotchas of the original system. What if instead of a ground up rewrite you did the following:

    1) Start with a port of the application from unmanaged C++ into managed C++
    2) ID the areas that are particullar "smelly"
                          Be especially aware of the areas that you had to implement yourself, are smelly and could be replaced by an existing library (e.g. message passing from one machine to another gets redone using the System.Messaging namespace (MSMQ)
    3) ID the areas that have to stay unmanaged (performance reasons or perhaps something written in asm?) and migrate them into separate libraries...

    Down the road this might have a better payoff--generally these sorts of projects (if set up correctly) can be language neutral (and yes I've worked in a shop where the project was a composition of VB.Net, C#, managed C++, and unmanaged C++ and C). You need to move something onto a 'nix platform? There is mono...

    You have a one off winform application that you want to generate, you need it in a week, and it needs to use your existing infrastructure? I think you get the point where I'm going here....

  54. Just because you fail to understand it by lorcha · · Score: 2, Interesting
    Just because you fail to understand it, doesn't mean it's crap. The following are not crap, and were never crap: JMS, JMX, JNDI, MDB, Session EJBs, CMT, JSP, JAAS, and many others.

    Really, the only part of J2EE that I can think of that was ever crap would have to be Entity EJBs (high overhead, high complexity, too expensive for simple DB access, too difficult to get complex queries to behave (BMP), required meaningless conversions due to nonserializability, etc., etc.).

    --
    "Avoid employing unlucky people - throw half of the pile of CVs in the bin without reading them." -- David Brent
  55. And furthermore... by lorcha · · Score: 1

    ... if they have to switch to anything, they should be switching to .NET. They're a microsoft shop.

    --
    "Avoid employing unlucky people - throw half of the pile of CVs in the bin without reading them." -- David Brent
  56. Changing focus? by TheConfusedOne · · Score: 1

    A move to Java, Spring, and Hibernate would point towards a change in focus to web-based applications. Are you going from Windows-based C++ applications to web-based solutions?

    If so, then a change in architecture is probably warranted as you can take advantage of tool sets geared towards this new development environment. However, this doesn't mean you should throw the baby out with the bath water. Java works well as an intermediate/coordination layer and you could leave large portions of your legacy development in C++ with shims to access them from Java rather than re-engineering everything.

    Beyond that though, without an answer to that first question it's hard to analyze things any deeper.

    --
    --- I wish I could hear the soundtrack to my life. That way I'd know when to duck.
  57. It'd be a ton of work. by benow · · Score: 1

    Some excellent suggestions so far. Let me first say I love working in java and there are no better tools out there, but, I'd think hard about the migration. It's going to take alot of time, much more than you or they might expect, and alot of foresight, situation analysis and learning before progress is seen. Double the estimate, then double again, in my experience. If the code is really rotten, a migration might make sense. A plan of attack might be: Get atleast one dedicated, experienced java head and allocate a team of current employees to work with the new guy. New guy brings employees up to speed on java and tools and team brings new guy up to speed with existing codebase. Have the java team rewrite a good chunk of code, then throw it away... be brutal. Write it again, with the team up to speed, then move onto other pieces. Management usually hate funding R&D, but they have no choice if they want results. Choose what to tackle gingerly... something tough and important but not mission critical. After the first pass, sit back and breakdown what needs to be re-implemented and re-architect with hindsight, if possible. For working standalone code/services, think of a corba (ick), jni or some other c++ - java compatability layer. If I, as a solo developer, were to decide to move the last 6 years of my code to another language, I wouldn't do it. Too much work... sure, I'd learn a bunch, but it'd take be years to get to the point where I am now. That being said, my current codebase is java in eclipse, and any stale code is as easy as possible to refactor. The tools are great, but if you're not careful, you'll just make a broken c++ codebase become a broken java codebase. The prerequisite to good code is experience, and there's only one long, hard way to get that.

  58. 21CFR11? by Kosgrove · · Score: 1

    Question for the original poster: Are you referring to getting your software in line with 21CFR Part 11 regulations? I don't see how switching languages is going to help you validate your software any quicker.

    If you do move to Java, though, everything I've read indicates that implementing automated unit tests in JUnit would be a very, very good idea. That way, your unit tests can serve as documentation that certain aspects of the system are validated without making a poor human run those tests.

    1. Re:21CFR11? by Anonymous Coward · · Score: 0

      Validation is a whole lot more than just 21 CFR Part 11 compliance. It's also having an SDLC, specifications, vendor audits, user training, qualification (IQ,OQ,PQ), change control, a Quality System, etc.

  59. using old code to write new one by Goeland86 · · Score: 1

    I'm assuming you're probably asking about a migration tool? I haven't heard of one.
    However, I would recommend using Eclipse with the CDT plugin to import all your existing code, and then using that to write the same code using java and at that point, use JUnit for unit testing. That will tremendously help you.
    Eclipse is a great tool for java (dunno much about using it with C/C++), and JUnit is now critical in any of the code I write that is beyond 150 lines, it just makes things a lot clearer.
    Also, as someone else mentioned, refactoring when you can is a good idea, and eclipse will help you a lot with that.
    And, best of all, Eclipse is FREE! That's the best price your management could ask for. There's also a couple of books about Eclipse which might be worth investigating to get started.
    Good luck, I've encountered a few systems that were FDA approved, and I can tell you that it's a pain in the butt to write code for it if you don't have unit testing. Go with JUnit and part of your pain will be alleviated, and paradoxically, writing that much more code will make you more productive as you'll spend less time debugging (the bugs will become evident as soon as the code is written!).
    Cheers

    --
    ---- I am certain of only one thing : I know nothing else.
  60. Not Java.. but maybe something else or new C++ by 21chrisp · · Score: 1

    The offshore guys love Java. They love Java because American IT directors love Java and give them a ton of money to develop in Java. That doesn't necessarily mean Java is always the answer.. Java is a one-size-fits-all language. It's known to be good at a lot of things but not necessarily great at any one thing. C++ is the speed-optimized object oriented language. It's fast, and maintains most benefits of OOP. It's also very flexible and sort of a one-size-fits-all language as well, with the exception that it is very fast.. so is more usefull for applications that require speed. I know your familiar w/ C++ but bear w/ me...

    IME, Java is slightly faster to develop than C++. It's garbage collection helps reduce memory leaks, and it's typeing is safer, which will reduce _some_ bugs for you. IMO it doesn't offer enough to do a complete migration away from C++. I see a lot of places do this and I think it's often a mistake. If you were starting from scratch, Java may be worth it. With 6 years of C++ and several C++ experts in the group. I say stick to what you do best unless you find something that can dramatically improve productivity.

    What you really need to look for to make this dramatic difference is a framework, regardless of what language it uses. If you are doing web software, something like Ruby on Rails will work wonders for you. This isn't the only framework though.. there are a many for all types of applications. There are things like SAS for data processing and QT for cross-platform widgets. If there aren't any frameworks to give you a head start, than you may need to roll your own or try to migrate your existing codebase into a working framewok. This will obviously take a lot of time and resources.. but there's no getting around that. At least it will get you on a good footing for the future.

    Also... try and convince your management that sending a pile of code overseas is not going to make it come back as a higher quality product. Usually the effect is the opposite.

  61. work it by nemesis666 · · Score: 1

    I was working on migration of one big c++ project to java.My problem was that i did'n know the c++ syntax but was familiar with java.That project has lasted for whole year(5 developers on project). My bigest problem at the start was understunding c++ pointers.

  62. Incremental Refactoring by the+eric+conspiracy · · Score: 1

    If you have architectural problems with a C++ application that are affecting programmer productivity, it seems to me that the answer is to fix those problems through a refactoring process. This process can be controlled so it is relatively non-invasive and low impact. Not as sexy and harder to sell to management, but it is the way to go.

    Switching languages won't help long-term. While a rewrite to a different language is one way to gain the refactoring you are after, it comes with a lot of undesirable side effects. Worse yet it doesn't instill the culture that software engineering really should include continuous refactoring as part of the development process ifo order to keep the hedges trimmed. So inevetably as time goes on that clean new design will accumulate cruft. Unlike some pundants state, source code does rust.

    Switching from C++ to Java may marginally improve programmer productivity because memory management is easier in Java, but it seems I bet that it will take about 3 years before you reach the level of expertise needed to start seeing that benefit.

  63. Why maybe you should do this by Jherico · · Score: 1
    I see a lot of people replying that whoever is suggesting you do this is on crack, and that you shoudln't throw away working code so that you can go to Java. They might be right. They also might be on crack themselves. It all depends on what your software does and how much of it you're going to be able to throw away.

    See, if the bulk of that 6 year old codebase is fine tuned code for simulating some physical process or something similarly domain specific, then throwing it away and converting it to another language would be insanity. But I'm betting its not. I'm betting the bulk of the codebase is the simple stuff that you have to build from the ground up in C++. You mentioned Hibernate, so there's probably ORM code somewhere in there, or DB code at least. You might have some amount of file IO code or event managing code or logging code or any of a hundred other tasks that people writing in C++ have to reinvent everytime they write an app.

    This is one of the critical differences between C++ and Java. C++ doesn't have a giant common language runtime for doing network stuff and DB stuff and logging. It certainly doesn't have a vast array of open source third party libraries designed to do all the things you have to do for so many applications, like write logging and serialization API's.

    So it comes down to how much code you need to port and how much code do you get to throw away. 'get' is the word here because every time you can junk a piece of functionality and use a mature open source third party library instead, that's more time you get to have to fix bugs in your domain specific code. I've been a C++ developer a lot longer than I've been a Java developer, like by an order of magnitude, and while I still love C++, I wouldn't write an application in it unless I had a very good reason to. Some reasons were if it was a client app being distributed to a large homogenous Win32 userbase, where ensuring the VM was present or had the right version becomes more of a problem than its worth. If the VM footprint was larger than warranted by the application, like for instance if I'm writing a version of 'grep'. If I'm writing a 3D graphics intensive application like a game. Mostly this is all stuff on the client side. If I'm writing server side code, finding a reason not to write in Java becomes harder and harder. Maybe some would argue that PHP or Ruby On Rails is going to be better, but certainly not if you're dealing with a group of people with existing C++ knowledge.

    You're biggest problem will be learning when NOT to write code. The temptation will be there to go ahead and write that XML parser, just because it so engrained. But you have to learn to use features in the language and the library.

    I could go on quite a bit, but you get the idea. If you have any questions give me a ping, I'll be happy to answer them.

    --

    Jherico

    What can the average user can do to ensure his security? "Nothing, you're screwed"

  64. Polish your resume, Just in case. by johnnnyboy · · Score: 1


    I agree with a lot of posts here with regards to polishing your resume.

    I don't know the nature of your application or which field your employer is in so I can't make a good comment on your situation.

    Your development staff is quite small 5 (FTEs) so a rewrite will be very difficult to do and maintain your existing app at the same time.

    Unfortunately, I get this sinking feeling in my stomach when I read that your IT director is looking at an offshore to assist in the migration to Java.

    Does this mean that you're going to be offshored someday? Or does it mean that he does recognizes the high costs of the rewrite?

    It's silly to think that just rewriting your existing application in another language is going to solve all your problems instantly.
    If you're going to rewrite, atleast keep it in house and retain your intellectual property within the company and keep your staff up to date with its own software products.

    What I believe might happen is that the rewrite will be assisted by this offshore company by people who don't understand the business concepts as well as your staff does and it may end up being a buggier mess than the original.

    Better to hire some experienced Java programmers with a strong C++ background to help with this rewrite.

    Goodluck.

    --
    "If a show of teeth is not enough, bite ... but bite hard!"
  65. An attempt at balance by metamatic · · Score: 1

    A lot of C++ fans here, I see. I offer the perspective of someone who's written C++ and written Java, but who doesn't particularly like either of them.

    What Java offers over C++ is robustness. It's designed so that a RAIJP (Redundant Array of Inexpensive/Interchangeable Java Programmers) can write code without creating a ton of memory leaks, null pointers and security exposures. From automatic memory management to mandatory exception handling, most of its features are designed to support that goal.

    What Java doesn't offer is much improvement in development speed over C++. Simple tasks often take ridiculous amounts of code, offsetting the gains of automatic memory management.

    So... in this case Java is really solving problems that are being introduced by adding offshore developers. So the real question is whether offshore developers are the solution to your problems. I'm guessing they're not.

    --
    GCHQ Quantum Insert installed. If only our tongues were made of glass, how much more careful we would be when we speak
  66. What's your company's ticker symbol? by Anonymous Coward · · Score: 0

    And is it on the "shortable" list?

  67. The language is not the problem by pizza_milkshake · · Score: 1

    If you have specific problems, fix them. If you have lots of legacy cruft that is not necessary, then trim it. If your code/revision management system is poor, then upgrade it and/or develop new procedures. If your code is hard to understand then perhaps you need to re-architect it and/or document it. Throwing away all the code and all the experience you have accumulated is the biggest mistake you can make. If your problems do not directly relate to issues inherent in the language or its libraries then getting rid of it will not make your problems go away. The language is not the problem.

  68. Joel was wrong... by kupci · · Score: 1
    I agree with Joel but I can't help thinking that his attitude taken to the extreme is precisely what's wrong with Windows: millions of lines of legacy hacks, bugfixes and two-page functions that nobody really understands anymore and that few can fix or audit for security problems.

    Exactly, there's a balance. Speaking of Windows, note that Windows was rewritten from scratch, when Dave Cutler from DEC was hired to write NT. Now certainly there are some vestiges of DOS, and OS/2, and it's a huge codebase, but it's not Windows 95/98/Me, that is clear.

    Joel's article seems to be the defacto standard against rewriting software, but funnily enough, I think he's been proven completely wrong, in hindsight, by the very example he used to prove his point. Think of Mozilla? Mozilla originally started from the Netscape codebase, but they got a lot of flack from folks like Joel for rewriting it. Now it seems IE is the patchy codebase you describe Windows to be.

  69. It CAN be done by serodores · · Score: 1

    Although a bit tangential, Ogre 3D has a C++ API. In order to create a Java API, the Ogre4j developers have been working on an automatic bridge to create C++ handles for Java programs specifically from Ogre 3D's C++ API, using JNI and some other stuff: http://www.ogre4j.org/phpBB2/viewtopic.php?t=25 You can use this to package all of your previous code into an API that your new java code references. Granted, this assumes that the new code you will be developing either doesn't need to change much of the existing code (i.e., it will mostly be enhancements, rather than changing existing, already written code). If you do need to change how some of the previous code works, you could handle it by wrapping some structures with Java classes, but the more you have to do this, the more development time you will lose. Doing a straight rewrite from C++ to Java will take between 50% to 75% of the time that it took you to write it in the first place, and this is a possible alternative to get it up off the ground with a chance. After this is done, you can slowly convert sections of the C++ code that do frequently change. It is possible, it can be done, but it heavily depends on how much rewriting you plan on doing to your already existing C++ code.

  70. screw the project by fred+fleenblat · · Score: 1

    You should view this as an opportunity to get free training in java from your employer, which you can list on your resume in about 6 months, which is about when your job will be offshored after the IT dept implodes.

  71. Some advice from a Java/Spring/Hibernate shop... by curunir · · Score: 1

    I'm not going to comment on whether you should switch from C++ to Java...almost every other post in this thread has addressed that issue and only your team can really make the decision on whether your code is broken enough to need an architectural fix or not. What I will do is give you an idea of what your life will be like 2 years from now if you adopt the suggestions of the consultants.

    1) You will be cursing the day you ever accepted Hibernate into your development environment. After the initial "ooh...cool" phase where it effectively maps single tables to single model objects and even does a few more complex things than that, you'll start running into obscure bugs and start pulling your hair out trying to a) figure out why the @#$% it is generating certain SQL (usually a hard process) and b) figure out how to get it to generate reasonable SQL (nearly impossible). If you have anything more complicated than simple table mapping and maybe a couple of joins, avoid Hibernate like the plague.

    2) Conversely, you'll be quite happy with Spring. Aside from some wierdness in SpringMVC, almost all of Spring enables you to do whatever you want. Provided you've planned ahead so that you're spring config files don't get out of hand (this should be fairly easy considering that you've already built your app once...you should be able to get a fairly close estimate of all your beans up front, so make sure you break it down into spring beans config files that have between 10 and 30 beans apiece (numbers to be a secondary concern to grouping like functionality), and you'll be fine.

    3) If you have any need for single sign-on or complex authorization schemes, you'll probably have run into the pain that is Acegi and have navigated its complex array of implementable interfaces to the point where it is working well for you. Relax, and feel good that you've gotten it working and there aren't likely to be any holes in it that need fixing. To be clear, I'm not demeaning Acegi...it's a great product. It's just that the interface is quite confusing and has documentation that is, to be kind, only for advanced users.

    4) You will (I hope) have a large battery of unit tests for all your code. Spring's IoC capabilities ensure that you'll almost always be able to test each piece of your code in isolation. Use this to your advantage. Write tests until you believe you've covered everything, then write some more. Use code coverate tools like Emma, Cobertura or Clover and make sure that you've tested everything (well...you can probably leave getters and setters untested).

    All this will leave you far more agile than you are now. You'll be able to make changes quickly since you can re-run all of your tests to ensure that you haven't broken anything. You'll have developed a great appreciation for interfaces and what programming towards them can allow you to accomplish when it comes to pluggability of components.

    But will you be better off than you would if you had continued on your current path? That isn't a question I can answer. I can't determine whether your employees would be able to adapt from a C++ environment to a Java environment. If you simply write C++ code in Java, your code base will still be ugly. I also can't answer whether it would be less effort to re-architect your product in C++ and bring with you the code that does work well. These are all questions you have to answer for yourself. Do not let management be sweet talked into dictating your technical path. There is no answer that is right all the time. Make your decision based on how painful development is now and how painful its likely to be given each path you're considering taking. Make your decision personally (or as a team, with your fellow developers), make it clear to management what your decision is and if they mandate any other path, start looking for a new employer.

    A co-worker of mine is fond of the saying "There is no magic in programming" (though Spring sometimes comes pretty damn close). And it's true. A well-architected solution in almost any language will be better than a poorly architected solution. Spend your time and money on doing things right no matter which tools you choose.

    --
    "Don't blame me, I voted for Kodos!"
  72. It isn't a migration by gatkinso · · Score: 1

    It is a move to outsource all 5 of your jobs.

    Find a new job.

    --
    I am very small, utmostly microscopic.
  73. This is rediculous by GorillaTest · · Score: 3, Insightful

    Why do people always need to pick a dramatic solution? Just take some time out to refactor your code. That will be a lot cheaper and more effective than going through this exercise your IT chief has planned. I've gotta ask why are you putting up with this headache to begin with. Go somewhere where they unit test so refactoring is practical, and where the big chiefs are not allowed to read "Development for Dummies"

  74. Question is a troll? by SanityInAnarchy · · Score: 1

    I mean that in the nicest possible way -- I believe the original question is structured to generate exactly the kind of response that we're seeing now -- don't do it. I believe this is merely an attempt to produce something to show the PHB.

    Now, I'm not saying that's a bad thing. Mostly, I agree with the responses, but I have to wonder if there's another side to this, such as: Did the consultants really say nothing more than "Java is a magic bullet"? There are legitimate reasons why Java may save you time, and these have nothing to do with portability. There are also reasons why it will cost you a huge amount of time. Some say that it'll take years just to break even -- well, assuming you do break even, it's pure profit after that.

    However, there really isn't enough information here to make an informed suggestion. Many are assuming you're writing web apps, but you don't even say what kind of application you're doing. Of those 6 or so years of development, how much of that code actually gets re-used these days -- are these old apps you must still support, or frameworks/libraries you have to use every day? Are they mostly stable (minus the bugs), or are they under constant development? Will you be doing anything to help clean up your process other than switching languages?

    Anyway, you're in the best position possible to explain to your managers how much switching languages will cost, and whether there will really be an advantage. If you want Slashdot to do it for you in a meaningful way, you'll probably have to reveal more of who you are and what you do than your boss will allow.

    --
    Don't thank God, thank a doctor!
  75. why adjust your project to meet some offshore team by omission9 · · Score: 1

    Our IT director has hired a 3rd party (offshore) company assist us with this migration, and they have recommended that we change from C++ to Java, Spring and Hibernate. We are all professional programmers here, so learning Java is not a problem for those of us who don't know it. The real question is: what do we gain from moving to Java? Or conversely: what do we lose by moving away from C++? Additionally, will one language or another really help us to get FDA approval?
    Your team is good at C++. The offshore team is good at java. Why should your team adjust to the offshore team's skillset? Why not just hire a better offshore team? One that knows C++? Oh, and I'd be pissed that anything is being offshored to begin with. This means, of course, that your IT director think that you are a bunch of incompetents.

  76. Java vs C++ re-write by Anonymous Coward · · Score: 0
    Coming from a team that has gone both directions (re-wrote portions in both c++ and java), you need to make sure that when you are re-writing, you are focused on improving the portions of the system that are the real bottle-neck to your development schedules. If there are sections of your application that you don't need to modify often, leave them as they are and focus on putting together a design for the sections you do have to modify that makes your development easier in the future (requires some knowledge of where you're likely to need to make updates in the future).

    On the point of Java vs C++, If you know C++ you're going to be able to put together a better design than if you hop languages and try to figure things out as you go along. Some other comments have referred to getting a consultant onboard to help with your architecture/high-level design. If you're going to go the Java route, this is something that will reduce the risk of having to redesign/re-write what you're re-writing now two years from know when you've learned enough to realize that you didn't do it right the first time around.

  77. c++ == java by aminorex · · Score: 1

    It's difficult to imagine any language interoperating more freely with C++ than Java, using GCJ and the CNI native interface. You just pass objects back and forth freely between the environments, call native methods directly across the language boundaries, and rock 'til you drop.

    --
    -I like my women like I like my tea: green-
  78. Migration by umbrellasd · · Score: 1
    The reason to switch from C++ to Java should come from your FTEs. If your group cannot see how it will be an advantage, then you will not gain the benefits since you are doing the actual work. A good plan is to selectively replace or consolidate problematic subsystems and do an implementation in Java. A better plan would be to do that, but to implement a solution in both Java and C++ and then compare.

    This way, you don't make a possibly insane transition based on "some Indian guys in India"'s idea (How well do they know your team, code, and history?), and your FTEs get hands on experience with Java. If there are advantages, they will become apparent to you and your fellows and you are the people that need to see and utilize those advantages.

    What I remember most from transitioning away from C++ was that I could develop things faster because they syntax was simpler and code contained fewer errors because of the lack of pointers and need for handling garbage collection. Another potential advantage of Java is that it is the "bandwagon" at the moment and therefore many eyes (e.g. products) are out there to make necessary business tasks easier in Java.

    The real value of Java that the 3rd party is alluding to is in the interoperability of Java with other components (you listed a few). If you are using some middleware or other software that meets an important business requirement that you have and that middleware plays nicer with Java, then you might have real value there. But even if that were the case, you could always use JNI or something like that to wrapper the quality pieces that you have written in C++ or whatever.

    Anyway. Bottom line is you and your fellow FTEs need to have direct experience with the advantages and disadvantages, and the best way to get that is to selectively migrate (refactor, redesign, replace, etc.) the more troublesome components with Java code and see if that is better (faster to develop, fewer bugs, etc.) than what you could do in C++.

  79. Test Driven Development and Refactoring by dsplat · · Score: 1
    Software development processes have almost nothing to do with the choice of language. That said, it's been my observation that there are lots of really smart people working on Java to improve the development process. Eclipse is amazing with code completion, on-the-fly error tracking and refactoring. JUnit (comes with eclipse) is a benchmark Test Driven Development system. If you must switch languages, invest in the training to make those tools productive!

    Yes! There are tools for both TDD and Refactoring for C++. For that matter, there are TDD frameworks for embedded C code too. However, the refactoring tools for Java are ahead of the support for C++. If you actually make use of them, they can improve your productivity. Switching languages because of some blind belief that programmers using a particular language are more productive is a waste of time. Switching to take advantage of tools and libraries that are better than the ones available for your old language can help you.

    For the record, I've used C++ for years. I still use C for embedded code. I love Perl. I've used a bunch of other languages as well. I learned Java several years ago because it was the language of choice for examples in the early work on refactoring. Design Patterns were about raising the level of abstraction on chunks of code. Refactoring is about raising the level of abstraction on changes to code.

    --
    The net will not be what we demand, but what we make it. Build it well.
    1. Re:Test Driven Development and Refactoring by Anonymous Coward · · Score: 0

      "I learned Java several years ago because it was the language of choice for examples in the early work on refactoring."

      Not meaning to be picky, but the early work in refactoring was more likely done in Smalltalk.

    2. Re:Test Driven Development and Refactoring by Marillion · · Score: 1

      Patterns! Yes, I knew I forgetting something. Patterns are language agnostic. That said, there is no shortage of great examples in Java. As with the parent poster, I came to Java by was of 'C' and 'C++' and learned AWK, Perl (starting with version 3)
      In the early days of Java, I remember a Sun representative calling Java: "C++--"

      --
      This is a boring sig
    3. Re:Test Driven Development and Refactoring by dsplat · · Score: 1

      You are correct. I got interrupted by the phone as I was writing that and left out one very critical word: "published". Refactoring started to gain a wider audience when published articles and books about it started using Java. At that point the ideas were more accessible to a mainstream audience.

      --
      The net will not be what we demand, but what we make it. Build it well.
  80. Orthogonal issues by zorro6 · · Score: 1

    The choice of language really has nothing to do with FDA approval, or at least not much. I have been through an FDA approval of a software driven device from the ground up. What matters is your development process, not your implementation language. It seems that no one in your organization really understands what they are doing vis a vis FDA approval. Rewriting the code in java may or may or may not be helpful to your end goal but it is not the real issue. Dump the offshore consultants, who probably know nothing of the FDA approval process, and hire some consultants who do. You need people who understand the process and who understand the development of safety critical software.

  81. Brutally honest by oaksong · · Score: 1

    It sounds like upper management is leaning on your IT director to produce something and he's waving his arms around like a maniac.

    It's not a pretty situation. Some needs to calm him down and talk some sense into him.

    As has been state elsewhere, suddenly switching to Java will buy the company nothing but lost time, heartache (or more heartache if he and or the comany are already under pressure), and money going to off shore services, potentilaly for a long time. It will acomplish absolutely nothing positive in less than about 2 years.

    The guy needs to sit down and work out a serious budget before he drags the company under. Alternatively, you go over his head and explain to his boss that the guy has just gone over board and is going to drive the company into the mud. Explain the bad news and pray that you get his job (or not) after they fire him.

  82. RTFQ check by fm6 · · Score: 1

    The dude didn't ask, "Should we switch to Java?" It may well be a bad decision, but it's not his to make.

  83. Silly by Vorlath · · Score: 1

    I've never seen a project move from C++ to Java ever succeed. I've seen plenty of disasters. If you want any chance at success, leave behind everything that is C++ and consider this a new project from the ground up. Even then, you chances of success are moot because I've also never seen a successful Java project.

  84. What is your product? by Anonymous Coward · · Score: 0

    You know, it entirely depends on your product you're producing. If you're rewriting the Java EE API to get things done in C++ you're definitely gaining a lot from Java. If your needs do not overlap well with the proven Java technologies out there then chances are C++ and Java are about the same.

    It's all about the APIs. Are you doing stuff that screams J2EE? If so, maybe the vast majority of your code is obsolete and replacable with superior open source libraries. Or are you rewriting your VB fat client into a swing app? In which case you're probably just wasting your time.

    And just a remark, why does a 5 person team have an IT head? Isn't he just your manager? If your boss didn't extend the courtesy of asking for your opinion to solve this apparently severe problem I would consider that a rotten work environment. But conversely it sounds like your "C++ experts" may not be as expert as it sounds if they could not immediately recognize from experience the folly of switching languages so late in the game.

  85. Re:Some advice from a Java/Spring/Hibernate shop.. by Omnifarious · · Score: 1

    The above poster's comment is probably the most important in this thread. Unit testing is helpful no matter what you do or where or in what language. Some frameworks and tools make it easier than others. But an approach that involves a lot of rigorous unit tests is going to make your development go much faster and more surely. It's a good idea no matter what tools you use.

    In fact, regardless of whether or not you make the ill-advised leap from C++ to Java, a rigorous set of unit tests of your system will help you. You should write them even if you're just going to be re-architecting your existing C++ code.

    As for changing programming languages...

    I despise Java. I think booting a whole OS just to run a program is silly. I think the fact that people invent all kinds of new ways to make sure they can start new Java things from an existing VM so they don't have to boot the OS (otherwise known as a VM) again in order to run a new program is amusing and telling. Java is a 'joiner' virus technology that encourages you to do everything in Java and makes it really hard not to.

    I was a big Java fan when it first came out. Experience has taught me how icky it is.

    People tell you Java is more productive because you don't have pointer problems or the complex and arcane syntax of C++. These claims are vastly overblown. In truth, the language is nearly as verbose as COBOL, and for as little reason. It lacks the expressive power of C++, Python, Ruby, Lisp or Perl, and that will lead to you writing a lot of stupid vaguely repetitive code for no purpose than to provide thunking layers in the rather incapable and inexpressive type system. The only thing Java got right was packages, and Python and Perl (and possibly Ruby) do them just as well.

  86. FDA Doesn't Approve Anything by Anonymous Coward · · Score: 0

    Not even drugs! I bet that is a new one to you. If anyone claims their product is FDA approved (software or otherwise) that is false advertising and illegal.

  87. Short answer: DON'T! by billcopc · · Score: 1

    My immediate and knee-jerk solution to your problem is DON'T switch to Java. I forget who I stole the quote from, but:
    "Saying Java is nice because it works on all OS's is like saying that anal sex is nice because it works on all genders."

    Maybe it's just my bias, but it seems like all Java developers are stuck in a rut, churning out applications that look like a ten year old HTML form, and feel like a Cobol terminal. I don't know if it's because of the libraries they use, or that they don't drink enough Pepsi, but something is just WRONG.

    One thing I whole-heartedly recommend is to look into functional languages, if you can afford the performance hit. When it comes to large business-intelligence applications, functional will help you write safer, more concise code, keeping your attention focused on the actual program logic rather than the implementation details. Something like "Clean" or OCaml comes to mind. If you're really uptight, you could write the backend with functional code, then a thin interface in some conventional language, or even a RAD tool like VB.Net or Delphi. Just stay the hell away from Java, for everyone's sake.

    --
    -Billco, Fnarg.com
  88. Its process not code, that lacks by angel'o'sphere · · Score: 1

    The real question is: what do we gain from moving to Java?
    If roughly 30% of the time you spend writing C++ code is fiddeling with memory management, then you probably can save those 30%, or more precisely, a great part of it ... lets say 25%.

    Additionally, will one language or another really help us to get FDA approval?
    I assume this is similar to a kind of CMM level 2 or CMM level 3 certification. Certainly not! First of all, the language you use has nothing to do with the qualitiy of your code. Second: the language you use has not much to do with the amount of time you need to meet/implement requirements.

    We have always used C++ [...] and we have more than 6 years of code, applications and libraries developed. and our existing architecture is difficult to manage for a group of our relatively small size (5 FTEs)

    So you have roughly 30 man years code.
    To replace all this with Java, might be how much faster? 100%? Lets assume you can indeed achieve an 100% speed up by just switching to Java. Then you still need 3 years to redevelop all that code. That does not count bug fixes, new features or anything.

    Bottom line:
    Your problem is lack of architecture, you likely never aimed for maintaneability, enhanceablility etc. Probably you even have a deep lack of test cases. You should look in building "components" today that is called SOA, this concerns architecture.
    Try to look into test driven development, design for testability is also a design for maintainability. The design afflicts architecture, the tests and the way how you manage it afflicts the process.
    Probably read about SCRUM (basic concepts are learnable in 2 hours), this also is about how to come from requirements to implementations, easy, fast, reliable. This affects your software process as well.

    After all when you want a certification, its a certification of your abilities -> and that is your process. And not your code.

    Regards,
          angel'o'sphere

    --
    Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
  89. Why Java by johansalk · · Score: 1

    I don't know what you guys are doing, and I'm not an expert, but from what I know so far Java and such languages are good if you have to work with a large number of cheap, mediocre developers. If, on the other hand, you're a small group of competent, experienced professionals then you may as well use a language that's better suited for a small group of competent, experienced professionals that would give you the additional advantages of fast development and more maintainable code. FDA sounds like you're doing something of perhaps medical relevance, maybe interacting with medical devices or such, have you considered a language like forth? Forth has a good niche for such technical uses. I don't know what you need, but my point is that if you're going to make a language switch then at least switch to something that would make a difference, not Java.

  90. I had this experience first hand in 2001 by Anonymous Coward · · Score: 0

    I was hired to work for 6 months in France in C++ in a big system in the gorgeous Cote D'Azur. I went there and I was finished with all my bugs and features in 3 months, since I already had 7 years of experience in C++.

    My coworkers had been working in the system for 8 years, extending and perfecting it, and already it was a huge system.

    When I arrived management decided to give a try to reimplement the system in Java and maintain the system in C++, so that they could offer both systems to their clients. We had 6 month to reimplement the system in Java and I was ROTFL because it couldn't possibly be done, my coworkers stared at me in disbelief. (Or mistrust?)

    In the Cote D'Azur people work 35 hours a week and they are so laid back... After the 6 months, the system was working, with a few notorious subtle bugs, but working! From that moment I never programmed in C++ anymore, since I realized most companies would switch, and those companies that decided not to switch or to switch late, would disappear.

    Java is ready to create database engines, device drivers, application servers and whole operating systems.

  91. Language matters not by Anonymous Coward · · Score: 0

    I work for a company who produces software for medical devices, who shall remain nameless. To answer your specific question, the FDA could care less what language you're using. They care that you have a well-defined process for developing that software, that you have documented the heck out of that process and how you are following it, that you have properly validated that the software does what you say it does, and that it is safe and reliable. They aren't much for specifics, for example requiring a CMM level or whatever.

    Exactly what they're going to want from you will depend a lot on things you haven't shared here, like what this software is being used for. Software that is part of therapy delivery (radiation treatment machines) is different from software that is used in diagnosis (blood sugar meter), which is different from software that is used in say, billing and medical records, which is different from software that is used in the process of developing other medical devices. I'm going to guess that you're in one of those last two categories.

    If the current state of things is as bad as you seem to imply, starting from scratch with a new architecture may be a good idea, but that doesn't necessarily mean you need to switch languages. I'm going to agree with others here that it is either a) a bad idea or b) an excuse to outsource the whole thing and that you should polish up your resume. What your company really needs is an expert in the FDA approval process and what you need to do to meet their needs, not any generic software consulting firm who's just trying to get your business for themselves.

  92. Dog Food Re:FDA? by hackwrench · · Score: 1

    Oddly enough, that also explains how all the English Bible translations came about.

  93. I did this by Doctor+Memory · · Score: 1

    I was the lead developer on a team that converted from VB to Java. For us, it made sense, as we wanted to web-enable our app and VB's web support at that time (VB5, back around the turn of the century) was too simplistic for us. It was a big challenge, and lots of hassle, but we got it done and it's been a pretty successful app in its space.

    I can think of several reasons why your IT manager wants to make this change, and none of them are good. For us, it made send to make the move to the OOP Web world, because that's where we wanted to take our software. I really don't see the upside moving from C++ to Java. It sounds like offshore Java developers are cheaper, and that's the big incentive.

    --
    Just junk food for thought...
  94. Rearquitect first, choose language later by Anonymous Coward · · Score: 0

    Problem: I have a C++ buggy software and I want to move it to a bug free language
    So: No such thing as a bug free language.
    My Opinion, before attempting something risky, do a risk analysis with some grounds, forget guesswork it will only make matters worse.
    New Problem: I have a C++ buggy software and I want to make it bug free
    Step one: - Rearquitect from scratch thinking in C++
    Step one.point.five: - Rearquitect from scratch thinking in Java
    Step two: - Take a snapshot of the current arquitecture and its problems
    Step three: - Merger the arquitechtures taking the best of the current and new ones
    Step four: - Evaluate which merger is most likely to solve the existing problems and manage to grow
    Step five: Do the changes in cycles and steps, and if neccesary switch language, use learned lessons from the old code.
    Step six: Evaluate, next change
    Step seven: Incremental delivery = incremental phase off the old sw

  95. Horrifically bad idea by Anonymous Coward · · Score: 0

    Java is not platform independent. Java is ridiculously hard on system resources. Java is a security liability.

    When the JRE changes your applications will stop working. Your clients will scream bloody murder. (not to mention the FDA)

    The JRE cannot be validated under 21 CFR part 11 regulations, C++ code can. The FDA will approve of applications written in C++ much more easily than those written in the terribly unreliable java. (...client installs a new JRE and your application is automatically no longer validated...)

    Java is pure evil.

    C++ is standard for a reason. I have C applications that are over ten years old that still run on multiple platforms. Show me a java application that can do that.

    I think your IT director will soon find himself out of a job. He should tell the school that he freshly graduated from to get off that java train before the inevitable wreck occurs.

  96. One less reason to move to Java by greglaw99 · · Score: 1

    Please excuse the shameless piece of self-promotion that follows. One of the really cool things about Java is RetroVue - a "bidirectional debugger" that allows the programmer to step their program backwards, or rewind to any point in the program's execution history. We've just released UndoDB - a bidirectional debugger for C/C++ (and other compiled languages). Suddenly those horrible C/C++ bugs aren't so daunting :-)

  97. Mod parent down! by tweakt · · Score: 1

    No no no...

    Java != JavaScript

    It's not Perl, Python, or Ruby either... so SWIG does not apply here. SWIG is for binding C++ code to interpreted *scripting* languages.

    SWIG is nice for cranking out some quick tools, but no way should you consider it an alternative to a ground-up re-write.

    1. Re:Mod parent down! by quanticle · · Score: 1

      The grandparent is wondering whether a rewrite is necessary in the first place. 6 years of framework code is not something that one rewrites on a whim. Instead, grandparent is suggesting that the framework be encapsulated by SWIG, and new extensions be written in a proper object-oriented language that interfaces with SWIG.

      --
      We all know what to do, but we don't know how to get re-elected once we have done it
    2. Re:Mod parent down! by commanderfoxtrot · · Score: 1


      No no no...

      Java != JavaScript

      It's not Perl, Python, or Ruby either... so SWIG does not apply here. SWIG is for binding C++ code to interpreted *scripting* languages.


      Perhaps you should actually read the link? The main paragraph specifically says Java and in fact if you took a moment to read a little further you will find Java one of the main languages to be supported. I can't even see Javascript there.

      --
      http://blog.grcm.net/
  98. To.. Speed up development times????? by dynamo · · Score: 1

    HA heeee hahhaa

    I don't think so.

  99. Simple! by paulxnuke · · Score: 1
    Our IT director has made the decision that, to speed up development times, we need to re-architect all of our existing code, from C++ to Java.

    If your IT director is clueless enough to make a move like this without (obviously) asking advice from his developers first, the handwriting is on the wall: your company has had it, and their form of suicide includes expending their remaining funds on consultants. Start looking for a new job TODAY. By all means collect a paycheck while you're looking (you can also acquire some Java experience to sell to the next company) but don't ride the sinking ship too long. It's depressing.

  100. Why not C#? by wft_rtfa · · Score: 1

    Python might work ok, but for C++ developers on Windows, C# would work much better. It's a more productive language than C++ and it allows you much more easily intergrate existing C++ code than Java and probably Python. I personally prefer Java, but C# is so similar and it's easier to call existing C++ code on Windows. If you don't portable code, I think C# is the definate answer.
    Although, if you go with Java, you can still interface with existing C++ code, so you don't have to rewrite everything.

    --
    :-] :0 :-> :-| :->
    1. Re:Why not C#? by quanticle · · Score: 1

      That's not a bad idea either. There is a MSIL (Microsoft Intermediate Language) compiler for C++ included in Visual Studio, so existing code could easily be packaged to run alongside new code. As long as you aren't considering the risks of further Microsoft dependence, C# is an adequate substitute for Java in most respects.

      --
      We all know what to do, but we don't know how to get re-elected once we have done it
  101. DON'T by gothmog666 · · Score: 1

    Java fast development is marketing. You can achieve the same results in C++ undoubtely.
    Although, as someone up hinted, Python would be cool. Python integration with C++ is great.
    And better, is trendy.

    --
    I intend to live forever. So far, so good.
  102. Your IT manager? by sheds · · Score: 1

    You wrote there that your IT manager decided to convert everything to Java to speed up development times, so, why don't you ask him how he thinks this is going to happen? What are the advantages and tools that Java (i'm sure it does) has that makes it better than C++ to speed up develepment? Does this sound like something you would ask your boss? I really think so.

    --
    Building for a shallow grave Must be something else we say Somehow to defend this place
  103. Misdesigned or just crufty? by Fnkmaster · · Score: 1

    The question is, is the system radically misdesigned, or has it just accumulated some cruft? If it's radically misdesigned because the requirements have changed so many times over the years, then a ground-up redesign, with the benefit of reams of documentation of what the real requirements and specifications are *might* be a good idea.

    But if the system just happens to use some older technologies or has code that appears messy or spaghetti-ish, then I would strongly suggest refactoring over rewriting. If the capabilities of the current system are limited in some way, make sure you understand exactly in which way and why they are limited so you don't waste time rebuilding only to find that those limitations are fundamental to some combination of business requirements, rather than incidental to the engineering decisions.

    If the scope and breadth of what a system is supposed to do has changed drastically and you can demonstrably prove to a room full of developers that the architecture is to blame for your current problems, then the bad design/architecture flag could legitimately be thrown. Understand that you will be throwing away the baby with the bathwater when you rewrite. And don't try rewriting using tools your team isn't familiar with - that's just asking for disaster.

    I have been in one situation where a poorly specified system was replaced about 85-90% with a ground-up rewritten system (we reused a few components), where the original took a team of 10 people over 2 years to write and the replacement was done in 2 months by 2 people. This was accomplished because the original system was supposed to do everything for everybody and turned into a totally flexible architecture and infrastructure for enterprise apps in Java and basically became a slow bloated mess. The replacement just stuck to a well-defined set of requirements and did its job well, and was between 20 and 50 times faster than the original.

    However, I have also seen situations where an otherwise good, working system that was complex and underdocumented (but where the complexity was necessary) was thrown away for political reasons, and we ended up wasting 3 months rebuilding the system from scratch ("porting" it from C++ to Java with a JNI/C++ core). The new system worked well, and was somewhat more flexible, but since the original system had been revised to reflect dozens of additional rules of business logic and corner cases that were never documented anywhere, replicating it all to the actual needs of this customer would have been a prohibitively complicated process.

  104. Some reasons to switch ... by gigi · · Score: 1

    I think it's a good idea to switch from C++ to Java (or C#) if:
        if you are getting bogged down in memory leaks,
        if stepping through smart pointers makes debugging complicated,
        if you have 20-minute compile times
        if some trivial functionality (say, de-serialization of XML, or web service calls)
        requires pages of C++ code

    If you go ahead and start switching, try to do the following:
    A) keep as much of existing C++ code, and call into via JNI,
    B) use jazillian http://jazillian.com/ to translate existing code to Java,
    C) use my web site http://code2code.net/ to translate to C# or VB, if you want the .NET route.

    Good luck, switching will be an enormous project! /george