Live data from Hacker News

The Unix Philosophy

catb.org

221–230 of 269 posts

Re: The Unix Philosophy

#222

Earlier quoted context omitted.

Python'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.

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`...)

Re: The Unix Philosophy

#223
post #101

Earlier quoted context omitted.

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.

Which is good if you're programming in an object-oriented imperative language that has a defined program flow. But while that style is the most popular, applying the same concepts to anything that isn't imperative OO will result in unfathomable suffering.

When in Rome, code as the Romans do.

Re: The Unix Philosophy

#224
post #97

Earlier quoted context omitted.

Maintaining IPC/RPC as text has the significant advantage of keeping the programs involved honest, approachable, and easier to debug. Just being able to see the interface by running the program (or reading the config file) makes it a lot easier to learn[1], and bugs in text formats can often be seen visually (or marked in an editor). The alternative - binary structures - require complex data definitions where you hav…

"Text" in a computer is bytes + metadata about those bytes. Without that metadata, it's just bytes. Exactly that is what unix pipes are: a streams of bytes, not streams of text. Ironically, the tools that are happiest about these streams are of course those tools that don't care about text but just stream bytes. The pain occurs when the tools actually need to parse the text. I would agree much more with the unix desi…

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.

Re: The Unix Philosophy

#225
post #100

Earlier quoted context omitted.

I would love to throw those quote at any programming class that promotes OOP.

They're only relevant for Simula-like class-based OO. Message passing OO is actually a good and criminally underrated paradigm.

Message passing as in argv ? that's at a very high level, that's not really underrated nor so life changing.

Re: The Unix Philosophy

#226

I keep wondering about what seems to be the most important component of Unix philosophy: write many small programs that do one thing well and interface using text streams! Yes, modularity is important. However, 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. I think Unix philosophy is stru…

For a while, Linux mostly had the philosophy that your software should come with a text interface, optionally a GUI, and a C library. That library part is for solving the messes created by tangled text interfaces. But nowadays lots of things only come for the GUI.

A lot of those are actually just task specific business logic style applications in scripting languages (often python, sometimes perl, etc).

In this case the 'library' is often the base programming language it's self, as the shipped parts are entirely glue and configuration.

Re: The Unix Philosophy

#227
post #11

Earlier quoted context omitted.

Among other unpopular opinions, ESR denies AGW, believes that race and IQ are correlated, and was strongly in favor of the Iraq war.

None of these seem even remotely relevant to engineering. Moreover, research, discovery and innovation requires letting people having freedom to think. That includes holding unpopular, controversial or politically incorrect opinions. We are so worried about Evil Government dictating what we can and cannot think that we haven't noticed the current organic trend to prosecute every other person for thoughtcrimes. It's n…

> None of these seem even remotely relevant to engineering.

Believing things that have no scientific merit in favour of things that have plenty of scientific evidence would be a huge concern in an engineer.

Given is (mostly memory-holed) mysogyny, racism, and homophobia that leads him to discard the views of people in a most un-meritocratic fashion and I think you have another concern.

Re: The Unix Philosophy

#228

Earlier quoted context omitted.

At my old job (which I left about ten days ago) I ran X servers and clients on different machines daily. Typical example was running my IDE on my desktop, connected to an X server running on my laptop.

The X developers didn't break remoting, but that doesn't mean contemporary gui toolkits still use the features of X that made X "network transparent." As I understand it, most features of the protocol are largely ignored except for the parts needed to pump bitmaps over a network. Here's an LCA talk by a dude what works on X and Wayland: https://www.youtube.com/watch?v=RIctzAQOe44

The main reason, as best i can tell, is that every DE out employ OpenGL compositing that effectively bypass X.

Meaning that to draw the desktop they effectively pain a single large window inside X that is then filled with the output of the GPU.

Thing is that Wayland seems more comparable to svgalib than X. This in that Wayland pretty much a lib/protocol for talking to the graphics hardware. Something else, be it their reference implementation Weston, GTK, Qt, or some other alternative, has to handle the handling of windows, desktops etc.

Right now you can use Wayland as a driver for Xorg.

Re: The Unix Philosophy

#229

Earlier quoted context omitted.

> This is just a dressed up ad hominem No, it's explicitly and purposefully ad-hominem, suggesting that a person's lack of judgement in one area leads to questions about his judgement in a related one.

Actually, it's not ad hominem at all. Ad homimen would be "people named Eric cannot be trusted". This is calling into question ESR's general credibility, based on his record. That's a character judgement . I'm also not saying ESR is wrong in all things -- a consistently wrong indicator is useful (read the opposite of what it says). An inconsistently wrong one is maddening: you've got to pay close attention to what it…

Ad hominem is where you discount an argument based on the person making it. I'm not sure where the name thing is meant to come in to it.

Re: The Unix Philosophy

#230
post #209

Earlier quoted context omitted.

What other countries are doing/not doing is a red herring--their people are not ours, their demographics are certainly not ours, their pain points are not our pain points. They additionally don't have the same political foundations and history that we do. We have seen a continual increase in the militarization of police, the surveillance and fining of private citizens, the violation of privacy, and the bullying and e…

"What other countries are doing/not doing is a red herring" ..... but you brought up Iraq and Afghanistan. I agree about the bullying and exploitation of the poor, I just don't think that's anything new. I think what's new is that now, techie types like you and me are learning about the police-based murders of black people, and how hard life is for the poor. That stuff's always been going on, it just didn't make it o…

but you brought up Iraq and Afghanistan.

Note that example was done specifically as a study of armed irregulars vs the US--your examples of other Western states were in a very different vein. :)

Post reply on HN