Why do languages like C# need a ; after lines? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

Why do languages like C# need a ; after lines?

I do not know the answer to this but I have a guess for it, I think it's because languages like C# is compiled and the language i first started with (Lua) is Interpreted. I'm not sure what the true difference between the 2 types of programming languages but I believe that compiled languages get translated into something else and for that very reason you need to have ; to end lines. But then again I could be 100% wrong so please let me know

8th Oct 2018, 6:38 PM
ScriptingEngine
ScriptingEngine - avatar
3 Answers
0
You are correct. With C#, you write it, and then it gets compiled. This turns it into the language used by the .NET framework, which is the. readable by the computer.
8th Oct 2018, 9:38 PM
DaBatman
DaBatman - avatar
0
Java is interpreted(kind of) as well, but you do need a ;. Technically a line break is a character itself and it is(was) different in different operating systems. And yes, you are partially right - for a compiled language size of the source code is less of a matter, as it gets compressed before distributing.
8th Oct 2018, 9:38 PM
spotbot2k
spotbot2k - avatar
0
same reason as you put a full stop after a sentence.
10th Oct 2018, 12:56 AM
Nduduzo Khomo
Nduduzo Khomo - avatar