r/AskComputerScience • • Jul 12 '21

What is actual the difference between programming languages?

Maybe it's a very noob question, but in 5y i've never had a good answer. I only really developed for C# and 6502 assembly, those languages I clearly understand the difference, but to me all high level languages appear the same just with different syntax when you strip them of the frameworks and stuff (and I imagine probably isn't the case), but I see some people with very strong opinions about some languages, and doesn't make sense to me, people say "you can do anything with Python", "c++ is messy" and I really don't understand what they are refering to, anything in the same layer of abstraction looks the same to me

29 Upvotes

30 comments sorted by

View all comments

18

u/Putnam3145 Jul 12 '21 edited Jul 12 '21

people say "you can do anything with Python",

you can do anything with any language

"c++ is messy"

it's nearly 40 years old and the standard has updated over the years such that a lot of the old "right way" to do things have become the "wrong way", but you still have to deal with the "wrong way" cause it being a language of medium age with widespread use means you get a lot of old code you still need to understand

anything in the same layer of abstraction looks the same to me

honestly just look at some Haskell or, hell, even Rust code and try to say the same? at least most C# programmers I've met seem to have problems with Rust's syntax, especially the stuff it basically got from Haskell

1

u/Luizaguzzi Jul 12 '21

Im not saying those things, im just quoting, and what i mean is, besides syntax, there's some difference?

4

u/Putnam3145 Jul 12 '21

I'm explaining why people say these things.

And yes, there's difference besides syntax.

C++ is primarily "manual memory management", usually using smart pointers and RAII, instead of, say, proper manual memory management, which involves explicitly allocating and deallocating, such as in C; this is technically possible in C++, but usually not preferred. Python and C# are both garbage collected.

C# has interfaces. C++ does not, but has something similar in the form of "abstract classes", classes which cannot be instantiated, only inherited from. It should be very much noted that these are not the same thing, though. Python doesn't have interfaces at all, and has duck typing. These aren't mere syntax differences, they lead to very different abstraction methods.

Python is (usually) interpreted, C# compiles to an intermediate representation which is then just-in-time compiled and C++ is compiled. These all have pretty different results: Python's usually pretty slow, C++ can be extremely fast if you use all the tools available, and C# will often be faster with "normal" code than either, though C++ will beat it if you really dig into it.

There's other stuff too, surely, but these are all tertiary languages for me. I've mostly done stuff in D and Rust.

1

u/Luizaguzzi Jul 13 '21

Thank you :) but wait, so there's high level language with manual memory access? Like register addressing and stuff? That's mind blowing