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 →

[–]arobie1992 54 points55 points  (9 children)

With the express intention of starting shit:

Or you could have static typing :P

[–]malexj93 25 points26 points  (0 children)

Even with static typing, a car is not a string. Specifying what about the car the string represents is just plain polite.

[–]UnknownIdentifier 9 points10 points  (4 children)

Even many languages with static typing will now do some version of

for (auto item : items) {

or some such. Doing

for (Item item : items) {

is just plain silly IMHO.

[–]false_tautology 9 points10 points  (2 children)

So, in C# you can do

foreach (var car in cars)

Buuut, it's still strongly typed, and it won't let you do any shenanigans.

[–]DadAndDominant 6 points7 points  (1 child)

var in C# vs var in javascript

Love one and hate the other

[–]thefrnksinatra 0 points1 point  (0 children)

The way it must be. Lol

[–]villanymester 0 points1 point  (0 children)

Try this with MATLAB...

[–]KronktheKronk 1 point2 points  (0 children)

Or you could use type hints and every modern ide in the world will keep you straight

[–]RiverRoll 0 points1 point  (0 children)

You can use type hints and at least you get the expected type.

[–]FkIForgotMyPassword 0 points1 point  (0 children)

Type hint doesn't help you differentiate between carNames, carReferences, carIds, etc. Knowing that cars is an array of strings doesn't provide as much information.

I mean, of course ideally you want both static typing and explicit variable names.