6 ms·
This should be taught in any programming class. > Rule of Diversity: Distrust all claims for “one true way”. Although, does the python rule "There should be o
by jokoon 11y ago
This should be taught in any programming class.
> Rule of Diversity: Distrust all claims for “one true way”.
Although, does the python rule "There should be one-- and preferably only one --obvious way to do it." contradict this one ?
> Rule 5. Data dominates. If you've chosen the right data structures and organized things well, the algorithms will almost always be self-evident. Data structures, not algorithms, are central to programming.
I wonder what rob pike has to say about OOP or java, I wish I could listen to it.
Also it says that text is a good representation of data, but I think he meant it as intermediary. I don't think xml or html are really good choices when you see all the CPU cycles spent parsing those.
> Rule of Economy: Programmer time is expensive; conserve it in preference to machine time.
I prefer this rules versus the "no premature optimization" rule.
- mtrn 11y ago> I wonder what rob pike has to say about OOP or java, I wish I could listen to it. 12 minutes where Pike talks about a few things, that seem to be wrong in our software world: https://www.youtube.com/watch?v=5kj5ApnhPAE https://www.youtube.com/watch?v=5kj5ApnhPAE
- olavk 11y agoPerl is arguable much closer to the Unix philosophy than Python, for better or worse. That said, the "One obvious way" in Python is not exactly the same as "Only one true way".
- deleted 11y ago[deleted]
- vmsisbetter 11y agoRob Pike doesn't know Smalltalk, Self, or Common Lisp/CLOS--why should you care what his opinions are concerning OO as a paradigm?
- fao_ 11y agoMost developers touting OOP don't know those languages; so why should we care what their opinions are concerning OOP as a paradigm. If you exclude one person because they disagree with X and don't know Y, then you must equally disregard all who agree with and disagree with X, because they don't know Y. Otherwise you're just cherrypicking :)
- vmsisbetter 11y agoFine by me, since those developers are doing so on behalf of systems like Java and Python, which fall far below the mark. However, it has become quite trendy to bash OOP itself, especially here on HN, without acknowledging that there are less awful ways of doing it that just aren't mainstream. Try making similarly blanket criticisms of FP here using Python (Why, it has lambdas and list comprehensions after all--isn't that enough?) or some other impure language and see what happens.
- mseepgood 11y agoHe definitely knows Smalltalk and Lisp
- pjmlp 11y agoFunny how HNers have such a high regard for his opinion on a domain he is well known for being sceptical and yet disregard his opinion, as UNIX co-author, that UNIX is well past its due date and is time to move on.
- bad_user 11y ago> does the python rule "There should be one-- and preferably only one --obvious way to do it." contradict this one ? The irony is that Python has more ways of doing things in general and often the choice is very much non-obvious, compared to a language like Ruby which is supposedly embracing TIMTOWTDI. In other words, that Python rule doesn't match reality and I've always found it funny.
- tonyedgecombe 11y agoI thought the opposite for Ruby, for instance all those aliased methods on classes.
- paddyoloughlin 11y agoIs it the Python language or the Python ecosystem you are referring to? The statement in question is from The Zen of Python and is more of a guiding principle for the design of Python than a rule. The usual observation with Python is that it can have many libraries and frameworks which are quite similar and choosing one can be hard (e.g. web frameworks). This is a function of popularity and not something which can fairly be subject to that principle. On a different note: missing is the Zen of Python's following line: Although that way may not be obvious at first unless you're Dutch.
- bad_user 11y agoIt's both the language and the ecosystem. The language itself is a prime example of a language with features that aren't orthogonal. For example count how many features in Python are solved in other languages just with proper support for anonymous functions.
- DannoHung 11y agoPython's support for closures is perfectly fine. Its anonymous function support is crappy, but it doesn't stop you from doing what you want, it just looks as ugly as sin.
- coldnebo 11y agoThe rule of composition is an important counterpoint to the rule of diversity. Unix's most important feature is treating everything as a file. That interface allows a lot of freedom in composition, but every process has to conform to exactly the same interface. Perhaps not surprisingly, TCP's stream-based interface has also allowed a great deal of freedom in composition in networks.
- logicchains 11y ago>I wonder what rob pike has to say about OOP or java, I wish I could listen to it. “object-oriented design is the roman numerals of computing.” - Rob Pike (http://harmful.cat-v.org/software/OO_programming/ http://harmful.cat-v.org/software/OO_programming/) Some other gems from that page: “Object-oriented programming is an exceptionally bad idea which could only have originated in California.” – Edsger Dijkstra “The phrase "object-oriented” means a lot of things. Half are obvious, and the other half are mistakes.“ – Paul Graham “I used to be enamored of object-oriented programming. I’m now finding myself leaning toward believing that it is a plot designed to destroy joy.” – Eric Allman “The problem with object-oriented languages is they’ve got all this implicit environment that they carry around with them. You wanted a banana but what you got was a gorilla holding the banana and the entire jungle.” – Joe Armstrong
- amyjess 11y ago> “object-oriented design is the roman numerals of computing.” - Rob Pike Which is weird because Pike's Rule 4 is one of the fundamental principles of OO design.
- jokoon 11y agoI would love to throw those quote at any programming class that promotes OOP.
- vezzy-fnord 11y agoThey're only relevant for Simula-like class-based OO. Message passing OO is actually a good and criminally underrated paradigm.
- jokoon 11y agoMessage passing as in argv ? that's at a very high level, that's not really underrated nor so life changing.
- wvenable 11y agoWhen I see the never end complaints about object-oriented programming, I'm reminded of Bjarne Stroustrup's quote "There are only two kinds of languages: the ones people complain about and the ones nobody uses." I think that applies equally well to software design concepts.
- marcosdumay 11y ago> Although, does the python rule "There should be one-- and preferably only one --obvious way to do it." contradict this one ? Nope, that's a design guideline, it's not taking choice away. A rule like "Python is the only language you'd ever need" would contradict it.
- spiralpolitik 11y agoI think you'll find your answer to the Rob Pike question by using The 'Go' Programming Language
- nkassis 11y ago"Although, does the python rule "There should be one-- and preferably only one --obvious way to do it." contradict this one ?" I don't think so. To me Python's design rule implies there should be one way clear path to solve a specific problem and generally you'd also want to stay as consistent as possible with other similar solutions. The "one true way" argument is to force everything to fall into a pattern even when it's a less than ideal way to solve a problem. An example would be trying to force everyone to use the same language/database/framework combination in a company for everything. Sometimes you want to be flexible and use the right tools for the job (while also accounting for the cost of deviating from the general accepted standard in making that decision).
- mseepgood 11y ago> I wonder what rob pike has to say about OOP https://talks.golang.org/2012/splash.slide#55 https://talks.golang.org/2012/splash.slide#55 https://talks.golang.org/2012/splash.slide#56 https://talks.golang.org/2012/splash.slide#56 https://talks.golang.org/2012/splash.slide#57 https://talks.golang.org/2012/splash.slide#57 From this talk: http://www.infoq.com/presentations/Go-Google http://www.infoq.com/presentations/Go-Google