Live data from Hacker News

I finally understand why I'm not allowed to use Lisp

groups.google.com

111–120 of 121 posts

Re: I finally understand why I'm not allowed to use Lisp

#111
post #75

I think the problem of Lisp is, that it's very powerful and very dynamic. As long you're working alone, that's not that much of an issue, but with more developers you need to add more security nets, without the aid of a powerful type system. Most people love dynamic typing, because they hate the static typing of languages like C++ or Java. Powerful languages also need a powerful type system, that the developer can fu…

The more fundamental reason, I believe, is that it is often hard to just hack something together in Lisp. This mostly due to the library issues and a lack of users creating good documentation and guides.

For example, a few weeks ago I wanted to start writing a program that analyzed some spreadsheet files, spit back out some relevant information (including graphs), and then served this information up on some specified port. I initially wanted to write this program in Lisp so I began to look at available libraries. For the gui component, my first pick was Qt, for which Lisp actually has bindings. I spent about a week trying to get all the dependencies for it installed unsuccessfully. The documentation essentially says, "You need all these installed," and then gives you a bunch of links to their respective websites. All of the other details were missing.

Specifically, I could not install the smoke bindings for Qt. I searched for any guides or documentation and always found a git/svn repository. Once I had the files, I had no idea what to do with them; where they needed to go or how to compile them, etc. Raw .cpp and .h files that have dependencies do nothing in isolation. Furthermore, there was no support forum or any other place to ask for help.

Finally, I just gave up. It was too much work to just hack together what was supposed to be a fun weekend project. So I moved onto Python, which just worked. I'm sure I'm not the only one who has had such frustration.

Re: I finally understand why I'm not allowed to use Lisp

#112
post #46

I learned something a long time ago. It's far, far easier to dismiss others' code as "complex", "unmaintainable", or "clever" than it is to try and understand the code well enough to figure out whether that code was written that way for a valid reason. It's true whether you're new and approaching a codebase for the first time or whether you're reviewing someone else's code. And no, I'm not saying that it's ok for cod…

Here's one rule-of-thumb that just occurred to me. If there is "prior art" for code, the onus is on the person reading the code to show that it is "complex", "unmaintainable", or "clever." If there is no prior art for code, the onus is on the person writing the code to show that it is "simple," "maintainable," and "straightforward." Taking parser combinators as an example, if you write some code with parser combinato…

I think you might be overgeneralizing just a little. I'm mostly talking about how you approach an existing codebase. When I'm new to a project, I have to fight the urge to call it overly complex because I know that it's easier to dismiss code than to understand it. The people who created the project put work into it and deserve effort to understand it. This is something I learned quite quickly as a programmer (I mean, the project maintainers will usually be more than happy to tell you that).

A more recent realization is that this goes both ways. If someone submits code to my project, I owe them the same thing: an honest attempt to understand their code even though it's easier to label it overly complex and go watch House.

It sounds like you're thinking more in terms of how you market a new project, which is a different problem that I'm far from being qualified to solve.

Re: I finally understand why I'm not allowed to use Lisp

#113
post #75

I think the problem of Lisp is, that it's very powerful and very dynamic. As long you're working alone, that's not that much of an issue, but with more developers you need to add more security nets, without the aid of a powerful type system. Most people love dynamic typing, because they hate the static typing of languages like C++ or Java. Powerful languages also need a powerful type system, that the developer can fu…

The more fundamental reason, I believe, is that it is often hard to just hack something together in Lisp. This mostly due to the library issues and a lack of users creating good documentation and guides. For example, a few weeks ago I wanted to start writing a program that analyzed some spreadsheet files, spit back out some relevant information (including graphs), and then served this information up on some specified…

Did you try using Quicklisp?

Also, I would recommend that when you have problems like these you come ask about them on #lisp and #quicklisp on freenode.

There are many very helpful and knowledgeable people there. Often, they're the authors and maintainers of the very tools you're trying to use.

Re: I finally understand why I'm not allowed to use Lisp

#114
post #113

Earlier quoted context omitted.

The more fundamental reason, I believe, is that it is often hard to just hack something together in Lisp. This mostly due to the library issues and a lack of users creating good documentation and guides. For example, a few weeks ago I wanted to start writing a program that analyzed some spreadsheet files, spit back out some relevant information (including graphs), and then served this information up on some specified…

Did you try using Quicklisp? Also, I would recommend that when you have problems like these you come ask about them on #lisp and #quicklisp on freenode. There are many very helpful and knowledgeable people there. Often, they're the authors and maintainers of the very tools you're trying to use.

I didn't even know it existed. Thanks for the tip; I'll check it out.

Re: I finally understand why I'm not allowed to use Lisp

#115
post #96

Earlier quoted context omitted.

Your response assumes that clever code exists to save time writing programs, and that for any problem there are a wide range of equally good solutions possible from "takes a long time to write but is easily readable and maintainable" to "quick to write but impossible to read and maintain by those who don't have doctorates in functional programming idioms." I don't dispute the existence of code that is unnecessarily c…

I can agree with that. I'd add that if something seems clever you might want to make sure others on your team are aware of it too. At least that way you won't get blamed for being too clever, and more people will understand what's going on.

    // Here be gryphons and scabrous wyrms

Re: I finally understand why I'm not allowed to use Lisp

#116

Earlier quoted context omitted.

Your response assumes that clever code exists to save time writing programs, and that for any problem there are a wide range of equally good solutions possible from "takes a long time to write but is easily readable and maintainable" to "quick to write but impossible to read and maintain by those who don't have doctorates in functional programming idioms." I don't dispute the existence of code that is unnecessarily c…

I suggest that sometimes what appears to be "clever" for a given audience is in actuality the local optimum. Attempting to optimize it for readability without further study will worsen the code in some way, such as conflating concerns that have been carefully separated or introducing dependencies. If "clever" is often necessary to avoid things like conflating concerns or introducing dependencies , I think this points…

If "clever" is often necessary to avoid things like conflating concerns or introducing dependencies, I think this points us in the direction we need to take in improving programming languages.

I agree!!!! As a rough rule of thumb, "horizontal" or "general purpose" libraries are a potential source of inspiration for language improvements.

In my own case, I think #andand is a terrible kludge. But if I were designing a new programming language, one question I would ask myself is, "How do I make this go away?"

I might add support for monads, Or maybe I would decide that null is a bad idea. I don't know, but I would certainly give it some thought.

Re: I finally understand why I'm not allowed to use Lisp

#117
post #93

Earlier quoted context omitted.

I'm not sure where managers come into the discussion, but the second example is good, but even better like this: arr.sum()

In what language are arrays of numbers their own class?

That would be legal in C# 3.5 or later.

Though technically it's not that "array of numbers" is a class, but that array of T implements the interface IEnumerable, and Sum() is extension method defined for IEnumerable

It's even in the standard libs, you don't have to build it. Documentation is here: http://msdn.microsoft.com/en-us/library/system.linq.enumerab...

Re: I finally understand why I'm not allowed to use Lisp

#118

This reminds me of PG's essay on Java, in which he wrote "Java's designers were consciously designing a product for people not as smart as them.". Ben says that smart people should also work with these languages because non-smart people might have to work with the code. I think that is actually what happens a lot in the industry. Smart people who know Lisp, Ruby, Python, etc. still end up coding in Java because that'…

I take the point about "Java's designers were consciously designing a product for people not as smart as them."

But, consider the reverse - The C++ spec always seemed to as if the language designers were showing off - competing to add fatures that showed off how clever they were, without as much regard for the readability and maintainablity of the resulting code in the language. I don't think that strategy is optimal either.

Also, if you think only simple code can be done in C#, have a look at the Rx framework. C# as a language is suffering from a bit of bloat too, but not as bad as C++.

Re: I finally understand why I'm not allowed to use Lisp

#119

Earlier quoted context omitted.

In what language are arrays of numbers their own class?

That would be legal in C# 3.5 or later. Though technically it's not that "array of numbers" is a class, but that array of T implements the interface IEnumerable , and Sum() is extension method defined for IEnumerable It's even in the standard libs, you don't have to build it. Documentation is here: http://msdn.microsoft.com/en-us/library/system.linq.enumerab...

It looks like there's two directions for a language's type system to go:

1) strict typing, but with lots of constructs (e.g. inheritance, interfaces, generics, extension methods) to work around that strictness so that you can do what you want, if you understand the rules and syntax to get it to compile.

2) loose, "duck typing" so you just do what you want, but without compiler checking that it's possible, and with the posibility that it fails at runtime if the right method isn't found.

C# is in the first direction.

Re: I finally understand why I'm not allowed to use Lisp

#120

Earlier quoted context omitted.

> The ideal would be a dynamic language with optional static typing but I have yet to see a language like that. That would be Common Lisp.

That would be Common Lisp. There was such a version of Smalltalk called Strongtalk, but it never got a community behind it.

Actually - "but then the Java phenomenon happened and we eventually had to switch to Java before ever releasing it".

http://www.strongtalk.org/history.html

Post reply on HN