Live data from Hacker News

Programming languages, operating systems, despair and anger

xent.com

51–59 of 59 posts

Re: Programming languages, operating systems, despair and anger

#51
post #36
post #11

Earlier quoted context omitted.

> what seems to be the most natural way to do something is how it is actually done I love Python too, but it's not without its quirks. Eg: ','.join(mylist) Which nearly everyone I know at first assumed would be: list.join(',') Nobody thinks of what's being done here 'take a dot, and use it to join this list'. They think of 'take this list, and join it into a string using dot'.

i like that because it's a string's method returning a string.

Methods aren't defined by what they return. I have a host method (a property, to be precise) that returns a location of the host. It wouldn't make sense for it to return another host object.

string methods are things you do to strings.

list methods are things you do to list.

Most people think of taking a list, and gluing it with a string, not taking a string, and using it as glue for a list.

Re: Programming languages, operating systems, despair and anger

#52
post #48

We can all agree that current programming languages have a lot of warts, but then he gets to his list of BARE MINIMUM features a language must have and the rant takes a hard left into Crazytown. Social networks and to-do lists as first-class, language-level features — not even a social network standard library, but a whole subset of the language dedicated to social networks and to-do lists. It sounds like what he wan…

I do most of my work in infrastructure, and I'd find first class objects for IPs, networks, and humans useful.

Re: Programming languages, operating systems, despair and anger

#53
post #52
post #48

We can all agree that current programming languages have a lot of warts, but then he gets to his list of BARE MINIMUM features a language must have and the rant takes a hard left into Crazytown. Social networks and to-do lists as first-class, language-level features — not even a social network standard library, but a whole subset of the language dedicated to social networks and to-do lists. It sounds like what he wan…

I do most of my work in infrastructure, and I'd find first class objects for IPs, networks, and humans useful.

What advantages would first class IPs, networks, & humans bring over the ability to make first class objects for anything?

Re: Programming languages, operating systems, despair and anger

#54
post #16

Earlier quoted context omitted.

Please don't say that "languages are tools". While this is technically right, our thoughts are so dependent on programming languages that they can't be considered "mere" tools. Considering they are make us wrap languages around their implementations, rather than around their users.

I can understand your point, but I came to the conclusion (after 20+ languages) that thinking in just one language can be quite harmful to find a good solution for a problem. Actually PG puts it really nicely [1]: "The right way to solve that problem, I think, is to separate the meaning of a program from the implementation details." "What program would one like to write? Whatever is least work. Except not quite: what…

Sure. But the gist of the rant is that he keeps doing the same repetitive, mundane tasks over and over again, merely to shuffle data from one part of the system to another and convert between representations on the way.

Like when you have a database, a server application and an AJAX web page, you may have four to five different representations of the same data (DB table, server language object, JSON, Javascript object and finally HTML) and need a whole bunch of code just to move data from A to B and convert between representations.

It's not just a language problem. It's just as much a problem of impedance mismatch between different systems, protocols and data formats. Various frameworks attempt to reduce the tediousness, but tend to come with issues of their own.

PG has something on this too:

"Of course the ultimate in brevity is to have the program already written for you, and merely to call it. And this brings us to what I think will be an increasingly important feature of programming languages: library functions."

"I think a lot of the advances that happen in programming languages in the next fifty years will have to do with library functions. I think future programming languages will have libraries that are as carefully designed as the core language."

http://www.paulgraham.com/popular.html

Whether the common case is made simple by the language, libraries, frameworks or standardization (we may need all of them) ultimately does not matter much to the developer, only that you can handle conceptually trivial everyday tasks with the minimum of fuss.

We have a long way to go before this becomes a reality.

Re: Programming languages, operating systems, despair and anger

#55
post #52

Earlier quoted context omitted.

I do most of my work in infrastructure, and I'd find first class objects for IPs, networks, and humans useful.

What advantages would first class IPs, networks, & humans bring over the ability to make first class objects for anything?

Standards. I can get a random module and know it expects these objects to have the same properties and methods I do.

Re: Programming languages, operating systems, despair and anger

#56

Earlier quoted context omitted.

Wishful thinking? A lot of what he suggests have straightforward implementations as "built-in" features. (Something that looks "built-in" anyhow.) Perl tried to be pretty much the language he suggests, but it was put together with a poor sense of language design. Ruby tried to correct Perl's mistakes, but also succumbed to the "kitchen sink" mentality. Python tried to correct many earlier mistakes, but while it was m…

http://www.skepdic.com/wishfulthinking.html The premise as I understand it is that modern languages are broken and have failed to evolve. An interesting point. A good start for an argument. However, his rant devolves into: " REAL WORLD , modern datatypes, built-in, literal, batteries-included PLEASE!!! If the following aren't first-class types with first-class literal constructors / representations supported at the l…

I think his point is that most language designers seem concerned about abstruse things and seem less concerned about his everyday problems. Someone's got to be concerned about his everyday problems to do the best possible job of designing a language to make his life easier.

Re: Programming languages, operating systems, despair and anger

#57
post #55

Earlier quoted context omitted.

What advantages would first class IPs, networks, & humans bring over the ability to make first class objects for anything?

Standards. I can get a random module and know it expects these objects to have the same properties and methods I do.

That would work just as well if they were part of the standard library, wouldn't it?

Re: Programming languages, operating systems, despair and anger

#58
post #32

Earlier quoted context omitted.

It's a convenience so that every iterable object in the world doesn't need to implement a join() method. I pass generator expressions to join as often as lists, so it works out well that the method is on the string rather than the list.

> It's a convenience so that every iterable object in the world doesn't need to implement a join() method. The way to do this would be to have an IterableMixin that implements join() (and a load of other stuff) so long as the subclass implements a small number of basic methods.

Sure, but is it up to the programmer to "subclass" or somehow specify that his type implements IterableMixin? Or is it up to the python interpreter to realise that it implements certain functions and automatically do this?

Re: Programming languages, operating systems, despair and anger

#59
post #51
post #36

Earlier quoted context omitted.

i like that because it's a string's method returning a string.

Methods aren't defined by what they return. I have a host method (a property, to be precise) that returns a location of the host. It wouldn't make sense for it to return another host object. string methods are things you do to strings. list methods are things you do to list. Most people think of taking a list, and gluing it with a string, not taking a string, and using it as glue for a list.

good points. I was pointing out mostly a subjective 'beauty'.

just of note, the architect in me would go for 'why not have both?'

Post reply on HN