5 ms·
Come on. (if (= x 2) (print "x is two!") (print "x is not two!")) or (defclass person () name address) will not take a p
by reikonomusha 5y ago
Come on.
(if (= x 2)
(print "x is two!")
(print "x is not two!"))
or
(defclass person ()
name
address)
will not take a professional programmer who is prepared to receive a 6-figure salary “months” to learn. We might as well call
[2*x for x in range(10) if x % 2 == 0]
a “DSL for constructing lists” in Python which, incidentally, also doesn’t take most paid programmers months to learn. This doesn’t even get into the zoo of syntax that languages like Python have to offer, like decorators, generator expressions, walrus operators, loop keywords (“else” in a for-loop?), etc.
In my experience training both interns and new hires, getting from zero-to-first-commit is like a week. Getting on code reviews, 2-3 weeks. Feeling confident and comfortable, 4-5.
Also, nobody is being paid to feel language zen. Yes, mastering Lisp or becoming anything close to an expert might take years. But being a language academic usually isn’t the goal of the working programmer.
- westoncb 5y agoIt seems like there would be a large space (that's sidestepped here) between learning basic syntactic differences and 'mastering' Lisp. Are there not novel concepts (outside of syntax) which programmers struggle with in that space? And does gp's comment about needing to learn 'restraint' from experience not apply to that middle space too? IME if you were diligent about only hiring very smart + intrinsically interested programmers, the kind of outcome you're describing might be realistic. But I don't see this going well if you draw from the large pool otherwise available of more paycheck-motivated programmers who may or may not have a strong grasp of conceptual underpinnings of programming languages.
- reikonomusha 5y agoIn anything, Lisp included, there are difficult concepts to comprehend. You can throw a dart and it’ll probably land on an interesting and difficult subject. throws dart How does finalization of objects in a generationally garbage collected implementation of Lisp work? throws dart How does a local dynamic variable interact with a new thread being spawned? throws dart What is a “three-comma macro” and how do I write one? You get the picture. Lisp has plenty of concepts that you can spend ages mulling over. But I contend that Common Lisp is in a sweet spot where it’s not particularly dogmatic about those concepts and as such don't consistently present themselves as hurdles to learning the language and being productive. Honestly the biggest hurdle of Common Lisp is that Emacs is the #1 doctor-recommended solution for editing Lisp—in the open source world at least. Paycheck programmers are “easier” to teach in fact because they don’t care about the “zen” of Lisp or any of that. Tell them the rules, tell them what code to mimic, and tell them what issue tickets need servicing. If they’re otherwise fine programmers, they’ll make some mistakes, but those mistakes get ironed out during code reviews, and they happen less and less frequently. But of course, the “intrinsically motivated” programmers are likely to produce better solutions to problems more consistently, and I try to hire for that regardless of the language.
- westoncb 5y agoThat makes a lot of sense.
- e12e 5y ago> What is a “three-comma macro” and how do I write one? Had to look that up: https://www.cliki.net/Three%20Comma%20Programmer https://www.cliki.net/Three%20Comma%20Programmer Are there genuine cases where you need a sigle "three-comma" macro, rather than layering a handful of simpler macros?
- pfdietz 5y agoI always break up that sort of thing using auxiliary functions. It's much more understandable.
- RogerL 5y agoIf that's the difference, why would anyone care about using lisp? The examples you've chosen are nothing more than "parens before the statement instead of squiggles after", more or less. Why would anyone advocate for lisp if that was the difference. I'm not a lisper, so that's an honest question. I can't believe people are so evangelical about the language over such a trite difference from C/Python/Java.
- vindarel 5y agoWorkflow wise, that's my answer: https://lisp-journey.gitlab.io/pythonvslisp/ https://lisp-journey.gitlab.io/pythonvslisp/
- kagevf 5y agoI read this earlier ... that tip about hitting "v" in the debugger was so useful!
- reikonomusha 5y agoA language is much, much more than syntax. I showed some trivial syntax, but I didn’t talk about how fast it might be to execute that code, nor easy or hard it might be to debug it, how straightforward it is to pull in a dependency, etc. You’re right, there’s little that can be inferred from such a simple code example, except one thing: the syntax really isn’t that hard to grok. With that said, to throw a bone, for me, Lisp is valuable because it’s an incrementally and interactively developed language that makes available syntactic extension to the programmer. This makes it possible to be extraordinarily productive as a programmer on even the most difficult technical challenges. Incremental and interactive: there is no edit-compile-run cycle. Feedback is instantaneous. Debugging is extremely fast. Concentration rarely falters. Syntactic extension: One can author new syntax that fits problem domains. If I’m writing a lot of RESTy APIs, I might make a nice syntax for them that makes the route and consequent action front-and-center with no boilerplate. There’s so much more than just these though. Common Lisp implementations are incredible stable and mature, there’s a huge library ecosystem, it’s possible to write code as fast as C, and the language has stood the test of several decades of time.
- User23 5y agoThat Python snippet reminds me of my least favorite part of CL: the LOOP macro. Although calling it part of CL is a bit of a misnomer since the standard specifies it as, paraphrasing, do loops n stuff.
- vindarel 5y agoI struggled with loop too, but I finally just learnt it by example: https://lispcookbook.github.io/cl-cookbook/iteration.html https://lispcookbook.github.io/cl-cookbook/iteration.html and it's awesome.
- aidenn0 5y agoThere's like 20 pages of details on the loop macro; certainly more than "do loops and stuff"
- aidenn0 5y agoToo late to edit. Loop takes up an entire chapter of the ANSI specification and that chapter is 30 pages long. PDF made from latex files of Final Draft; LOOP is Chapter 6: https://lisp.com.br/archive/ansi_cl_standard_draft_nice.pdf https://lisp.com.br/archive/ansi_cl_standard_draft_nice.pdf
- User23 5y agoIt's more like 3 pages, with examples, when presented formally[1]. My point though is the standard specified behavior is quite limited, but it gives implementers broad latitude to "do loops and stuff" in a non-portable way[2] while still being in some sense standard. For example, Lispworks extends LOOP over SQL queries[3]. So sure I was being a bit tongue-in-cheek, but LOOP really is a set of not particularly compatible imperative languages that happen to be embedded in the various CL implementations. This is an artifact of the CL standardization process, which was virtually taking the set union of the features of the most popular implementations of the time, except in notable cases like LOOP where it was so hairy and incompatible that the standards body had to pick a relatively minimal intersection instead. [1] http://www.lispworks.com/documentation/HyperSpec/Body/m_loop.htm http://www.lispworks.com/documentation/HyperSpec/Body/m_loop... [2] http://www.lispworks.com/documentation/HyperSpec/Body/06_ai.htm http://www.lispworks.com/documentation/HyperSpec/Body/06_ai.... [3] http://www.lispworks.com/documentation/lw50/LWRM/html/lwref-84.htm http://www.lispworks.com/documentation/lw50/LWRM/html/lwref-...