3 ms·
> I make stupid mistakes in Python constantly. I misname a variable or a function or I pass in the wrong arguments. Devtools can catch some of these, but they u
by hellofunk 8y ago
> I make stupid mistakes in Python constantly. I misname a variable or a function or I pass in the wrong arguments. Devtools can catch some of these, but they usually require special setup. I’ve never been able to configure pylint easily, and I’m not a fan of full blown IDEs that require their own configuration. The worst is if you mistype a variable that’s hidden behind conditional logic. Your script might run for hours before triggering the error, and then everything blows up, and you have to restart it.
This this this, a million times this. I work mostly in Clojure where such problems are equally as bad, maybe even more so. Dynamic, elegant languages can feel liberating in so many ways, but there are significant workflow drawbacks that get me nearly every day.
- vikeri 8y agoI program mostly in ClojureScript which will "throw" a compiler warning if I misspell a variable. But to get that in an editor is a bit more setup than to just fire up vanilla vim.
- hellofunk 8y agoDoesn’t stop you from passing in wrong arguments, your function requires an int and you give it a string because you typed the wrong variable name there, or you mistype a keyword, which is never caught by the compiler, and you end up with nil floating through your app.
- mvid 8y agoCan’t you just use type hints (in both clojure or python 3)?
- hellofunk 8y agoThey don't take care of this issue most of the time, and in Clojurescript they are meaningless. In Clojure, only hints on primitive Java types (integer, etc) do something meaningful, so any custom Clojure types or your own "types" have no such checking, and in particular keywords are always valid if they are mistyped which results in a running program with no errors that creates nil and null pointer exceptions and undefined and other things all over the place. It's a tradeoff for using an expressive dynamic language, I guess.
- nickserv 8y agoType hints are not taken into account by the Python interpreter. They do help an IDE like pycharm, but that won't catch all errors.
- falcolas 8y agoFirst off, I get that it's unfortunate they aren't detected by Python itself in some form of compile step, but that's a cost of using a dynamic language. But they don't use the tools created to catch these kinds of errors, and complain that they aren't protected against these errors? There's a fairly large disconnect there. Hell, I have protection against this built into my VIM install. Not running these basic tools is tying a hand behind your back.