4 ms·
Documentation discoverability is one problem. Willingness to learn and trust is another one. People simply want to use things that they themselves have proven t
by Too 13y ago
Documentation discoverability is one problem. Willingness to learn and trust is another one. People simply want to use things that they themselves have proven to work before.
As an example an old colleague wanted to dump some data from python to a csv-file and did this by for-looping through each row and each item and concatenating each cell and a semicolon to a string. Even after pointing out to him that python already has a built in csv writer, that handles all issues of escaping etc, he didn't want to use it because he didn't know what it did and didnt want to learn anything new. His version didn't even do escaping inside the for-loop and he didn't see the issue of not doing it. To him the for-loop gave exactly the same result and didn't require any learning and was thus better, and why change something that works... My last suggestion was to at least use ";".join(...) but it was also a bit too magic so he stuck to his well known for-loop.
Usually standard libraries are quite reliable but in some cases, and especially if adding third party libraries, bugs and performance issues inside the library can really give you hell. If the library is supposed to just perform a simple task maybe you would rather implement it yourself as you then also have influence to fix those issues yourself later. Experiences like this can scare you away from even the most reliable libraries in the future.
- Silhouette 13y agoUsually standard libraries are quite reliable but in some cases, and especially if adding third party libraries, bugs and performance issues inside the library can really give you hell. I think part of the problem is that the statement above is maybe not as true as it used to be. Let's stick with Python as an example, though it's far from the only culprit so I hesitate to single it out here. I have a growing list of areas of the standard library that today I just assume won't work acceptably. I have tried to use them before, and I have found them to be either bug-ridden or not robustly portable or so slow as not to be worthwhile or missing enough basic functionality that you need to add something else anyway or just write everything from scratch. The everyday stuff in Python is pretty good, the basic data structures and common supporting functions like itertools, but when you start getting into the less common areas I have a very low opinion of the design and quality of the Python standard library, and that opinion is born of direct personal experience. On top of the quality and robustness, there's also usability to consider. Even if some of Python's built-in libraries do work, there might be much neater, easier ways to achieve the same result that are only a `pip install` away. Libraries like Kenneth Reitz's Requests come immediately to mind; if I were teaching a newbie to program Python tomorrow, somehow I doubt urllib[N] would feature much. I'm not sure how that hypothetical newbie is supposed to discover these things today without someone experienced to guide them, though. Whether it's Python and PyPI or Perl and CPAN or C++ and Boost or whatever other language and library repository you like, there's a lot of collective wisdom about the easiest/safest/fastest ways to get things done, but it lives in the combined experience of veterans rather than in comprehensive tutorials to follow once you've got the basics down. And that's only when there is already a recognisable place to look for general use third party libraries, not even considering all the third party libraries that might be out there but for whatever reason aren't incorporated into any de facto standard repository to make discovery (relatively) easy if you at least know what you're looking for. Is it any wonder that newbies reinvent wheels under these conditions? It seems almost inevitable to me.
- acjohnson55 13y agoI haven't come away with the same impression of the Python standard library. Besides urllib, what are the biggest offenders in your mind?
- Silhouette 13y agoFrom a few recent projects: The subprocess system is fairly awful in both usability and portability. The shutil filesystem tools had bugs and documentation issues the only time I ever tried to use them. The various compression libraries had horrible performance problems last time I tried them; shelling out to various command-line equivalents was around 4-5x faster. The command-line parsing tools are OK if you want to write a *nix-style command line tool, but not quite flexible enough for more advanced/customised uses. I have yet to discover any decent GUI library for Python, standard or otherwise, so I'm not sure whether this one counts. Logging is flexible but can be awkward to configure, particularly across an application that wants various logging itself but also uses libraries that offer to log.
- acjohnson55 13y agoYeah, I definitely see your point. I haven't used all of those things extensively, but I've got to really agree with you on subprocess and GUI stuff. I'd love to be able to write Python instead of Bash for pretty much all scripting, but working with and connecting subprocesses is a massive pain. I think logging and command line parsing work well, but each seem probably less intuitive than they have to be. But I think the library is pretty awesome for the most part.
- SEJeff 13y agoYou can build a cli parser exactly like git uses (positional and short/long) using argparse. What is difficult about that? Opt parse perhaps, but if you're talking about argparse, it seems like you're just whining. The rest of your comments I (overall) agree with
- Silhouette 13y ago
- acjohnson55 13y agoThat just sounds like laziness as a coder to me. Would he also output to JSON from scratch? I taught high school for a while, and I had kids that refused to stop using their fingers for addition, regardless of the fact that it was preventing them from learning how to do more abstract math. What you're describing is pretty much the same attitude.
- brandnewthrow 13y agoI've taken math classes up to Linear Algebra, (so basically what was required for a CS degree) and I still count on my fingers sometimes. In fact I think that math got more intuitive and "mentally pliable" the more abstract it got, but for some reason I'm still pretty hopeless with arithmetic. I also have trouble with telling right from left. Is it really the case that using fingers for arithmetic can hold a person back from learning higher math? Not trying to be snarky, genuinely curious.
- acjohnson55 13y agoI'd say the real problem is not the tool itself (finger counting, in this case) but a stubborn reliance on that tool even when it obviously can't scale. Some of these students were more concerned with just executing the algorithm than understanding process of addition, and consequently, some struggled with multi-digit addition, negative numbers, fractions, and so on. They coped with their inability to solve more complicated problems simply by not ever attempting to do the work. The attitude was "I don't get it immediately so I'm not even going to attempt to understand it". I'm really not trying to bash the students. As a teacher, my job was to invest the students in wanting to learn, and I admittedly wasn't always effective.