02-24-2022, 10:15 PM
The link above would lead you to a commentary on why some languages like Ruby or Python are considered slow by seasoned programmers or those that pretty much never used them. Kopylov's opinion seemed to be reasonable and appeared to be based on his experience on those languages plus Java, Javascript and C like languages.
If you start reading the comments previous readers left, you soon realized that people could not stop criticizing him for his general approach to the speed and syntax topics. Most of them would blame him for laying stress on the importance of syntax when its impact is low at the end of the day.
Well, syntax does matter anyway. Code won't run if the syntax (akin to human language grammar) is wrong or is missing something like a parenthesis. Usually languages do deal with this issue... once. I mean, they are expected to find any such issues at the very beginning.
If we were talking about C or C++, I could say that the compiler will immediately complain about it but the binary executable aka the program or app won't. So the compiler becomes your proofreader and by the time you publish your application, it should NOT include such errors at all. (Yet, the compiler has several other tasks to perform as well.)
Just in case you were thinking about


Glossary
Source Code: Your code. Period.
Byte Code: Code read by a Virtual Machine or VM.
Binary Code or Machine Code: Used by OS libraries or even the CPU only. Memory and variable / pointer references do matter here.
The closer the code is to machine code, the lower its level will be.
That's why C and C++ and the like are considered low level languages, they rely on binary code.
Source Code
Can only be handled by people or language interpreters.
Slow.
Compatible with certain languages.
Simple TXT files with proper language file extensions.
Byte Code
Can only be handled by a VM.
Kind of Slow.
Compatible with several processor architectures.
Usually Cross Platform.
Binary Code
Can only be handled by an OS libraries or be directly fed to the processors like CPU's or GPU's.
Fast.
Compatible with specific processor architectures.
Cross Platform only if using very similar OS's, yet, Linux binaries won't run natively on Windows and vice versa.
The only fastest language I could think off would be Assembler that produces machine code, a set of millions of simplistic processor instructions.
Guess why people later preferred to develop languages like C and later C++ and many others.












In languages like C and C++ you gotta specify a lot of details like return value of a function, argument types, variable types, the specific moment a given variable should be declared or is it local or global?
C might not allow certain type coercions while C++ might allow you to do that if you provide it with some basic information on that value at some point. C++ has several default coercions included. It can even convert pointers into specific types.

Since none of the languages exposed here read actual source code anymore, the interpreter or executable does not focus on syntax at all (after it has finished loading your code).
Even so that does not mean other

You could say you might have encountered some



Usually you could prevent that from ever happening if you take care of its error handling, i.e. don't let them set a value above 255 or no negative value should be allowed or don't ever let them divide anything by zero!

Now talking about the maker's way of living, don't nest several loops in a row if possible.
Actually, you could not avoid


As a final word on this, I gotta say that glue code or spaghetti code won't help you here. The cleaner and more simple your code is, the better it should perform... usually.



Disclaimer
I'm not saying here that I know everything about programming nor that I've covered every single aspect of it. You still can contribute to this thread by leaving your comments here if deemed necessary.