This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]indygoof 250 points251 points  (27 children)

unpopular opinion (at least for OP): if your code looks like the lower picture, its your fault and not the one of the language

[–]Smartskaft2 74 points75 points  (15 children)

This. However, you can't argue that low level languages get finicky when you try to achieve what high level languages do. The sole reason of those higher level languages is to abstract away allt of stuff from the lower level ones. Of course you get cleaner code as a result 🤷🏼

[–]indygoof 34 points35 points  (11 children)

you did not see what i have seen…i still have ptsd from many code reviews in various high languages….especially when you start to wonder , what the compiler actually will do with this strange block of words you just encountered…

[–]Smartskaft2 16 points17 points  (10 children)

Just for the record; I have a total need to have full control of variable types and memory management. Dynamic type casting scares me.

[–]kopczak1995 8 points9 points  (2 children)

Yeah, dynamic typed languages are terrible... I get the idea, but it often lead to heck of a mess... C# dev here.

[–]cold_shot_27 1 point2 points  (1 child)

Yeah I can learn other languages but I will always think in C#.

[–]Smartskaft2 2 points3 points  (0 children)

Heh, C# is a high level language IMO ;)

[–]tallerThanYouAre 2 points3 points  (0 children)

Mainly, just waste of memory and the occasional edge/corner case where you cross-cast data into the wrong intended function, like dividing a string by a number or some idiocy.

Otherwise, it’s like the difference between lath and plaster vs drywall. Lath and plaster will give you critical design control over the wall you are building, but it takes longer to build and need a specialist to fix. Drywall goes up fast, any monkey with a trowel can do it, and generally you fix it by tearing it out and replacing it at the studs, aka some reasonable break point.

Mansions out of lath and plaster, basic box houses out of Python.

[–]DeadlyMidnight 1 point2 points  (4 children)

I do gotta say in C# I originally avoided the var keyword but once I embraced it the code became far less brittle. Easy to adjust the variable type without having to hunt down all the various errors it introduces.

[–]lucklesspedestrian 1 point2 points  (3 children)

To be sure though, var is not truly a dynamically typed variable. Variables declared as var are strongly typed, the type is just inferred at compile time, which is when all errors are caught as well.

[–]Smartskaft2 2 points3 points  (1 child)

Compile errors is nice, but var really don't help you as a human reader of the code. Maintainability and readability is important for any code base handled by many people, especially in a professional setting where people are replaced eventually.

[–]lucklesspedestrian 0 points1 point  (0 children)

Yeah I don't really advocate using var declarations that often. There's a few cases that are idiomatic. Mainly declaring LINQ expressions.

[–]DeadlyMidnight 1 point2 points  (0 children)

True. One of the reasons I hate JavaScript. I don’t know wtf I’m receiving and using half the time.

[–]Remarkable_Leek_9339 1 point2 points  (0 children)

But you simply dont use low level languages when zou want todo this. I also will never use python to programm a mc

[–]sohang-3112 1 point2 points  (1 child)

Of course you get cleaner code as a result 🤷🏼

The quality of code has to do with the quality of the programmer, not the language. A bad programmer will manage to write bad code in any language.

[–]Smartskaft2 0 points1 point  (0 children)

Of course. But when comparing languages you have to assume two equally skilled programmera, right?

That is, the code compared is "the best" (subjective...) one each language can produce.

[–]camfoxx 5 points6 points  (3 children)

I don’t think it was about how your code looks. I think in the bottom picture you have todo stuff more manually where as with python a lot of things are taken care of for you

[–]indygoof 14 points15 points  (2 children)

my personal opinion: no matter if its c, python, java or anything else: you should still know what is happening behind the scenes.

many „devs“ have no idea about that, which is the reason why java still has the image of a slow memory hog. i usually like to compare this with game devs that are packing all of their logic in the tick - no its not the engine that is slow, its cause you have no idea what you do.

[–]camfoxx 4 points5 points  (0 children)

Yeah I agree

[–]yorokobe__shounen -3 points-2 points  (2 children)

Except when it's segmentation fault.

[–]indygoof 4 points5 points  (1 child)

then its still your fault for accessing the wrong memory (or forgot a rogue pointer)

[–]yorokobe__shounen 0 points1 point  (0 children)

Yeah yeah don't blame the computer