involves AAA and oftentimes BBB

hx1997

Senior Member
汉语普通话 Chinese - Mandarin
Hi everyone,

I came cross these sentences today:

When you write your code, you might end up with a chunk of code that is no longer used but still part of the program. Watch out for cases like these: remember that every line of code involves some work by the CPU and oftentimes a read or write to memory.

And I wonder what the construction "involves some work by the CPU and oftentimes a read or write to memory" means. Which of the following would you say is closer in meaning to it?

a) Every line of code involves some work by the CPU. And oftentimes, every line of code involves a read or write to memory.
b) Every line of code involves some work by the CPU. And oftentimes, the work involved is a read or write to memory.

I am confused because, theoretically, accessing memory is indeed one of the jobs of a CPU.

It would be better if you're a programmer and know what a CPU does, but any comments are welcome!

Thanks in advance!
 
  • hx1997

    Senior Member
    汉语普通话 Chinese - Mandarin
    Hi sdgraham,

    Sorry I have no idea where the sentences came from either... They were provided by a translator in one of my online chat groups. He may have found this during his work translating some book or something.
     

    dojibear

    Senior Member
    English - Northeast US
    When you write your code, you might end up with a chunk of code that is no longer used but still part of the program. Watch out for cases like these: remember that every line of code involves some work by the CPU and oftentimes a read or write to memory.

    And I wonder what the construction "involves some work by the CPU and oftentimes a read or write to memory" means. Which of the following would you say is closer in meaning to it?

    a) Every line of code involves some work by the CPU. And oftentimes, every line of code involves a read or write to memory.
    b) Every line of code involves some work by the CPU. And oftentimes, the work involved is a read or write to memory.

    I am confused because, theoretically, accessing memory is indeed one of the jobs of a CPU.
    Your sentence (a) is incorrect: you cannot combine "oftentimes" (or the more common "often") and "every". They have opposite meanings.

    Sentence (b) is the correct meaning of the construction.

    However, the "watch out" sentence is incorrect. "Code that is no longer used" means code that will never run on the cpu. That code does not involve any work by the CPU, because the code is never run. The CPU only reads instructions that it will execute. It does not read everything in memory -- why would it?
     

    hx1997

    Senior Member
    汉语普通话 Chinese - Mandarin
    Hi dojibear,

    I read somewhere else a third interpretation of the sentence:

    (c) All lines of code involve some work by the CPU and many of them (lines of code) involve a read or write to memory.

    Would you say this is correct? Or do you think (b) is correct?

    However, the "watch out" sentence is incorrect. "Code that is no longer used" means code that will never run on the cpu. That code does not involve any work by the CPU, because the code is never run. The CPU only reads instructions that it will execute. It does not read everything in memory -- why would it?
    Yes, I was doubtful of that sentence. It doesn't really make sense, but I just quoted it verbatim.:p
     
    Last edited:

    Andygc

    Senior Member
    British English
    Intended meaning = your version (c).
    Every line of code involves some work by the CPU.
    Often, that work involves reading from or writing to memory.

    It's not true, of course, as dojibear points out. If the code is no longer used, the CPU doesn't actually run it.
     

    dojibear

    Senior Member
    English - Northeast US
    I agree with Andygc, but with one other criticism: "lines of code" is misleading, because "lines" refers to human-readable text in a programming language like C. No computer can understand C or any other language. These human-readable programs are translated (by "compilers") into long sequences of simple "machine instructions", that a CPU can run.

    So a correct version of the sentence would say "All machine instructions, that are executed by the CPU, involve some work by the CPU, and many of them involve a read from memory or a write to memory."

    One "line of code" may get translated into many machine instructions, or a few, or just one.
     

    hx1997

    Senior Member
    汉语普通话 Chinese - Mandarin
    Every line of code involves some work by the CPU.
    Often, that work involves reading from or writing to memory.
    Hi Andygc,

    Sorry, I'm not fully positive what you meant... Did you mean the above quote is the intended meaning? Or did you mean that interpretation is incorrect and only (c) is correct?
     

    hx1997

    Senior Member
    汉语普通话 Chinese - Mandarin
    Hmmm, I'm not sure if I understand it correctly. Doesn't (c) mean that many lines of code will read from or write to the memory, while your version means that reading from or writing to the memory is often the work involved in "some work by the CPU"?

    Sorry if I didn't make myself clear. I was wondering, for example, let A = the code, B = some work by the CPU, C = read/write to memory, and let ">" be "involve". Does the original sentence mean A > B AND A > C, or A > B > C?
     

    Andygc

    Senior Member
    British English
    Ignoring the great factual error that dojibear pointed out:
    All code makes the CPU work.
    Often that code gives the CPU work that includes writing to or reading from memory.

    The code never writes or reads anything - the CPU does that. The code can involve writes or reads - but only as instructions to the CPU.
     

    sdgraham

    Senior Member
    USA English
    In addition to the fine advice above, I'll add that if it's a translation, it could well have suffered from the all-too-frequent situation where the translator does not have the technical knowledge to translate accurately. ;)
     
    < Previous | Next >
    Top