top | item 12267068

(no title)

Alphasite_ | 9 years ago

What's wrong with optional typing? All it does is formalise docstrings into an integrated syntax.

discuss

order

icebraining|9 years ago

Docstrings are for modules, classes, functions and methods, not variables mixed with the code.

And "optional" is a misnomer unless you only ever touch your own code. Programming is generally a social activity, so for most of us, "optional" means just means "inconsistently required".

I don't have a philosophical objection to typing, but I'm yet to see a syntax that won't muddy Python's.

geezerjay|9 years ago

> And "optional" is a misnomer unless you only ever touch your own code. Programming is generally a social activity, so for most of us, "optional" means just means "inconsistently required".

Optionally means that it's not required or mandatory.

You don't need to use it if you don't want to. If you're working on a project and the project follows a style guide then you follow the style guide, but nothing forces your bosses to require it. The code will run anyway.

mvdwoord|9 years ago

As long as it remains optional I'm all for it.

2T1Qka0rEiPr|9 years ago

It does seem odd that a module could be partially static. If it was optional I'd prefer to see it enabled by a different filetype (e.g. pys, heh piss).

raverbashing|9 years ago

It's a slippery slope

People will start using and it will become mandatory at some point

Desustorm|9 years ago

I can see the medium post now!

"Dynamically typed Python variables considered harmful"

MollyR|9 years ago

It's optional until the lead developer at work forces you to use it.

Alphasite_|9 years ago

Currently they can force you to use a docstring with types, how is that any different?