10 ms·
The Beauty of COBOL (2018)
- jimws 7y ago> Well-written code is a work of art. Always has been, always will be. The same thing was thought of assembler programming a few decades ago. Now it is rather a lost art. I fear that a day would come when machine learning algorithms can write code on their own and coding itself would become a lost art like assembler has become now.
- deelowe 7y agoAssembler isn't lost? It's still very common in hardware development.
- deleted 7y ago[deleted]
- DrScump 7y agoThere was an option in the old CAPEX optimizing COBOL compilers I used back in the 80s: you could print out the IBM 370 assembly language it generated from your COBOL source -- a look "under the hood", so to speak.
- cable2600 7y agoOpenCOBOL is now GNUCOBOL. https://sourceforge.net/projects/open-cobol/ https://sourceforge.net/projects/open-cobol/
- ngcc_hk 7y agoInteresting. The problem of cobol is that is verbose, like java. Type type and then type. Copy and find all the time. Good luck to understand any as it takes a lot of time to read it. Do not like cobol or java.
- tibbydudeza 7y agoCompared to the mess that is Javascript ... yikes ... no thanks.
- kerng 7y agoCurious what language you would prefer? Just to trying to understand you argument better. Assembly?
- eru 7y agoPython is relatively low on the kind of boilerplate Java has. (Or if you want to go more extreme, Haskell can really give you some terse programs.) I'm not the OP.
- SmellyGeekBoy 7y agoAs someone who has worked with both in a professional setting, Python has a lot of similarities with COBOL, IMO.
- ASalazarMX 7y agoAs someone who has also done that, the most important thing in common is that they're programming languages. COBOL is a rigid and "square" language, I'm tempted to call its style "COBOLic". Any language where the dots at the end of statements are crucial part of the logic flow can't be that similar to Python.
- the_af 7y agoCan you explain how? As someone that has worked with both professionally, I can't see many similarities.
- jacquesm 7y agoCompared to Java COBOL is surprisingly direct and readable. It has some silly bits that require some boilerplate to overcome but not excessively so.
- deleted 7y ago[deleted]
- zerr 7y agoTo clarify, COBOL (similarly to SQL) was intended as a UI - it was created for business people, non-programmers.
- DrScump 7y agoNo, it wasn't. Non-programmers didn't program in COBOL. Non-programmers generally lacked access to IDEs (even basic TSO workflows), compilers, and computer time, let alone JCL and data sets. COBOL was intended for business cases for which FORTRAN was ill-suited, and COBOL shops generally didn't need science/math implementations. Even PL/1 and RPG required a degree of programming skill.
- jacquesm 7y agoActually, yes it was, in a way. COBOL was intended to do away with programmers and to allow their managers to interact with the computer directly. Programmers of the day worked with machine language and generally took forever to deliver bits and pieces of functionality due to the low level nature of their tools. The idea behind COBOL was that the compiler would take a high level specification (the 'source code') which any competent person should be able to put together rather than that this specification had to be handed to the programmers. Of course, the end result was that we ended up with just one layer of abstraction and programmers were in more demand than ever before because of their increased productivity, and the 'managers' ended up being programmers themselves. This then led to the schism between 'systems' programmers (those that understood assembly) and 'applications' programmers, those that only worked in high level languages. When I started working professionally in IT this division was still quite visible.
- ainar-g 7y agoOh man, I always wanted to learn more about COBOL. People like to crap on the language, but this article makes it seem like it's not that bad, actually. I could see myself programming that, for a large sum of money of course. With that said, the real COBOL code is probably much more horrifying, when you consider, just how much uglier real-world code is compared to small tutorials and review articles. I would really like to read a series of “COBOL War-Time Stories”.
- seanhunter 7y agoA good place to start would be use a modern COBOL web framework, such as COGS http://www.coboloncogs.org/HOME.HTM http://www.coboloncogs.org/HOME.HTM
- thanatropism 7y agoI wonder if it's possible to write a Lisp-like (such as Clojure or Hy) that compiles to COBOL in an interoperable fashion.
- DrScump 7y agohow much uglier real-world code is One of my first projects in COBOL was to complete a rewrite, using structured programming, of a report writer that dated back into the 1960s. If you think COBOL is hard to follow, imagine COBOL code laden with gotos and older than the 1968 standard.
- Starwatcher2001 7y agoYeah, that sounds fun. Did that have the evil "alter" statement, which caused even more spaghetti with gotos?
- DrScump 7y agoI think ALTER usage was formally disallowed.
- 7y ago
- kerng 7y agoHave not dealt too much with COBOL but learnt it a while ago. It was one of the easier languages to comprehend quickly. I thought it was well suited for input and data processing focused applications. I do remember thinking it's odd that a line has exactly 80 characters and putting an asterisk in the 7th or 8th row means the line is a comment. This is probably not true these days with modern COBOL. But when I saw Python the first time, and that it enforces similar restrictions with intendation and then Golang following suite, I had to smile that such old concepts of enforcing style still are seen as useful today. Often we just have to go back and see what others have done decades ago to get new ideas!
- OneFamousGrouse 7y ago> I do remember thinking it's odd that a line has exactly 80 characters and putting an asterisk in the 7th or 8th row means the line is a comment. You should check out IBM RPG and its various iterations, it's a whole lot worse than that.
- lowken10 7y agoRPG was one of my first languages. It’s crazy to get your mind wrapped around it at first.
- wglb 7y agoAs someone who spent serious time in RPG III in a previous lifetime, I would not advise anyone whose welfare I cared about or was responsible for to go look at RPG. But yes, you are correct.
- pgtan 7y agoFor me, COBOL is so over-presented in the media among the old (mainframe) lagnuages, but I recently was surprised to see a production mainframe LPAR offering an APL2 interface,and it seems the language is still maintained on zOS[1]. But I never heard of business application written in APL. 1 https://www.ibm.com/support/pages/apl2-whats-new https://www.ibm.com/support/pages/apl2-whats-new
- nickpeterson 7y agoAPL was strongly supported by IBM early on, and was used for verification of early IBM systems. When you look at APL in context, it was extremely ahead of its time.
- Pamar 7y agoDo a string search for "APL" in this webpage then: https://www.simcorp.com/en/career/product-development https://www.simcorp.com/en/career/product-development (A friend of mine worked for www.apl.it which was later bought by simcorp.com - the original company worked on actuarial models for insurances and funds).
- scottlocklin 7y agoI went to Burning Man with Allen Rose's cousin (of "Gilman and Rose" fame), and got to hear two fisted tales of him writing CRM applications in an afternoon that were still in production 20, 30 years later. It's a shame, really; it really is the most productive language I've ever used.
- dang 7y agoAPL is alive and somewhat well on HN: https://hn.algolia.com/?dateRange=all&page=0&prefix=false&query=apl%20point https://hn.algolia.com/?dateRange=all&page=0&prefix=false&qu...
- the_af 7y agoI still have nightmares about COBOL. "Beauty" and "COBOL" do not mix in the same sentence. Forget this article, it's not a nice language at all. I'm not going to crap all over the language -- I understand the requirements of its time -- but now you'd have to be crazy to want to use it. It's not even true that COBOL programmers earn a lot of money because it's a niche and there are few programmers still writing it and banks are in a hurry to hire them. That's not my experience: all the COBOL programmers I know are mostly old guys earning average/below average salaries. And dealing with banks and similar institutions, which is a hell of its own. If you like writing software and enjoy nice programming languages, COBOL is not for you. If you want to earn a lot of money or work on interesting projects, COBOL is not for you. If you're a bank manager, maybe COBOL is for you.
- commandlinefan 7y ago> "Beauty" and "COBOL" do not mix in the same sentence. The author is falling into the trap of assuming that “easy to learn” = “optimal”. COBOL is extremely easy to learn; you can learn it in a few days. That simplicity comes at a price: you outgrow it _really fast_. You can’t even write a generic sort routine or a linked list data structure in COBOL; the language just doesn’t allow that sort of reuse. I thought it was almost comical that the author had so little experience with COBOL that he wrote that it allowed you to not repeat yourself: the painful experience of rewriting things like sort routines every time you had a different comparison condition or rewriting linked list traversal code when you had a structure with a different schema than the structure that you last wrote linked list traversal code for was the reason everybody started abandoning COBOL for more flexible languages like C (even Pascal was better).
- vajrabum 7y agoI won't argue the merits of COBOL. I stopped doing it for a living 35 years ago for a reason, but sort is not a good example. COBOL has generic SORT and MERGE facilities built in as verbs. In an IBM environment (i.e. writing real applications) you'd be hard pressed to build something that has better performance than what's provided out of the box.
- earthboundkid 7y agoHas anyone made a syntax converter for COBOL to make it read like C-style language? At the very least, it would be trivial to make a macro to get rid of the magic column numbers.
- Starwatcher2001 7y agoI wouldn't call it beautiful, but COBOL is a fairly capable language. I used Microsoft COBOL on the original IBM PC (twin floppy) in 1985 to produce a realtime multiuser data collection system in a factory. This interfaced to various machines and devices using a custom TSR* routine written in x86 assembler. COBOL was chosen by the customer as they were running an IBM System 36, and the implementation was capable of calling the assembly code almost directly. Each compile would take around 20 minutes, which teaches you to be careful with the syntax! When the source code got beyond 64k, we had to build the app in sections as that's all IBM Edit at the time could handle at one time. As the article shows, COBOL is quite verbose, so 64k isn't that large! In later years we updated to Microfocus COBOL which was much better than the Microsoft version. I can't imagine any modern programmer having any problems learning COBOL sufficiently well in a few days. It was my third language after BASIC and assembler. [*] TSR = Terminate and Stay Resident program, which you loaded into MSDOS first, prior to running the main (COBOL) program. A very poor-man's "multi-tasking".
- ncmncm 7y agoI wonder when it will dawn on the COBOL tool vendors that a big chunk of what makes COBOL unpleasant is the all-upper-case presentation. The program is SHOUTING ALL THE TIME.
- AdieuToLogic 7y agoCOBOL was the original “self documenting language.” And that is why many others followed it.