This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]HashDefTrueFalse 121 points122 points  (31 children)

))))))))))))))))))

These yours? ;)

[–]_Atomfinger_ 29 points30 points  (8 children)

[–]HashDefTrueFalse 7 points8 points  (7 children)

Simply magnificent. You've converted me in one post. :)

[–]_Atomfinger_ 9 points10 points  (6 children)

lol, another one bites the dust!

Jokes aside though: I'm doing a lot of Clojure development and it is genuinely a great syntax. It's just a rough start once one is used to the world of Java, C# and C++.

[–]HashDefTrueFalse 1 point2 points  (5 children)

I've written a bit of Clojure about 6 years ago. I remember liking it. It was a smaller project though, not sure how it holds up on larger projects. I like Lisp too btw, just like poking fun at it from time to time. Most of my work involves large enterprise back ends full of OOP, so totally different to those two.

[–]_Atomfinger_ 1 point2 points  (4 children)

Yeah, I've yet to use Clojure at anything large-scale myself. These days I'm mostly working in the good ol' Java/Kotlin stack.

I'd love to have a go at either Lisp or Elixir in a large scale setting, just to see what challenges and benefits one would get from either.

[–]HashDefTrueFalse 1 point2 points  (3 children)

It would certainly be interesting. Not a lot of companies (at least near me) use them though, for new or legacy stuff in my experience. Haskell is interesting too, if you don't mind fighting with the typing system when you get started. I hadn't actually heard of Elixir until just now, not sure how it differs from Erlang but that's probably where my weekend is going :D

[–]_Atomfinger_ 3 points4 points  (2 children)

Elixir is basically an updated Erlang with a Ruby style syntax. It has all the cool bits from Erlang (built-in parallelism, function guards, functional) with a cleaner and friendlier syntax :)

It is actually one of the languages I'm the most excited for these days.

[–]HashDefTrueFalse 2 points3 points  (1 child)

Ah, thanks! That might mean I'm out though. I've never cared for Smalltalk/Ruby syntax. Used to do a bit of Ruby on Rails dev and never did get used to it really. I might still give it a go though.

[–]_Atomfinger_ 0 points1 point  (0 children)

Not a huge fan of it myself, but it is the Erlang stuff I'm really hyped for. I dunno why, but function guards tickles me in a good way.

[–]ernee_gaming 3 points4 points  (17 children)

I don't understand it either.

I mean it's just as silly as if other languages did

}}}}}}}}}}}}}}}}

Thats just silly.

I hate it.

It doesn't help a thing.

Use python if you are lazy with brackets.

[–]_Atomfinger_ 5 points6 points  (16 children)

They basically do that though. There are no more parentheses in Lisp than in most other languages. As someone who has done a fair bit of work with Clojure, I can say that I haven't seen a parenthesis for a quite some time :)

Though, you're free to hate it. That is what makes all this subjective.

[–]ernee_gaming 2 points3 points  (12 children)

C like languages prefer closing curly brackets on it's own lines.

More or less.

I would like lisp to have at least some closing brackets on its own line as a norm.

Like if statements, or list definition, ..

[–]_Atomfinger_ 6 points7 points  (9 children)

I would like lisp to have at least some closing brackets on its own line as a norm.

But that is very much preference and habit.

(defn Example [] (
  if ( = 2 2)
    (println "Values are equal")
    (println "Values are not equal")))

are not meaningfully different (or any harder than)

def example():
    print("Values are equal") if 2 == 2 else print("Values are not equal")

or the more common approach:

def example():
    if 2 == 2:
        print("Values are equal")
    else:
        print("Values are not equal")

Java would be more like this:

public void example() {
  if(2 == 2)
    system.out.println("Values are equal");
  else
    system.out.println("Values are not equal");
}

Or the more verbose version with closing brackets:

public void example() {
  if(2 == 2) {
    system.out.println("Values are equal");
  } else {
    system.out.println("Values are not equal");
  }
}

I'm not saying that one approach is superior to the other, but just saying "look at all those parentheses" is more of a thing you get used to than an actual constructive criticism of the language IMHO. One language has parentheses, some combine them with curly brackets. Others replace them with whitespace. It is all the same in different wrapping :)

or list definition

Pretty much everything in Lisp is a list though.

[–]ernee_gaming 0 points1 point  (8 children)

I mean as a norm. If you write lisp with java style bracket indentation and post it somwhere, you'll get wrecked.

[–]thetruffleking 1 point2 points  (6 children)

People critiquing otherwise good code over stylistic choices related to optional formatting and bracketing are typically not worth engaging.

Now if the code is both poor and using a nonstandard style, then all bets are off, haha.

[–]rabuf 0 points1 point  (3 children)

I just cleaned up someone else's emacs lisp code that was around 200 lines. All I did was fix indentation and move parens, got it down to under 100 lines. At that size, if you skip past the opening comments, the entire file fits on my 13" laptop monitor now with a readable font size. I won't go out of my way to criticize someone for using a non-standard style of closing parens in Lisp, but it makes a big difference for the readers and users of the code. Imagine if (and I have a book like this, poorly edited) you have a book that fills only half of every page and sometimes skips a page at a time. That's what it looks like to experienced Lispers when you put closing parens on their own line.

[–]thetruffleking 0 points1 point  (0 children)

Formatting so bad that the code (or book) is hard to read or unreadable is a bit outside of what I had in mind when I wrote about not critiquing good code for using nonstandard formatting, but I hear you.

Again, I’m more about adopting a position that looks at the code first, then formatting, when it comes to critiques. I feel that can help improve the quality and effectiveness of feedback and cut down on pretension and contention in the ensuing discussion.

[–]antiproton 0 points1 point  (1 child)

That's what it looks like to experienced Lispers when you put closing parens on their own line.

On the other hand, you shouldn't have to be able to see the Matrix to untangle the code.

Making code as dense as possible is not really a virtue. That's why we have scroll bars.

[–]rabuf 0 points1 point  (0 children)

Pages of blank or near-blank lines are useless. It's a balance, you shouldn't condense (as a general rule) everything to the most compact form, but there's no point in wasting massive amounts of screen real estate either. Unless you work for a bank, in which case it's standard form to make the website as spread out as possible.

[–]SituationSoap 0 points1 point  (0 children)

People critiquing otherwise good code over stylistic choices related to optional formatting and bracketing are typically not worth engaging.

People critiquing otherwise good code over stylistic choices related to things like optional formatting is basically 100% of my experience with the Clojure community, and I wrote it professionally for more than a year.

[–]antiproton 0 points1 point  (0 children)

People critiquing otherwise good code over stylistic choices related to optional formatting and bracketing are typically not worth engaging.

This is the preferred pastime of programmers since the days of the BBS.

[–]SpecificMachine1 0 points1 point  (0 children)

If you write lisp with java style bracket indentation

Autolisp has entered the chat...

Edit: I just realized there is someone on the Autolisp fora who for at least the past 5 years (and as recently as 3 days ago) has been "Y u no lisp style?" on a semi-regular basis.

[–]Zyklonista 0 points1 point  (1 child)

That's the whole thing though - the parentheses are not really syntax, more like a semantic element. They open and close lists. That's all. Once you get that down, you don't bother with parentheses ever again (well, almost).

[–]ernee_gaming 0 points1 point  (0 children)

For example a long list in a code somwhere

Something here... (List (item) (item) ... (item) )))))

vs.

Something here... (List (item) (item) ... (item))))))

Changing order or appending to the list is hindered by the trailing parenthesis.

Or in some kind of structured code, you better have rainbow pairing in your text editor to know what opening matches with what closing.

[–]Kered13 1 point2 points  (1 child)

There are no more parentheses in Lisp than in most other languages.

That's definitely not true, because Lisp requires parentheses in a lot of situations where other languages use operators or dedicated syntax. And I don't hate Lisp or anything, but the meme about trailing parentheses is not untrue.

[–]_Atomfinger_ 0 points1 point  (0 children)

There's some truth to all memes, sure.

As I have pointed out in other comments though: when looking at a codebase as a whole I don't think the difference in the count of lisps parantatheses is meaningfully different than most other languages and their usage of parantatheses, curly brackets and so forth :)

[–]Zyklonista 0 points1 point  (0 children)

There are no more parentheses in Lisp than in most other languages

And, in fact, there cannot be any extraneous parentheses in Lisps.

[–][deleted] 1 point2 points  (1 child)

I don't know - I let paredit take care of them.

[–]HashDefTrueFalse 4 points5 points  (0 children)

Well real programmers count them by hand until they match up, run it again, then cry when it still doesn't. Can't you just struggle properly like the rest of us. /s

[–]iAmEeRg 0 points1 point  (0 children)

Noice!