Quote:
Originally Posted by pkt-zer0
I was trying to point out that you can add the first n integer numbers either by
a) a for loop that goes from 1 to n, and adds the current value to a variable, which then holds the correct sum by the end of the process.
b) compute n*(n+1)/2.
Both can be written in C and ASM, version b) is obviously faster, even if you write version a) is assembler.
But, b in assembly is faster than B in C.
Quote:
I never said C++ was the only OOP language, I just said that C wasn't. Also, you don't have member functions in C (I think), but you can assign function pointers to member fields, and access functions indirectly that way. Also, as I said, no private fields in C, thereby screwing the data-safety concept of OOP.
About Java... I pretty sure you could code your own objects there, as well. And that would mean that you wouldn't even need to use objects there, either. Not that you wouldn't want to use them, but still.
Yea, but it's just like C. (i think you can put member functions in structs, not sure... and actually... i think you can also make things private.
Quote:
Anyway, to illustrate my point further. Let's say you write a book about a given topic. You might still choose different styles to write it (prose or verse, etc.), but it would still be about the same topic. (Coding methods, OOP and SP, for example.)
And on top of that, you might even write it in different languages (English, Spanish, etc.), but it would still mean the same thing, still use the same style. (Programming languages, like C, C++, Java, for example.)
What you're saying is basically that Spanish is prose, and English is prose as well, whereas Spanish might be verse, too. :P See how absurd it is?
Prose? Well, not sure what you mean here. If you mean "better" then yes. It'd be easier to explain things in one language than another. But, ultimately, since these languages of programming were invented in english, English would be the ultimate choice to teach in.