Search

Sonntag, 10. Dezember 2017

First example of working Cobol program.


I am very puzzled how people programmed back in 60-70, it was probably very difficult task, anyway due to demand and luck of Cobol programmers on German market, i must achieve mastery with this language.
Here what i use to master Cobol jungle:

OpenCobolIDE - very good IDE for writing Cobol programs.
Cygwin and compiled Cobol ver. 2.2 just for debugging purposes!

The online tutorials which i do is from Lynda, well in this case they are the best , Pluralsight was too short and too complicated to master, but i done it anyway!!
So for you consideration here is a code which wrote, yes i can post it on github but i am kind of lazy today!


I like how IDE highlight the Cobol code , very good.
Syntax of this language is very strict you must watch out on which column you write and the length of variables is limited.
I don't like the way how datatype in Cobol declared it pushes a programmer to learn this cryptic and obscure Cobol format , which i already hate.
Here is the whole logic of the program, Cobol allows you to use operators (+,*,= and etc) but you must write first the word COMPUTE, in my opinion it doesn't make any sense why the Cobol authors done such bad job?? (rhetorical question)


If you asked me , what i would prefer if i had only choice between C and Cobol, well i would pick C language without any further thinking , just because C syntax is  a lot better then Cobol!!!!
We have huge problem developers, there are tons of Cobol code for enterprise critical applications, i don't care what you boss say to you , but i think developers who work with Cobol commercial projects must push forward and port Cobol code into other language like for example Java and C# (.Net) . 
Sure it's not so easy and i understand that there a lot of datatype inconsistency between Cobol and other languages, but we are responsible for our code like Uncle Bob said, clean your mess and do care about the code which you write or refactor! 
Another question arise , how can i test this code , is there any unit type testing possible?`I feel people who have a lot of experience with Cobol can test the code in their brains, but i think i must found a way to unit test this programming language even if take my all free time, this is very important if i wish to stay true to the clean code philosophy.
I will further learn "funny" things about Cobol language and will master it, but i will be very liberal of maintaining the Cobol Code. This means i am advocate of change , if somebody has a fear about loosing job and don't wish to change the current state of Cobol projects, then i will be the person on to which management can fire upon, i don't care really! My concern would be a quality of code, understanding the client request and ability to refactor the code in any cases, this my personal goal for the next year :-) 

Keine Kommentare:

Kommentar veröffentlichen

All comments are pre moderated be polite and respectful!

Blog-Archiv

Blog readers favorites