Live data from Hacker News

The Unix Philosophy

catb.org

191–200 of 269 posts

Re: The Unix Philosophy

#191
post #13

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 ce…

>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/ ) 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. H…

When 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.

Re: The Unix Philosophy

#192

The Unix Hater's Handbook ( https://en.wikipedia.org/wiki/The_Unix-Haters_Handbook ) has a few sections on of some of the ills of the Unix philosophy.

The UNIX Haters Handbook shows its age, it's criticizing a system that has only a passing similarity with modern unixes.

But yes, it's funny.

Re: The Unix Philosophy

#193
post #76
post #4

Earlier quoted context omitted.

That's really bizarre. A person's political views have no bearing on the validity or usefulness of what they write.

When they constantly mix technology and politics, yes it does matter. Open Source is a political movement, and that requires taking ESR's version of it with a grain of salt.

Open Source is not a political movement; you're thinking of Free Software.

Re: The Unix Philosophy

#194

Earlier quoted context omitted.

Python only lets you have one line in a lambda - the return line. In languages with nicer anonymous function support I can make an anonymous function span multiple lines and branches eg. in C# you could assign to a delegate something like myObj.stringToHash = (s) => {int x = 0; foreach(var c in s) x += ... ; return x;} I find python's restriction in this case fairly strange. If I wanted to do that in python I'd have…

Functions can be defined in a nested way setting up closures. It isn't that different from what you wrote to do: def some_method(...): avar = aval .... (some code) def throwaway(x, y): .... something_else(avar, x+y) some_obj.somefunc = throwaway The major difference is you do the function definition just prior to the assignment. The "namespace pollution" is literally limited to the scope of "some_method", so you have…

That's what I meant. Defining the throwaway function directly before the assignment is a good compromise at least.

Re: The Unix Philosophy

#195

Earlier quoted context omitted.

The Gang of Four book recommends "composition over extension" which fits neatly into the UNIX philosophy of building things by composed of smaller independent programs. The main issue that most of the common programming languages in use notably Java and C++ have very poor support for composition thus forcing developers to have to extend things.

Can you explain how exactly Java and C++ have poor support for composition? Classes can have member variables in both languages. What else is there?

Example: How in Java do you add a method to the String class so that all instances of String gain the method without extending String and introducing a new subtype ?

It cannot be done. As an example see Categories in Objective-C.

Java's support for composition has improved somewhat with default methods on interfaces in Java 8 but it's still poor compared to the above languages. This leads to the "abundance of classes" anti-pattern you see with Java projects as you are forced to extend to introduce new functionality.

Re: The Unix Philosophy

#196
post #189

Earlier quoted context omitted.

Because guns scare people. Why do they scare people? Because mostly they're just seen either in the hands of cops, grunts, or criminals. Most folks (especially here) aren't hunters, or are so far removed from rural life that they have no experience of firearm-as-tool. On top of that, there is big business in demonizing guns--related to the big business (I suspect) in demonizing fighting, aggression, machismo, indepen…

Private gun ownership isn't a safeguard against "if things get too bad". It's also unrealistic and implausible to imagine that the .gov and .mil are going to make "things get too bad". That is no more likely to happen than a return to some sort of monarchy or crowning of an American king/queen.

Private gun ownership isn't a safeguard against "if things get too bad".

Really? Because it caused us a lot of trouble during our occupations in Iraq and Afghanistan. If anything, that pretty much proves it as a check on US doctrine.

It's also unrealistic and implausible to imagine that the .gov and .mil are going to make "things get too bad".

Fifteen years ago, even in the wake of Ruby Ridge and Waco, I might've been tempted to agree with you. Unfortunately, there's been a whole lot of history since then, yeah?

return to some sort of monarchy

What are your betting odds on Bush III, or Clinton II, again? Your countrymen are apathetic and easily-manipulated when it comes to politics.

Re: The Unix Philosophy

#197

Earlier quoted context omitted.

I don't think jumblesale is arguing that his writings are incorrect or not useful, just that he doesn't like popularizing his works because of the authors political views.

It's still a shame. I certainly don't feel like I have to love everything a person does in order to learn something from them, or even respect some of their work. Likewise, I don't require everyone to agree with my personal opinions in order to pass my courses. Things would really become cumbersome were I to ever change my mind about something.

I agree. Seriously, who gives a toss about what anyone's opinions are on subjects unrelated to what you're reading by them? And even if they do creep in, what's to say you're right or they're wrong? I thought this was part of being an adult but I see it all too often: "so-and-so wrote an excellent technical manual on X but he's right wing so I won't buy it!"

I don't understand that way of thinking since no human being will ever 100% agree with any other on everything.

Re: The Unix Philosophy

#198
post #101
post #96

Earlier quoted context omitted.

> in some cases, this philosophy has resulted in the "tangled mess held together by duct tape" kind of systems architecture that no one dares to touch for fear of breaking things. Pretty much, just as Booch's philosophy has given us tangled messes of class hierarchies with cross references pointed every which way. And just as The Gang of Four gave us AbstractedTangleMessFactorySingleton. The distinction with the Unix…

Additionally, it's not a religion. Every programmer should be exposed to Unix style programming just like every programmer should be exposed to functional programming. 100% purity in either case is just creating unnecessary problems.

I think in terms of declarations, steps, procedures, methods, objects and a clear, logical program flow.

Re: The Unix Philosophy

#199
post #189

Earlier quoted context omitted.

Private gun ownership isn't a safeguard against "if things get too bad". It's also unrealistic and implausible to imagine that the .gov and .mil are going to make "things get too bad". That is no more likely to happen than a return to some sort of monarchy or crowning of an American king/queen.

Private gun ownership isn't a safeguard against "if things get too bad". Really? Because it caused us a lot of trouble during our occupations in Iraq and Afghanistan. If anything, that pretty much proves it as a check on US doctrine. It's also unrealistic and implausible to imagine that the .gov and .mil are going to make "things get too bad". Fifteen years ago, even in the wake of Ruby Ridge and Waco, I might've bee…

It doesn't make sense to me to compare the military occupation of those countries with the paranoid proposal that things "could get too bad" in the U.S. Too much seems too different about those two to be meaningful; I could point to the strict gun laws in most of the western nations and ask, "why haven't they degenerated into `could get too bad'?"

About the "whole lot of history since Ruby Ridge and Waco," well, I don't see any specific pattern of things getting "too bad". I'm not seeing the history you apparently are.

About the 2016 presidential election, couple of things: the presidency's just a job, and a short-term one at that, and the president doesn't have much power. Presidents run the country, they don't rule it.

Re: The Unix Philosophy

#200
post #96

Earlier quoted context omitted.

> in some cases, this philosophy has resulted in the "tangled mess held together by duct tape" kind of systems architecture that no one dares to touch for fear of breaking things. Pretty much, just as Booch's philosophy has given us tangled messes of class hierarchies with cross references pointed every which way. And just as The Gang of Four gave us AbstractedTangleMessFactorySingleton. The distinction with the Unix…

Absolutely, but that doesn't mean we shouldn't try to make some progress. I think we have actually made progress with HTTP and all the REST. But I feel that the great failure of distributed object systems in the 1990s and 2000s has left a great void when it comes to new thinking about more fine grained sort of interfaces between programs. Functional programming has influenced so many things but hasn't really arrived…

REST is a kludge but it's easy. SOAP as much as I dislike giving Microsoft credit was brilliant, but it was hard.
Post reply on HN