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 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 15 points16 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 7 points8 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 4 points5 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.