Mistakes new programmers doing in start of the career?
-
- Registered Member
- Posts: 24
- Joined: Thu Nov 21, 2013 3:25 pm
Mistakes new programmers doing in start of the career?
Hi,
As a COBOL experience programmer, if you have to tell a new programmer that what are the mistakes you see new programmers are doing when they start their career, what will be your piece of advice on that. Please share your views on this, it might help some of us.
As a COBOL experience programmer, if you have to tell a new programmer that what are the mistakes you see new programmers are doing when they start their career, what will be your piece of advice on that. Please share your views on this, it might help some of us.
Re: Mistakes new programmers doing in start of the career?
Read the manuals. The reference for the language in question and the user guide for it.
Regards
Nic
Nic
- Robert Sample
- Global Moderator
- Posts: 1896
- Joined: Fri Jun 28, 2013 1:22 am
- Location: Dubuque Iowa
Re: Mistakes new programmers doing in start of the career?
One thing I repeatedly stress to my programmers (whether new or old) is that the S0C7 Data Exception is a programmer error, not a program error. With defensive coding techniques, it is possible for a programmer to totally prevent S0C7 ABENDS.
-
- Registered Member
- Posts: 24
- Joined: Thu Nov 21, 2013 3:25 pm
Re: Mistakes new programmers doing in start of the career?
Thanks nicc and Robert.
But if you don't have control on the data of input file, can then be S0C7 prevented?
But if you don't have control on the data of input file, can then be S0C7 prevented?
- prino
- Registered Member
- Posts: 68
- Joined: Sun Jun 01, 2014 4:15 am
- Location: Vilnius, Lithuania
- Contact:
Re: Mistakes new programmers doing in start of the career?
Kishor Sonawane wrote: ↑Thu Feb 01, 2018 10:26 amBut if you don't have control on the data of input file, can then be S0C7 prevented?
Biggest mistake? Not reading replies!Robert Sample wrote: ↑Tue Apr 04, 2017 5:24 pmWith defensive coding techniques, it is possible for a programmer to totally prevent S0C7 ABENDS.
- Robert Sample
- Global Moderator
- Posts: 1896
- Joined: Fri Jun 28, 2013 1:22 am
- Location: Dubuque Iowa
Re: Mistakes new programmers doing in start of the career?
Yes, of course it can be done. Verify that each numeric field is numeric before using it in calculations. Use REDEFINES if necessary on numeric fields to have an alphanumeric (PIC X) variable to be able to check each character (not always needed but handy in some cases). The specifics will depend upon the data and how it is generated, but it is ENTIRELY possible to prevent every S0C7 ABEND by appropriate coding.But if you don't have control on the data of input file, can then be S0C7 prevented?
-
- Global Moderator
- Posts: 588
- Joined: Wed Nov 20, 2013 11:53 am
- Location: Mars
Re: Mistakes new programmers doing in start of the career?
I generally ask my trainees to create new mistakes while you learn so you remember how to fix them in real time.
[ Post made via Android ]
[ Post made via Android ]
zprogrammer
Re: Mistakes new programmers doing in start of the career?
Learning how to use the manuals(usually user guide) for a product/programming language is very important.
I think most new programmers including myself always stay away from reading manuals during the start of the career. Yes it is daunting to go through 200 page PDF to find a solution to a problem, but this is the first obstacle to overcome & an important one.
Also when asking for help, one would get better response if they provide what they have tried so far and
where they are stuck. It shows that the TS has made an effort and not trying to free load on other people's effort.
I think most new programmers including myself always stay away from reading manuals during the start of the career. Yes it is daunting to go through 200 page PDF to find a solution to a problem, but this is the first obstacle to overcome & an important one.
Also when asking for help, one would get better response if they provide what they have tried so far and
where they are stuck. It shows that the TS has made an effort and not trying to free load on other people's effort.
Regards,
Vasanth.S
Vasanth.S
- Robert Sample
- Global Moderator
- Posts: 1896
- Joined: Fri Jun 28, 2013 1:22 am
- Location: Dubuque Iowa
Re: Mistakes new programmers doing in start of the career?
In one of my college classes, the professor had us code programs to generate as many errors as possible in as few lines as possible. It was an interesting exercise!I generally ask my trainees to create new mistakes while you learn so you remember how to fix them in real time.
-
- Registered Member
- Posts: 24
- Joined: Thu Nov 21, 2013 3:25 pm
Re: Mistakes new programmers doing in start of the career?
Thanks Robert. But will it not be better to get the data itself corrected instead of adding many lines of codes?Robert Sample wrote: ↑Thu Feb 01, 2018 6:41 pmYes, of course it can be done. Verify that each numeric field is numeric before using it in calculations. Use REDEFINES if necessary on numeric fields to have an alphanumeric (PIC X) variable to be able to check each character (not always needed but handy in some cases). The specifics will depend upon the data and how it is generated, but it is ENTIRELY possible to prevent every S0C7 ABEND by appropriate coding.
Now I understand what you were saying as defensive techniques.
-
- Registered Member
- Posts: 24
- Joined: Thu Nov 21, 2013 3:25 pm
Re: Mistakes new programmers doing in start of the career?
Thanks.zprogrammer wrote: ↑Fri Feb 02, 2018 12:47 amI generally ask my trainees to create new mistakes while you learn so you remember how to fix them in real time.
- Robert Sample
- Global Moderator
- Posts: 1896
- Joined: Fri Jun 28, 2013 1:22 am
- Location: Dubuque Iowa
Re: Mistakes new programmers doing in start of the career?
Yes, that is the preferred solution. However, there are many cases where it simply is not possible (for example, the data comes from another company and that company indicates they will not, under any circumstances, change the data they are providing).But will it not be better to get the data itself corrected instead of adding many lines of codes?
- prino
- Registered Member
- Posts: 68
- Joined: Sun Jun 01, 2014 4:15 am
- Location: Vilnius, Lithuania
- Contact:
Re: Mistakes new programmers doing in start of the career?
Then this four-line PL/I program is likely a decent candidate for a medal:Robert Sample wrote: ↑Tue Feb 06, 2018 3:10 am I generally ask my trainees to create new mistakes while you learn so you remember how to fix them in real time.
In one of my college classes, the professor had us code programs to generate as many errors as possible in as few lines as possible. It was an interesting exercise!
Code: Select all
%dcl z%z='put edit';proc options(main;q=''''put list(m;do i=1,2;z(q)skip;do j=
1to 78c=substr(m(i),j;if c=q z(c;z(c;end;z(q',';dcl(c,q)char,m(2)char(99)init(
'%dcl z%z=''put edit'';proc options(main;q=''''''''put list(m;do i=1,2;z(q)skip;do j=',
'1to 78c=substr(m(i),j;if c=q z(c;z(c;end;z(q'','';dcl(c,q)char,m(2)char(99)init(',
Code: Select all
15668-910 IBM OS PL/I OPTIMIZING COMPILER %dcl z%z='put edit';proc options(main;q=''''put list(m;do i=1,2;z(q)skiPAGE 2
-PREPROCESSOR DIAGNOSTIC MESSAGES
-ERROR ID L LINE MESSAGE DESCRIPTION
0
0SEVERE AND ERROR DIAGNOSTIC MESSAGES
0
0IEL0133I E 1 MISSING SEMICOLON ASSUMED BEFORE '%'.
0IEL0163I E 1 NO ATTRIBUTES DECLARED FOR IDENTIFIER 'Z'. 'CHARACTER' ASSUMED.
0
0END OF PREPROCESSOR DIAGNOSTIC MESSAGES
Code: Select all
15668-910 IBM OS PL/I OPTIMIZING COMPILER %dcl z%z='put edit';proc options(main;q=''''put list(m;do i=1,2;z(q)skiPAGE 6
-COMPILER DIAGNOSTIC MESSAGES
-ERROR ID L STMT MESSAGE DESCRIPTION
0
0SEVERE AND ERROR DIAGNOSTIC MESSAGES
0
0IEL0241I S END OF SOURCE TEXT FOUND BEFORE LOGICAL END OF PROGRAM. 2 'END' STATEMENT(S) ASSUMED.
0IEL0285I S 1 LABEL MISSING FROM 'PROCEDURE' OR 'ENTRY' STATEMENT. ONE HAS BEEN ASSUMED.
0IEL0400I E 1 RIGHT PARENTHESIS ASSUMED AFTER 'OPTIONS(MAIN'.
0IEL0399I E 2 SEMICOLON ASSUMED AFTER 'OPTIONS(MAIN;Q='''''.
0IEL0400I E 3 RIGHT PARENTHESIS ASSUMED AFTER 'LIST(M'.
0IEL0306I S 5 EDIT DATA LIST HAS NO MATCHING FORMAT LIST AFTER 'EDIT(Q)'. 'A' FORMAT ASSUMED.
0IEL0399I E 6 SEMICOLON ASSUMED AFTER '(Q)SKIP;DO J= 1TO 78'.
0IEL0400I E 7 RIGHT PARENTHESIS ASSUMED AFTER 'TO 78C=SUBSTR(M(I),J'.
0IEL0271I S 8 KEYWORD 'THEN' ASSUMED AFTER 'UBSTR(M(I),J;IF C=Q' IN 'IF' STATEMENT.
0IEL0306I S 8 EDIT DATA LIST HAS NO MATCHING FORMAT LIST AFTER 'EDIT(C'. 'A' FORMAT ASSUMED.
0IEL0400I E 8 RIGHT PARENTHESIS ASSUMED AFTER 'EDIT(C'.
0IEL0306I S 9 EDIT DATA LIST HAS NO MATCHING FORMAT LIST AFTER 'EDIT(C'. 'A' FORMAT ASSUMED.
0IEL0400I E 9 RIGHT PARENTHESIS ASSUMED AFTER 'EDIT(C'.
0IEL0306I S 11 EDIT DATA LIST HAS NO MATCHING FORMAT LIST AFTER 'EDIT(Q',''. 'A' FORMAT ASSUMED.
0IEL0362I E 11 COMMA ASSUMED AFTER 'EDIT(Q'.
0IEL0400I E 11 RIGHT PARENTHESIS ASSUMED AFTER 'EDIT(Q',''.
0IEL0314I S 12 END OF SOURCE TEXT FOUND BEFORE END OF STATEMENT. ',' IGNORED.
0IEL0400I E 12 RIGHT PARENTHESIS ASSUMED AFTER 'r,m(2)char(99)init(''.
0
0WARNING DIAGNOSTIC MESSAGES
0
0IEL0563I W STATEMENT NUMBER / LEVEL / NEST DETAILS MAY BE INCOMPLETE IN SOURCE LISTING DUE TO PREVIOUSLY
DETECTED INVALID SYNTAX.
0IEL0563I W STATEMENT NUMBER / LEVEL / NEST DETAILS MAY BE INCOMPLETE IN SOURCE LISTING DUE TO PREVIOUSLY
DETECTED INVALID SYNTAX.
0IEL0254I W 2 NO BLANK BETWEEN CONSTANT AND FOLLOWING LETTER. BLANK ASSUMED AFTER 'OPTIONS(MAIN;Q='''''.
0IEL0254I W 6 NO BLANK BETWEEN CONSTANT AND FOLLOWING LETTER. BLANK ASSUMED AFTER '(Q)SKIP;DO J= 1TO 78'.
0IEL0254I W 6 NO BLANK BETWEEN CONSTANT AND FOLLOWING LETTER. BLANK ASSUMED AFTER 'EDIT(Q)SKIP;DO J= 1'.
0IEL0238I W 12, 12 CHARACTER STRING CONSTANT CONTAINS SEMICOLON.
0
0COMPILER INFORMATORY MESSAGES
0
0IEL0533I I NO 'DECLARE' STATEMENT(S) FOR 'SYSPRINT','SUBSTR','I','J'.
0IEL0541I I 1 'ORDER' OPTION APPLIES TO THIS BLOCK. OPTIMIZATION MAY BE INHIBITED.
0
0END OF COMPILER DIAGNOSTIC MESSAGES
Despite the presence of no less than 8 S (RC=12) and 10 E (RC=08) errors, it still produces a valid OBJECT deck, that, when linked, produces a valid LOAD module that prints the original source. Yes, the above is (probably, I'd like to be proved incorrect, as I wrote it) the smallest (326 significant bytes) possible PL/I Quine
-
- Registered Member
- Posts: 24
- Joined: Thu Nov 21, 2013 3:25 pm
Re: Mistakes new programmers doing in start of the career?
PL/I is not used much these days, is not it? It has become a rare language these days.
Re: Mistakes new programmers doing in start of the career?
Thank you for an interesting thread. @Robert Sample: the craft of definsive design is not technology specific, however courses or online traning material is typically using a contemporay language. That is not too inspiring for a seasoned PL1 programmer who is in the need of inspiration. Can you (Robert or anyone) help pointing to some (good) material that can be used as inspiration? Thank you in advance.
Re: Mistakes new programmers doing in start of the career?
Are you looking for resources on PL1?mstam wrote: ↑Mon Jan 18, 2021 3:59 pm Thank you for an interesting thread. @Robert Sample: the craft of definsive design is not technology specific, however courses or online traning material is typically using a contemporay language. That is not too inspiring for a seasoned PL1 programmer who is in the need of inspiration. Can you (Robert or anyone) help pointing to some (good) material that can be used as inspiration? Thank you in advance.
Create an account or sign in to join the discussion
You need to be a member in order to post a reply
Create an account
Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute