Jump to content


Photo

Can COBOL ever be eradicated?


  • Please log in to reply
49 replies to this topic

#41 Guest_aevans_*

Guest_aevans_*
  • Guests

Posted 28 May 2010 - 1759 PM

WTF has garbage collection got to do with anything? I feel like I'm talking to a wall. Garbage collection is of no use when you need a mutex unlocked, a file or network connection handle closed or something else done on leaving a certain scope. Having garbage collection is totally not an excuse for not implementing support for RAII. Python, for example, has garbage collection but still supports RAII.


Like I said, RAII is a religious issue for you. You don't have to rely on it to do any of the things you've described, since they can all be done explicitly. Even in Java you can write code to guarantee network and OS resource release, though you can't get the reference variables de-allocated right away. (Gotta wait for the garbage collector to do that.) There's no reason to insist on RAII except as a matter of religious conviction. Don't mean to hurt your feelings, those are the facts.

So what you're really saying is that in some languages you'll just have to make do with that feature? Duh! Posted Image


I'm saying that regardless of the language, there are ways to implement desired or required design patterns. Only a religious fanatic insists that a language do it his way.
  • 0

#42 Mobius

Mobius

    Member

  • Members
  • PipPip
  • 5,870 posts

Posted 28 May 2010 - 1810 PM

Speaking of getting out COBOL, I thought about another reason. Back in the 2K era we had to fix the dates of all of our data bases. We had two digit years on our dates.
YYMMDD. But did not want to completely change a 2 million plus data base records in multiple cities where it was sorted by date. You would have to unload and completely reload the data base if you changed it to YYYYMMDD for the date. So we made little code changes where where the years after 99 were translated to A0 and the next year to A1 and so on. This might last until .... now. AA I wonder if multiple data bases run into a wall Jan 1 2011?

Edited by Mobius, 28 May 2010 - 1811 PM.

  • 0

#43 Red Ant

Red Ant

    Member

  • Members
  • PipPip
  • 682 posts

Posted 28 May 2010 - 1910 PM

Like I said, RAII is a religious issue for you. You don't have to rely on it to do any of the things you've described, since they can all be done explicitly. Even in Java you can write code to guarantee network and OS resource release, though you can't get the reference variables de-allocated right away. (Gotta wait for the garbage collector to do that.) There's no reason to insist on RAII except as a matter of religious conviction. Don't mean to hurt your feelings, those are the facts.


The only way of doing that in Java is using those ugly, extremely elaborate try-catch-finally constructs (and you'll have to rethrow too, if you want to be exception-neutral) and doing the cleanup explicitly in the finally-block. Garbage collection doesn't help at all, since you aren't even guaranteed that your object's finalize() method gets executed at all.

I'm saying that regardless of the language, there are ways to implement desired or required design patterns. Only a religious fanatic insists that a language do it his way.


Yes, there are, and they are complicated and ugly as opposed to the neat simplicity of RAII. You must be the first programmer I've met who knows what RAII is but doesn't think not having it is a big deal. Your stance on this topic is kind of like saying "Oh we don't need no stinking functions and classes because we can just code in ASM." Sure, any problem that can be solved WITH a feature that makes life easier can also be solved without it - it'll just be a lot less comfortable.

Edited by Red Ant, 28 May 2010 - 1910 PM.

  • 0

#44 Guest_aevans_*

Guest_aevans_*
  • Guests

Posted 29 May 2010 - 1059 AM

The only way of doing that in Java is using those ugly, extremely elaborate try-catch-finally constructs (and you'll have to rethrow too, if you want to be exception-neutral) and doing the cleanup explicitly in the finally-block. Garbage collection doesn't help at all, since you aren't even guaranteed that your object's finalize() method gets executed at all.


You're missing the point. It can be done. Whether it's the way any particular person wants it to be done is totally irrelevant.

BTW, the reference to the garbage collector was in the interest of technical completeness. When an OS resource like a file handle, or a network resource like a database connection, is released, in garbage collected languages there's still a variable referencing the resource waiting for garbage collection. The file is closed, or the connection is returned to the pool, but the pointer to it has to go out of scope and be destroyed in the normal way.

Yes, there are, and they are complicated and ugly as opposed to the neat simplicity of RAII. You must be the first programmer I've met who knows what RAII is but doesn't think not having it is a big deal. Your stance on this topic is kind of like saying "Oh we don't need no stinking functions and classes because we can just code in ASM." Sure, any problem that can be solved WITH a feature that makes life easier can also be solved without it - it'll just be a lot less comfortable.


Do you write software for a living? Because people that do it for a living generally don't engage in religious evangelism like you are engaged in. They know how to program, period, and just make do with whatever language the boss or the project requires.

Edited by aevans, 29 May 2010 - 1101 AM.

  • 0

#45 Mobius

Mobius

    Member

  • Members
  • PipPip
  • 5,870 posts

Posted 30 May 2010 - 0901 AM

Do you write software for a living? Because people that do it for a living generally don't engage in religious evangelism like you are engaged in. They know how to program, period, and just make do with whatever language the boss or the project requires.

That's for sure. It's not usually the jazziness of the language but other factors. Can it be maintained in the future? Can they find other programmers in the future if these leave? Will the software company be around and support the language in the years ahead? One reason our company went with MS c# instead of Delphi for some windows interface products is that management thought Borland might die. Plus MS knows shortcuts in their Windows API and 3rd party software often have to go through published routines.

Edited by Mobius, 30 May 2010 - 0902 AM.

  • 0

#46 Red Ant

Red Ant

    Member

  • Members
  • PipPip
  • 682 posts

Posted 31 May 2010 - 0803 AM

You're missing the point. It can be done. Whether it's the way any particular person wants it to be done is totally irrelevant.


You're making it seem as if __I__'m the one who started this endless debate when it was in fact you that took me up on a point I made about Java, the supposed C++ killer. I simply stated that C++ does RAII while Java doesn't, to which you responded with some irrelevant talk about garbage collection and the following statement:

But I can appreciate the convenience and power of Java-like languages, like the C# I write in every day.


which is ironic, given that RAII is both a convenient and powerful tool ... that Java doesn't have. Anyway, to get back to the point I'm not saying that C++ is the one true language for every task or even that you shouldn't use Java; all I'm saying is that for a supposed C++ killer language to lack such a fundamentally useful feature is certainly a disappointment.

BTW, the reference to the garbage collector was in the interest of technical completeness. When an OS resource like a file handle, or a network resource like a database connection, is released, in garbage collected languages there's still a variable referencing the resource waiting for garbage collection. The file is closed, or the connection is returned to the pool, but the pointer to it has to go out of scope and be destroyed in the normal way.


Not in Java, nope. The memory of the class object representing a database connection will be properly freed by the garbage collector, but the actual database connection will not necessarily get closed because that would require your finalize() method to run, and the garbage collector gives you ZIP guarantees as to WHEN or even IF that will happen. Linky -> Practical Java Praxis 67: Do Not Rely on finalize Methods for Nonmemory Resource Cleanup


Do you write software for a living? Because people that do it for a living generally don't engage in religious evangelism like you are engaged in. They know how to program, period, and just make do with whatever language the boss or the project requires.


Actually yes, I do. And the software we write is safety-critical, which is why mechanisms that eliminate or reduce potential sources of errors are extremely important to us. Apart from the fact that eliminating error sources should be a prime goal of ANY programmer worth his salt.
  • 0

#47 Guest_aevans_*

Guest_aevans_*
  • Guests

Posted 31 May 2010 - 1249 PM

You're making it seem as if __I__'m the one who started this endless debate when it was in fact you that took me up on a point I made about Java, the supposed C++ killer. I simply stated that C++ does RAII while Java doesn't, to which you responded with some irrelevant talk about garbage collection and the following statement:


I wasn't talking about RAII. I was talking about the language in general. If I didn't make that clear, I apologize.

which is ironic, given that RAII is both a convenient and powerful tool ... that Java doesn't have. Anyway, to get back to the point I'm not saying that C++ is the one true language for every task or even that you shouldn't use Java; all I'm saying is that for a supposed C++ killer language to lack such a fundamentally useful feature is certainly a disappointment.


You said Java was a "C++ killer". You may have heard that somewhere, but I never have, and I certainly wouldn't agree with such an obvious absurdity. You, my friend, have created a false dilemma.

Having said that, all of the memory managed languages taken together (Java, C#, PHP, Perl, Ruby, etc.) have really cut into the potential C/C++ code inventory, because they do what many programmers need them to do, without requiring programmers to mess with stuff they don't need to mess with.

Not in Java, nope. The memory of the class object representing a database connection will be properly freed by the garbage collector, but the actual database connection will not necessarily get closed because that would require your finalize() method to run, and the garbage collector gives you ZIP guarantees as to WHEN or even IF that will happen. Linky -> Practical Java Praxis 67: Do Not Rely on finalize Methods for Nonmemory Resource Cleanup


Thanks for linking to an article describing what I was talking about. Now go back and re-read what I wrote.

Did you re-read it? Jeepers -- how dumb do you think I am!? Of course you can't rely on the garbage collector to run Finalize(). That's why you use try-catch-finally. And that's precisely what I meant when I wrote: "Even in Java you can write code to guarantee network and OS resource release, though you can't get the reference variables de-allocated right away." IOW, there are well known and easy to implement design patterns for resource control, even if they don't rely on the holy RAII.

Actually yes, I do. And the software we write is safety-critical, which is why mechanisms that eliminate or reduce potential sources of errors are extremely important to us. Apart from the fact that eliminating error sources should be a prime goal of ANY programmer worth his salt.


Since you want to go there, any programmer "worth his salt" knows that any desired but non-existent language feature can be synthesised. The smart pointer you demonstrated earlier is a pointer synthesized into an object through encapsulation. By the same token, safe resource management can be synthesized by writing the necessary logic into wrapper code encapsulating an unsafe class in a safe one. No big deal -- it's done every day.

WRT your professional endeavors, here's a piece of unsolicited but valuable advice: don't fall in love with any particularl language, much less any particular language feature. You're going to have to say goodbye to your present job someday, and if you insist on working within a narrow selection of technologies, you're just making yourself unmarketable.

Edited by aevans, 31 May 2010 - 1335 PM.

  • 0

#48 medicjim86

medicjim86

    Member

  • Members
  • PipPip
  • 3,036 posts

Posted 01 June 2010 - 1005 AM

Programming languages are like construction materials... I feel like I am watching a group of masons and carpenters argue over which material to build a structure with....

The large company I work for still builds NEW COBOL programs for a niche of programming challenges... if Pascal or Fortran were still the best of breed for another niche, we would use them too... If you want to support high speed transaction processing and you have infrastructure in the way of a standing cadre of COBOL programmers, VSAM data and IBM big iron sitting in your data center, COBOL still makes sense.

FYI - We are also migrating some systems to RAM resident data fabric, SOA and fancy pseudo 4-5GL UI builders for other solutions....so the proverbial CIO/CTO head is not entirely sand immersed.

You use what makes sense....arguing over which is better for everything is something only silly programmers do :P

Edited by medicjim86, 01 June 2010 - 1014 AM.

  • 0

#49 Guest_aevans_*

Guest_aevans_*
  • Guests

Posted 01 June 2010 - 1022 AM

You use what makes sense....arguing over which is better for everything is something only silly programmers do Posted Image


Agree 100%.
  • 0

#50 capt_starlight

capt_starlight

    Member

  • Banned
  • PipPip
  • 1,392 posts

Posted 02 June 2010 - 0137 AM

Are you talking about the ISPF editor?


JCL - Job Control language - its the bit that went onto the 50 column cards and 'told" the mainframe how to actually "run" the COBOL code (source data device(s), code, out put method and device, etc)while passing it variables like date/time. Very simple, very dense language.

I had just come into IT direct with no training. This was my first task on day 1 - run an offsite pension run (simulate a disaster recovery scenario) for a rather large Oz Government Department.
  • 0