Static analysis

And copy/paste may not be a good thing to constantly do.
Ha yeah, its a bad thing to ever do (although we all do it)! It means you missed an opportunity to extract a common function, and thus make the code simpler, more readable and more robust. And as it is normally done when the programmer is being lazy or doesn't really understand the code, it tends to introduce errors because they don't bother to check properly that they updated the pasted code, or they don't understand what updates are actually required for that code to work correctly in the new context. Converting the code into a function you can call in both places is almost always a better idea, as it forces you to understand what the code does, and it improves the robustness and re-usability.
 
Ha yeah, its a bad thing to ever do (although we all do it)! It means you missed an opportunity to extract a common function, and thus make the code simpler, more readable and more robust. And as it is normally done when the programmer is being lazy or doesn't really understand the code, it tends to introduce errors because they don't bother to check properly that they updated the pasted code, or they don't understand what updates are actually required for that code to work correctly in the new context. Converting the code into a function you can call in both places is almost always a better idea, as it forces you to understand what the code does, and it improves the robustness and re-usability.
Too bad I never got the proper Teaching back in my day (late 70's early 80's) during my Cobol, Fortran, Basic, and Pascal days at WIU and East Central. Maybe I would've stayed in computer science instead of switching majors to Education. And would've gotten my degree. But switching Majors while on the GI Bill did not allow me to support a growing family And finish my schooling. 180+ hours of college and nothing to really show for it. Just shows it was never meant to be. The wife though did get her degree in Business Admin. Now we are retirees living off SS and Pension.
 
Too bad I never got the proper Teaching back in my day (late 70's early 80's) during my Cobol, Fortran, Basic, and Pascal days at WIU and East Central. Maybe I would've stayed in computer science instead of switching majors to Education. And would've gotten my degree. But switching Majors while on the GI Bill did not allow me to support a growing family And finish my schooling. 180+ hours of college and nothing to really show for it. Just shows it was never meant to be. The wife though did get her degree in Business Admin. Now we are retirees living off SS and Pension.

In the early 90,s. I worked for an American company in the UK (Stratus) as a trainer of multi-user, fault tolerant computing. Our computer supported about 6/8 languages. Every attendee on the course could use which ever language they wanted.

I was teaching new ways of programming, they had not used before. But they were experienced programmers, how ever if they made errors on the course practical's - I had to try and solve it, (6/8 languages.).

It was a nightmare.
 
Ha yeah, its a bad thing to ever do (although we all do it)! It means you missed an opportunity to extract a common function, and thus make the code simpler, more readable and more robust. And as it is normally done when the programmer is being lazy or doesn't really understand the code, it tends to introduce errors because they don't bother to check properly that they updated the pasted code, or they don't understand what updates are actually required for that code to work correctly in the new context. Converting the code into a function you can call in both places is almost always a better idea, as it forces you to understand what the code does, and it improves the robustness and re-usability.
Or you are being paid by the line of code not the efficiency or maintainability of the resultant code. It was often used when deadlines were approaching fast. Much of the Python code shows that this trait. Easiest to spot is all the if tests with all the code in each branch whereas some could be done before the if and other bits after but then you would loose 5 lines of code per branch and cut your income by as much:lol:.
 
Top Bottom