3 ms·
I'd usually not respond, but this is overly negative and missing a number of points. * PEP-8: This code is trying to demonstrate some pretty basic algorithms
by chapium 8y ago
I'd usually not respond, but this is overly negative and missing a number of points.
* PEP-8: This code is trying to demonstrate some pretty basic algorithms in simple terms. Should we care about double quotes versus single quotes and spaces to separate commas? If anything, this is an editorial issue in my opinion. Perhaps for your projects and production code you want it to be strictly PEP-8 compliant, but it does not diminish what is being presented here, which are examples of basic algorithms.
* Stack class is a thin wrapper: The author was built a stack class using common conventions. Some of it is pretty redundant, such as "def pop(self): return self.items.pop()", but the point remains. This is a clear and simple representation of an algorithms, focused on a common language. The fact that you can do stack-like things to a list misses the point of making a Stack class act and look like a stack. If anything, Python's list syntax makes implementing this minimalist.
* "The books provided on interactivepython.org are free and open source. They are for educational purposes." Perhaps the editing could be better. There are many ways to solve the same problem. At the end of the day this is given out for free and is a wealth of information.
- xapata 8y agoPEP-8 is a red herring. Aesthetics, however, is not. The beauty of code is often an excellent indicator of its general quality. You bring up a good point about editing and the value of free/open-source. I've been thinking about this often, recently. It's similar to the troubles plaguing news media. The propaganda may not be as malicious, but is similarly self-promoting, or promoting one's interests. Students have always suffered from bad textbooks, but before the internet we relied on professors to select good ones. Now we just have popularity and the vagaries of Google or upvotes on Hacker News. Of course, professors haven't always been great editors either.