# Computer Language Primer - Part 1 - Comments

• Insights
.Scott
Homework Helper
1) The description of assembler having a one-to-one association with the machine code was a characteristic of the very earliest assemblers. In the mid '70's, macro-assemblers came into vogue - and the 1-to-1 association was lost. What really defines a assembly language is that all of the resulting machine code is coded for explicitly.
2) It was stated that it is more difficult to debug compiler code than machine language or assembler code. I very much understand this. But it is true under very restrictive conditions that most readers would not understand. In general, a compiler will remove a huge set of details from the programmers consideration and will thus make debugging easier - if for no other reason than there are fewer opportunities for making mistakes. Also (and I realize that this isn't the scenario considered in the article), often when assembler is used today, it is often used in situations that are difficult to debug - such as hardware interfaces.
3) Today's compilers are often quite good at generating very efficient code - often better than what a human would do when writing assembly. However, some machines have specialized optimization opportunities that cannot be handled by the compiler. The conditions that dictate the use of assembly do not always bear on the "complexity". In fact, it is often the more complex algorithms that most benefit from explicit coding.
4) I believed the article misses a big one in the list of interpretive languages: Forth (c. 1970). It breaks the mold in that, although generally slower than compilers of that time, it was far from "slower than mud". It's also worth noting that Forth and often other interpretive languages such as Basic, encode their source for run-time efficiency. So, as originally implemented, you could render your Forth or Basic as an ASCII "file" (or paper tape equivalent), but you would normally save is in a native form.
5) I think it is worth noting that Object-Oriented programming is primarily a method for organizing code. It is very possible (and unfortunately quite common) to code "object dis-oriented" even when using OO constructs. Similarly, it is very possible to keep code objected oriented when the language (such as C) does not explicitly support objects.

Gold Member
2019 Award
1) The description of assembler having a one-to-one association with the machine code was a characteristic of the very earliest assemblers. In the mid '70's, macro-assemblers came into vogue - and the 1-to-1 association was lost. What really defines a assembly language is that all of the resulting machine code is coded for explicitly.
I stopped doing assembly somewhere in the mid-70's but my recollection of macro assemblers is that the 1-1 correspondence was not lost. Can you expand on your point?
2) It was stated that it is more difficult to debug compiler code than machine language or assembler code. I very much understand this. But it is true under very restrictive conditions that most readers would not understand. In general, a compiler will remove a huge set of details from the programmers consideration and will thus make debugging easier - if for no other reason than there are fewer opportunities for making mistakes. Also (and I realize that this isn't the scenario considered in the article), often when assembler is used today, it is often used in situations that are difficult to debug - such as hardware interfaces.
No argument, but too much info for the article.
3) Today's compilers are often quite good at generating very efficient code - often better than what a human would do when writing assembly. However, some machines have specialized optimization opportunities that cannot be handled by the compiler. The conditions that dictate the use of assembly do not always bear on the "complexity". In fact, it is often the more complex algorithms that most benefit from explicit coding.
No argument, but too much info for the article.
4) I believed the article misses a big one in the list of interpretive languages: Forth (c. 1970). It breaks the mold in that, although generally slower than compilers of that time, it was far from "slower than mud". It's also worth noting that Forth and often other interpretive languages such as Basic, encode their source for run-time efficiency. So, as originally implemented, you could render your Forth or Basic as an ASCII "file" (or paper tape equivalent), but you would normally save is in a native form.
I never used Forth so may have shortchanged it. Intermediate code was explicitly left out of this article and will be mentioned in part 2
5) I think it is worth noting that Object-Oriented programming is primarily a method for organizing code.
I totally and completely disagree. OOP is a completely different programming paradigm.
It is very possible (and unfortunately quite common) to code "object dis-oriented" even when using OO constructs.
I completely agree but that does nothing to invalidate my previous sentence.
Similarly, it is very possible to keep code objected oriented when the language (such as C) does not explicitly support objects.
Well, sort of, but not really. You don't get a true class object in non-OOP languages, nor do you have the major attributes of OOP (inheritance, etc).

.Scott
Homework Helper
I stopped doing assembly somewhere in the mid-70's but my recollection of macro assemblers is that the 1-1 correspondence was not lost. Can you expand on your point?
With a macro assembler, both the programmer and the computer manufacturer can define macros to be anything - calling sequences, structures, etc. Even the individual instructions were macros, so by changing the macros you could change the target machine.
I never used Forth so may have shortchanged it.
It's important because it is an interpretive language that it pretty efficient. It contradicts your "slow as mud" statement.
I totally and completely disagree. OOP is a completely different programming paradigm.
I suppose it depends on how much you include in the term object-oriented. Literally arranging you code into objects, making some "methods" public and others internal, was something I practiced before C++ or the term object-oriented were coined.

Gold Member
2019 Award
With a macro assembler, both the programmer and the computer manufacturer can define macros to be anything - calling sequences, structures, etc. Even the individual instructions were macros, so by changing the macros you could change the target machine.
DOH !!! I used to know that. Totally forgot. Thanks.
I suppose it depends on how much you include in the term object-oriented. Literally arranging you code into objects, making some "methods" public and others internal, was something I practiced before C++ or the term object-oriented were coined.
But that does NOT even remotely take advantage of things like inheritance. Yes, you can have good programming practices without OOP, but that does not change the fact that the power of OOP far exceeds non-OOP in many ways. If you have programmed seriously in OOP I don't see why you would even argue with this.

Jaeusm
Mark44
Mentor
But that does NOT even remotely take advantage of things like inheritance.
Or polymorphism, another attribute of object-oriented programming.

Gold Member
2019 Award
Or polymorphism, another attribute of object-oriented programming.
Right. I didn't want to bother typing out encapsulation and polymorphism so I said "things like ... " meaning "there are more". Now you've made me type them out anyway.

Mark44
Mentor
Paul, how come you didn't include LOLCODE in your summary?
Code:
HAI 1.2
CAN HAS STDIO?
VISIBLE "HAI WORLD!"
KTHXBYE

Last edited:
DrClaude
Gold Member
2019 Award
Paul, how come you didn't include LOLCODE in your summary?
Code:
HAI 1.2
CAN HAS STDIO?
VISIBLE "HAI WORLD!"
KTHXBYE
Mark, you are very weird

rcgldr
Homework Helper
Gold Member
2019 Award
What about the "dot" directives in MASM (ML) 6.0 and later such as .if, .else, .endif, .repeat, ... ?

https://msdn.microsoft.com/en-us/library/8t163bt0.aspx
Conditional assembly does not at all invalidate Scott's statement. I don't see how you think it does. What am I missing?

.Scott
Homework Helper
But that does NOT even remotely take advantage of things like inheritance. Yes, you can have good programming practices without OOP, but that does not change the fact that the power of OOP far exceeds non-OOP in many ways. If you have programmed seriously in OOP I don't see why you would even argue with this.
I guess it's a matter of semantics. There was a time when OOP did not automatically include inheritance or polymorphism. By the way, the full OOP may "far exceed non-OOP", but there are still mission-critical and/or safety-minded industries where "virtual" is a dirty word.

Personally, I am satisfied when the objects are well-encapsulated and divided out in a sane way. Anytime I see code with someone else's "this" pointer used all over the place, I stop using the term "object-oriented".

Gold Member
2019 Award
...there are still mission-critical and/or safety-minded industries where "virtual" is a dirty word.
Yeah, I can see how that could be reasonable. OOP stuff can be nasty to debug.

rcgldr
Homework Helper
What about the "dot" directives in MASM (ML) 6.0 and later such as .if, .else, .endif, .repeat, ... ?

https://msdn.microsoft.com/en-us/library/8t163bt0.aspx
Conditional assembly does not at all invalidate Scott's statement. I don't see how you think it does. What am I missing?
It's not conditional assembly (if else endif directives without the period prefix are conditional assembly). Some of the dot directives are like a high level language. MASM (ML) documentation refers to these a decision directives (.if .else .endif ...) and looping directives (.while .break .continue ...) . For example:

Code:
        .if     eax == 1234
; ... code for eax == 1234 goes here
.else
; ... code for eax != 1234 goes here
.endif
The dot directive code sequence will most likely generate the following code sequence, except that the coder didn't need to use any labels with the dot directives.
Code:
        cmp     eax,1234
jne     short lbl0
; ... code for eax == 1234 goes here
jmp     short lbl1
lbl0:
; ... code for eax != 1234 goes here
lbl1:

Last edited:
scottdave
Homework Helper
Where does something like Scratch fall in these? Just another high-level language? Interpreted, or compiled?

Mark44
Mentor
jedishrfu
Mentor
Where's part 2?

Gold Member
2019 Award
Where's part 2?
I've got it about 1/3rd done but it's a low priority for me at the moment

Greg Bernhardt and jedishrfu
I've got it about 1/3rd done but it's a low priority for me at the moment
No no! high priority! high priority!

phinds