News for hackers. Stuff that matters.
Re:The Land of Lisp by midgetjones on Friday October 06, 2017 @12:16PM (#15417949)
I've read this book, and what I love about it is that it really brings to mind the programming books of my youth, when nobody would argue that programming should be fun.

It's goofy, has bad jokes, and you learn something.

Having said that, the code style seemed quite idiomatic compared to some of the other Lisp I've seen (although I'm no expert), so I wasn't sure how valuable the lessons were.

Re:The Land of Lisp by baldfat on Friday October 06, 2017 @12:29PM (#15418055)
I really liked going through Realm of Racket with my 11 year old daughter. It pretty much is the same format. It made me miss the days of typing code from a book and hit run. (Well run never really worked then it was hours of debugging but that taught me so much)
Re:The Land of Lisp by perl4ever on Saturday October 07, 2017 @12:41AM (#15422304)
Re:The Land of Lisp by cujic9 on Friday October 06, 2017 @12:53PM (#15418276)
Ha yes! Bonus points when the book is for IBM Basic, and you're using a Commodore 64. Argggggg!
Re:The Land of Lisp by baldfat on Friday October 06, 2017 @01:28PM (#15418540)
I loved it when they didn't say what basic it was for. My dad ended up meeting a author of a few of the programs and he said, "Oh I never got that basic program to ever run." My dad was like my 9 year old fix it and walked away. He was proud and mad. It took me weeks to get things fixed.
Re:The Land of Lisp by ansible on Friday October 06, 2017 @02:20PM (#15419046)
Oh yes. I had a TRS-80 Color Computer, and the BASIC dialect (though written by MS) was slightly different in some details, so I was usually translating things at least a little. Things like color and graphics were completely different from system to system.
Re:The Land of Lisp by flavio81 on Friday October 06, 2017 @01:59PM (#15418836)
LOL. I had an Atari 130XE so examples for IBM Basic, Apple ][ and Commodore didn't work either!

Even worse if the examples were for the Spectrum, which had an even more peculiar dialect!

Re:The Land of Lisp by peatmoss on Friday October 06, 2017 @01:28PM (#15418541)
Childhood TRS-80 user here, can commiserate.
Re:The Land of Lisp by baldfat on Friday October 06, 2017 @01:53PM (#15418786)
I was a sol-20 kid
Re:The Land of Lisp by amake on Friday October 06, 2017 @12:27PM (#15418039)
> seemed quite idiomatic

I'm not sure how that would be a bad thing. Did you mean unidiomatic?

Re:The Land of Lisp by dwringer on Friday October 06, 2017 @01:10PM (#15418396)
A common complaint about Lisp code in general is that programmers tend to write code that is idiosyncratic [ED: I previously used the word "idiomatic" here in reply to the OP but was conflating terms, making this post rather irrelevant but at least it provoked a discussion] (i.e. rather than looking like templated design patterns with standard names, the program is heirarchically built of modules in a domain-specific language of the programmer's own design). This is both one of Lisp's greatest strengths to those who like it, and (I think, based on comments I've seen here and elsewhere) one of the greatest reasons it doesn't have more widespread adoption.
Re:The Land of Lisp by hellofunk on Friday October 06, 2017 @02:29PM (#15419135)
> rather than looking like templated design patterns

Speaking about another lisp, Clojure, it is a goal that each program finds its own design pattern. That's kinda the whole idea. Design patterns can really get in the way, unless your language requires them, which some languages do (i.e. Java where everything must be an object, so OO it is, or Apple's platforms where the MVC pattern is deeply interwoven into all the APIs).

Lisp in general is about exploring a particular problem using only the constraints of that problem, without concern for how different problems get solved. By contrast, design patterns are about forcing a common solution onto a range of different problems.

Re:The Land of Lisp by sbov on Friday October 06, 2017 @08:33PM (#15421529)
> By contrast, design patterns are about forcing a common solution onto a range of different problems.

I always viewed design patterns as providing a shared name for common solutions to common problems. And that forcing a common solution to a range of different problems was a misuse of them.

But maybe I'm wrong.

Re:The Land of Lisp by bitwize on Friday October 06, 2017 @09:27PM (#15421713)
I like to think of design patterns as "TV Tropes for programming". The GoF probably intended their book to be taken in that spirot. But then design patterns became something that computer science students and job candidates got quizzed on...
Re:The Land of Lisp by kbp on Friday October 06, 2017 @10:36PM (#15421954)
> I always viewed design patterns as providing a shared name for common solutions to common problems. And that forcing a common solution to a range of different problems was a misuse of them.

Exactly, a design pattern is just that: a pattern of design, that shows up organically after you have enough systems designed in the same language. Many of the design patterns that occur in languages like C++ and Java don't show up in Lisp because Lisp is a rather different language, but then we have our own design patterns as well, things like with- macros.

Re:The Land of Lisp by flavio81 on Friday October 06, 2017 @04:03PM (#15419944)
>By contrast, design patterns are about forcing a common solution onto a range of different problems.

This is one of the best criticisms of Design Patterns i've ever read. Great point.

Re:The Land of Lisp by felideon on Friday October 06, 2017 @02:19PM (#15419023)
I know what you are saying, but that is not what is meant by idiomatic Lisp. Not by Lispers at least.

Non-idiomatic Lisp is typically written by beginners whose code looks more like the language they are accustomed to using previously. For instance, leaning heavily on a procedural style. And not just beginners, but also seasoned programmers that write object oriented Lisp more akin to static OOP. In other words, designing class hierarchies rather than protocols (using generic functions).

What you describe is more of a side effect of the Bipolar Lisp Programmer[1]:

> This is a BBM attitude; it works for me and I understand it. It is also the product of not needing or wanting anybody else's help to do something.

I haven't read Land of Lisp yet, so I can't really comment as to whether I'd consider it idiomatic Lisp or not. (OP meant "idiosyncratic" anyway, it seems.) Not that I'd be a good judge, anyway.

[1] http://www.shenlanguage.org/lambdassociates/htdocs/blog/bipo...

Re:The Land of Lisp by sverige on Saturday October 07, 2017 @12:02AM (#15422218)
God, that link and the comic strip for the Land of Lisp are both so great! I might have to try Lisp again.

>Writing in C is like building a mosaic out of lentils using a tweezer and glue.

I cannot describe the memories and associated feelings this evokes....

Re:The Land of Lisp by mike_ivanov on Friday October 06, 2017 @01:30PM (#15418564)
"rather than looking like templated design patterns" - that is, the code goes straight to the point instead of being littered with incidental noise and ceremony? How that could possibly be a bad thing? Well, in certain software development subcultures ceremony might be a norm, but not in general.
Re:The Land of Lisp by Koshkin on Friday October 06, 2017 @02:20PM (#15419041)
From what I have seen, code that "goes straight to the point" is usually poorly thought out, is unmaintanable, has bugs, is difficult to extend to new use-cases, and the developer who wrote it is long gone.
Re:The Land of Lisp by TeMPOraL on Saturday October 07, 2017 @05:04AM (#15422993)
No, it's the opposite - it doesn't have to drag around pointless layers of unused abstractions, and all the bugs that are there are bugs of subject matter, not of surrounding boilerplate. Such code minimizes the surface area and degrees of freedom, hence not leaving space for bugs.

The more I program, the more I'm convinced that - unless you've coded identical software many times before - code needs to grow organically and stay as focused and close to the problem as possible. Abstractions should follow naturally and be done "just in time". If they're needed, they have to be written either way, and you're not saving time by writing them up front (focused code is easy to refactor).

Of course with experience, you learn that some patterns of change are likely to occur, or that some touches of abstractions here and there are very beneficial. But beyond that, I feel the best way is to write simplest code possible, wait for it to be needed elsewhere, and then DRY up semantics.

I liked the posts of Casey Muratori, which explain roughly this mindset, calling it "semantic compression" and "compression-oriented programming": https://mollyrocket.com/casey/stream_0019.html.

Re:The Land of Lisp by flavio81 on Saturday October 07, 2017 @11:35AM (#15424156)
You should expand this into an article or blog post!
Re:The Land of Lisp by TeMPOraL on Saturday October 07, 2017 @01:34PM (#15424721)
You know what? I might actually do just that; I just need to collect my thoughts and outline some examples.
Re:The Land of Lisp by hellofunk on Friday October 06, 2017 @02:31PM (#15419152)
That might be (perhaps) true in other languages, but that is not the point in Lisp.
Re:The Land of Lisp by Koshkin on Friday October 06, 2017 @03:04PM (#15419475)
Best practices, patterns, idioms are all important no matter what language. Lisp is not special in this regard (although, I admit, Lisp developers may stick around a bit longer).
Re:The Land of Lisp by flavio81 on Friday October 06, 2017 @04:05PM (#15419955)
>Lisp is not special in this regard

In reality, yes, at least because of two differences:

1. Lisp is a significantly more powerful language, compared to most non-Lisp languages. Thus, many patterns and practices that are needed in other languages, are simply not needed at all in Lisp, or become far simpler.

2. Lisp is a "programmable programming language" where code is a "first class citizen" and can be manipulated as well as any other kind of data such as numbers. This opens a very different approach to programming, with its own, different "best practices".

Re:The Land of Lisp by TeMPOraL on Saturday October 07, 2017 @05:06AM (#15422997)
Best practices, patterns and idioms are all tools, not religious symbols. If you treat them as the latter, you end up with things like JavaScript one-line projects that have 1kb worth of grunt/gulp/webpack config files, or with HelloWorldFactoryLightweightBridgeBuilderAbstractFacade in Java.
Re:The Land of Lisp by hellofunk on Friday October 06, 2017 @03:23PM (#15419632)
There is a big difference between language idioms and design patterns.
Re:The Land of Lisp by midgetjones on Friday October 06, 2017 @01:39PM (#15418657)
I did, of course, mean idiosyncratic. My bad
Re:The Land of Lisp by dwringer on Friday October 06, 2017 @02:38PM (#15419224)
I fully conflated both words as well in my reply, don't feel too bad :)
Re:The Land of Lisp by eradicatethots on Friday October 06, 2017 @04:16PM (#15420056)
Of course
Re:The Land of Lisp by catpolice on Friday October 06, 2017 @12:37PM (#15418133)
Perhaps they meant "idiosyncratic"
Re:The Land of Lisp by omaranto on Friday October 06, 2017 @12:46PM (#15418209)
Maybe "idiomatic" is considered bad because it would mean the lessons are Lisp-specific and you might hope the book teaches you programming in general?
Re:The Land of Lisp by uryga on Friday October 06, 2017 @01:59PM (#15418844)
did you mean "idiosyncratic"?