Live data from Hacker News

The Unix Philosophy

catb.org

251–260 of 269 posts

Re: The Unix Philosophy

#251

Earlier quoted context omitted.

> And just as The Gang of Four gave us AbstractedTangleMessFactorySingleton. The Gang of Four didn't give us that. An army of OOP novices who were overwhelmed by all of the new choices and only skimmed Design Patterns gave us that. If you actually read the book (which surprisingly few people have, given the number of people who have strong opinions about it), you'll see the Gang of Four are actually quite clear on th…

They did, though, kind of. The GUI-oriented 90's vibe, meaning zero examples that anybody would ever bother learning. The bizarre stuff nobody ever uses (Flyweight? Bridge?). Singleton -- 'nuff said. You're left with what, maybe three usable patterns? Factory, which favors opaque, magical return-type polymorphism. Visitor, which is a solution in search of a problem, and also gets confused with trivial tree-walking op…

> The GUI-oriented 90's vibe, meaning zero examples that anybody would ever bother learning.

It was written in the 90's. GUIs were what application developers did back then. Web apps didn't exist yet.

> The bizarre stuff nobody ever uses (Flyweight? Bridge?).

If you've used enums in Java or instanced rendering in a game, you're effectively using Flyweight.

> Singleton -- 'nuff said.

They caution really hard against overuse of Singleton in the book, but all of those C programmers being dragged into OOP didn't know where else to stuff all their global state so they went to town on it.

> Factory, which favors opaque, magical return-type polymorphism.

If your language doesn't have first-class classes, Factory is really handy. If it does have first-class classes, well that means you basically have the Factory pattern in your language. :)

> Visitor, which is a solution in search of a problem

The day you write a compiler in an OOP language is the day you realize how unbelievably, amazingly, incredibly useful Visitor is.

Re: The Unix Philosophy

#252

Earlier quoted context omitted.

> And just as The Gang of Four gave us AbstractedTangleMessFactorySingleton. The Gang of Four didn't give us that. An army of OOP novices who were overwhelmed by all of the new choices and only skimmed Design Patterns gave us that. If you actually read the book (which surprisingly few people have, given the number of people who have strong opinions about it), you'll see the Gang of Four are actually quite clear on th…

They did, though, kind of. The GUI-oriented 90's vibe, meaning zero examples that anybody would ever bother learning. The bizarre stuff nobody ever uses (Flyweight? Bridge?). Singleton -- 'nuff said. You're left with what, maybe three usable patterns? Factory, which favors opaque, magical return-type polymorphism. Visitor, which is a solution in search of a problem, and also gets confused with trivial tree-walking op…

There's no good idea you can't turn into a bad idea if you just do it hard enough.

Re: The Unix Philosophy

#253

Earlier quoted context omitted.

I guess everyone and every group finds certain truths uncomfortable. It's especially sad that the theory of evolution seems to make literally everyone uncomfortable. "Of course humans and chimps have a common ancestor! We have looked at the genetic code, and found that more than 95% is shared. Give up, it's over." The right will hate you for saying that. "Of course there is inherited variation in intelligence, no mat…

Flynn Effect gets you 20-30 points in the same gene pool, therefore via non-genetic factors. If you see a 15 point difference and immediately attribute it to genetics, you're making an unwarranted assumption.

[deleted]

Re: The Unix Philosophy

#254

Earlier quoted context omitted.

Regarding [2]. So I guess this quote is the problem: > And the part that, if you are a decent human being and not a racist bigot, you have been dreading: American blacks average a standard deviation lower in IQ than American whites at about 85. [...] And yes, it’s genetic; g seems to be about 85% heritable, and recent studies of effects like regression towards the mean suggest strongly that most of the heritability i…

I guess everyone and every group finds certain truths uncomfortable. It's especially sad that the theory of evolution seems to make literally everyone uncomfortable. "Of course humans and chimps have a common ancestor! We have looked at the genetic code, and found that more than 95% is shared. Give up, it's over." The right will hate you for saying that. "Of course there is inherited variation in intelligence, no mat…

Re your deleted comment:

> I guess everyone and every group finds certain truths uncomfortable. It's especially sad that the theory of evolution seems to make literally everyone uncomfortable.

In context, this is a claim that race and IQ is a consequence of the theory of evolution. If you don't see this, then you don't understand communication with humans, or are being disingenuous.

Re: The Unix Philosophy

#255
post #222

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…

Well, if you need multiple lines, you probably don't need your function to be anonymous. (Your example is just `sum`...)

I've needed it many times in the past where the function I'm assigning can't be done as a one-liner like that.

Re: The Unix Philosophy

#256

Earlier quoted context omitted.

ESR's views particularly on guns, libertarian economics and politics, and AGW, all present pretty standard cases of assuming a frame and fitting all data to that frame. Chopping, discarding, and/or fabricating data as necessary to do so. That actually directly calls into question engineering validity, as solid engineering is solidly based in reality and a realistic interpretation of facts. Also the ability to discard…

That's like saying DEKs belief in the supernatural calls into question TAOCP, totally irrelevant

Sorry, but DEK?

Re: The Unix Philosophy

#257
post #243
post #224

Earlier quoted context omitted.

see locale(1) and locale(7) This is why you the predefined character classes in regular expressions. For example, setting LC_CTYPE changes the meaning of '[[:alpha:]]' and sort(1) respects LC_COLLATE. A lot of work has already been done to solve these problems.

> A lot of work has already been done to solve these problems. Not nearly enough. You write a script which expects a 'file' at some place, but it will break in french locale because 'file' will be replaced with something like 'fichier'. Sure, you can run under C locale, but then some other script, written for french locale will break. Not to mention date formatting, number formatting, etc. In comparison, binary or XM…

(apologies for the late reply)

You really shouldn't ever run under the C locale unless your need to support older (pre-locale/unicode) software or data of the same vintage. Doing so defeats the entire purpose.

You're confusing issues here: locale support lets you parse text. Your "file" example is not relevant, and would be part of something like gettext(3). Yes, gettext can be configured from the locale, but that is a separate feature from what I was talking about.

The locale support is how you automatically handle lexing the input stream, which is why I brought up the character classes that, unfortunately, most people seem to ignore, resulting in broken text support.

If you properly support locales, you program will support the user with LC_ALL="fr_FR.utf8" typing their floats as 3,14 automatically.

The fact that your program expect a field name to be 'file' is unrelated, but is something the user could learn by 1) reading your man page, 2) reading your text output and copying it (if appropriate), or 3) reading your error messages that you should be generating when you see 'fichier="foo.txt"' when you were expecting 'file="foo.txt"'. Note: if you used [:alpha:] to lex the input, you would automatically be able to extract the incorrect word for your error message when a user in LC_CTYPE="jp_JP" enters 'ファイル="foo.txt"'.

I believe the problem here is related to a confusion of lexing with parsing. The various locale features solve the lexing problem, but you still have a parsing problem no matter the syntax of how the data is serialized. You have to check that /[[:alpha:]]+/ was 'file' not 'fichier' or 'ファイル', just the same as you would have to check the output of your XML parser that the tag was not or , just the same as you would have to check that a binary field was 0x0003 or whatever the flag value was.

You may be looking for a way to automatically discover the semantics (schema) that another program expect - and that would be a nice feature - but that is generally orthogonal to the syntax used for IPC. (must like how XML can be converted to YAML/JSON/BSON/etc). It is also a far more complicated feature, and I'm not sure it can ever really be solved (halting problem, possibly), but maybe a "good enough" solution could be created.

Re: The Unix Philosophy

#258

Earlier quoted context omitted.

I guess everyone and every group finds certain truths uncomfortable. It's especially sad that the theory of evolution seems to make literally everyone uncomfortable. "Of course humans and chimps have a common ancestor! We have looked at the genetic code, and found that more than 95% is shared. Give up, it's over." The right will hate you for saying that. "Of course there is inherited variation in intelligence, no mat…

Re your deleted comment: > I guess everyone and every group finds certain truths uncomfortable. It's especially sad that the theory of evolution seems to make literally everyone uncomfortable. In context, this is a claim that race and IQ is a consequence of the theory of evolution. If you don't see this, then you don't understand communication with humans, or are being disingenuous.

[deleted]

Re: The Unix Philosophy

#259
post #133

Earlier quoted context omitted.

Rob Pike doesn't know Smalltalk, Self, or Common Lisp/CLOS--why should you care what his opinions are concerning OO as a paradigm?

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

He's not a UNIX co-author at all, he joined Bell Labs in 1980.

Re: The Unix Philosophy

#260

Earlier quoted context omitted.

I guess everyone and every group finds certain truths uncomfortable. It's especially sad that the theory of evolution seems to make literally everyone uncomfortable. "Of course humans and chimps have a common ancestor! We have looked at the genetic code, and found that more than 95% is shared. Give up, it's over." The right will hate you for saying that. "Of course there is inherited variation in intelligence, no mat…

Flynn Effect gets you 20-30 points in the same gene pool, therefore via non-genetic factors. If you see a 15 point difference and immediately attribute it to genetics, you're making an unwarranted assumption.

[deleted]
Post reply on HN