It takes a lot of discipline to write good Common Lisp code.
With Haskell, some of the code may be a bit harder to read at first, but I always have the type signatures to help me. Quite often I dont even need to read the code because the types give me enough of the story.
I am a lot more comfortable to modify code knowing that it just isnt going to break something I wasnt aware of. Far less discipline is required to write good Haskell code. As long as the project is set up so that you don't write everything in IO, you are pretty much good to go.
I would be a lot more confident throwing a junior at a Haskell code base than a Common Lisp one knowing that they would be far less likely to break things.
It does take a bit longer to learn Haskell, but in my opinion, once you get over the hump it is oh so worth it!
I’ve been on Lisp teams where that wasn’t the case and it was a free-for-all with macros and other things. That was a disaster and the code base was a gigantic Rube Goldberg contraption. But bad hygiene is possible in any environment, though Lisp has the capacity to amplify it.
And don’t even start with point-free style, a style where parameters are left implicit. For a reader point-free is appalling and way too clever.
I would say junior Haskell should be unsophisticated. Leave out the higher order abstractions and write longer code which a reader at a lower level has a hope of deciphering.
I used to believe this, but as I started to read more and more Haskell, I realized that I just had to get used to that style of writing Haskell. I now read it fine, in general. Learning to read point-free is a learnable skill.
Tons of non standard sigils, on the other hand, is a bane.
The question of course is how true is this for the general engineering community?
Reminds me in some ways of survivor bias: those that stick successfully with Haskell tend to see the shortcomings perhaps as virtues.
Haskell definitely has issues, but I agree with the parent on his opinion on point free style.
For the record, my primary languages now is OCaml (and to a much lesser extent, functional Scala). But I like reading Haskell code. There are a lot of good ideas there (and no, my Scala/OCaml isn’t loaded down with custom sigils).
Yes, that's literally the definition of point-free style.
I was referring to labeling function parameters `a` and `b`.
Also, when I checked, that's actually not what the FGL library does. It labels type parameters with `a` and `b`. Labeling generics and type parameters with letters of the alphabet is pretty typical for a wide range of languages (ie, `T` in Java, etc.). Arguably, it's a bad idea, but it's by no means unique to Haskell.
Also, Haskell doesn't have labeled/keyword function parameters, regardless of whether or not you use point-free style. Sometimes, people pass in a record to achieve a similar effect, but in general, passing in a ton of parameters goes against idiomatic Haskell style.
This reminds me of what my boss from my second-ever job told me when he tasked me with starting a new project: "I know I promised you you'll get to choose your own tech stack, but you're going to write it in PHP; I know you'd like something better, perhaps Ruby, but when it comes to hiring developers to help you, I'll have to pay a Ruby developer $X, and I can get PHP developers for $X/2".
I guess it makes business sense for bottom-feeder development. In my case, it burned me out completely.
Anyway, I work in Common Lisp professionally these days too, and we don't shy away from using both simple and moderately-complex macros. There's nothing magic in them. Sure, tracing a problem with the expansion of someone else's macros can be a cognitively taxing work, but you're going to have to do this kind of work somewhere anyway - if not here, then when trying to figure out a convoluted call graph of 20 functions or methods that macro would have abstracted away for you (which was a common thing to do at my previous job, involving Enterprise Java).
As you grow, you will see that not all work is equally important, and you want your more senior guys work on harder problems. And you will also note a number of good, smart developers applying to you who do not yet have the experience of a senior engineer, but could quickly grow.
Then you can start hiring junior engineers, and nurture them.
[Edit: grammar]
Agree that it makes sense to hire juniors once you've grown though.
If no one writers code that junior developers can understand, then how can we hire junior developers?
Independent of the serious answer given by BurningFrog, it's also useful to understand that what's best for the world at large is not necessarily best for your company.
This does not at all imply that no one should ever hire them. So get up from that slippery slope and start walking again!
1. You miss a lot of great talent this way.
2. Growing and developing juniors is part of what makes a "senior."
3. This isn't sustainable advice -- if noone is hiring juniors, then where are the new seniors coming from?
Well, as much as it is short sighted, the really is that letting some other company spend money training juniors is money you don’t have to spend.
The reality is something nobody really talks about.. When a company doesn't want to hire a "junior" it doesn't mean they don't want to hire somebody without X amount of experience in a tech stack or without X amount of experience in the industry.. They don't want to hire people bellow a certain aptitude.
Many "juniors" will never be "senior". Even if they get the title and salary. We all know "seniors" in salary and title only.
Some people are inexperienced "seniors" year one.
(Personally, I feel what makes "forever juniors" isn't aptitude, but lack of care. I don't see it as flaw of character - the factors like structural anti-intellectualism in the industry, lack of enthusiasm due to work being meaningless, and that not everyone is into programming beyond it being a 9-to-5 job all contribute to some people not learning. This suggests to me that expecting people to learn and making learning part of their jobs - actual part, with paid time set aside for it - can overcome this problem.)
Could you expand upon this point?
But the gist of it is: the industry prefers to work with dumbest tools possible and throw cheapest bodies they can get at a problem, instead of expecting people to keep learning, improving themselves, and applying these improvements to their work. This article is an example of that - it advocates discarding advanced tools given to the programmer by Haskell, in favor of writing dumb code that's easily digestible for beginners. Most of the advice about avoiding "clever code" is a form of that too.
I find it a penny-wise, pound-foolish approach, because when you do this trade-off, you're losing in two places. First of all, you handicap your skilled team members. But secondly, the cost (in terms of time, money and incidental complexity) of a project grows faster than linear with the number of people you get involved in it. It'll be O(n!) if you do it naively, O(n logn) if you arrange people into hierarchies, but the problems still grow faster than they're solved as you scale up.
The alternative approach I'm encouraging is to make responsible but full use of the power of the tools you have, and if this goes over the head of some new hire, then teach them until they understand and can make use of that power too. Embrace and encourage learning as a part of this job (actual, expected, and paid-for part). Push the industry upwards, instead of dragging it down.
Literally all of them. However, if someone never progresses to "senior" they might've just lost interest in software development. People in general are remarkable at learning about subjects arousing their curiosity. This is an important fact, too, because environments can be designed specifically to foster just that. Not everything will be working for everybody, of course, and some might never develop an interest in that field again. But that's okay, too.
I really, really wish there was a rapid application development language like PHP or Go written over a functional language like LISP.
I've thought about writing one, and get all the way through it in my head until I come up to the inevitable problem with monads. I believe I can make it work by treating the monads as imaginary numbers with hidden contents and never really solve the problem of mutability, but I don't know what that would look like in practice yet. The language itself would basically be Javascript without mutable variables. There would be no async/await, instead, everything would be synchronous blocking with message-oriented streams in place of messages. Like the Actor model but executing immediately as a graph so it's fully deterministic.
Facebook kind of made one called Skip, although I feel like they might have been working on another one with a "z" in its name, or maybe someone else was, can't remember:
I don’t think this is the right take. Haskell is not Python—there isn’t a single way to do things such that you can say there’s one way, and it does or doesn’t work.
Haskell gives you a lot of flexibility to write code how you would like it. In my experience starting a company in Haskell, there is a subset of it which allows you to be very productive, and also get very high guarantees about the correctness of your code. I strongly recommend it.
Since you have first hand knowledge of the problems outlined in the article, can you comment on how easy it is to hire non-senior Haskell engineers? And how quickly do they come up to speed in a senior devs codebase?
I’ll have a better idea of how non-Haskellers, including very junior engineers, pick up Haskell later this year.
Based on our limited sample size so far, I think people become productive within 4–6 weeks or so.
Similarly, had they'd been thought functional programming, some category theory, and a bit more about type theory, etc., then they'd probably be able to ramp up to Haskell in two weeks as well.
On one hand, they come knowing all the concepts and only having to learn a syntax and tool-chain. On the other, they know none of the concepts, and have to learn them all as well as learning the tooling and syntax.
It reminds me of the Manager - HR pipeline, where HR people get a description of technical stuff to input in their job listings, and then proceed to gatekeep applicants away from the positions, because they don't match x % of their technical laundry list.
- A macro to define a string lexer (aka tokenizer) for a programming language
- A macro to define peephole optimizations of linear instruction code
- A macro to define friendly looking bindings to Fortran functions
- A macro to generate highly optimized complex double precision matrix arithmetic code for inner loops
We do use “standard” macros, mostly from the ALEXANDRIA library. But these are idiomatic and have been used since at least the 80s. (Some of these are macros that On Lisp defines from scratch.)
(Just for comparison, in Haskell you would probably do most of these without macros. They do have (something like) macros in Haskell, though. They are not quite as natural as in Lisp, mostly because of differences in syntax.)
Ideally, a language like Haskell would actually be total by default; ie all computations are finite. For those computations, the compiler can freely choose evaluation strategies without affecting semantics.
For potentially infinite calculations, you'd go into a mode that's somewhat similar to how IO is segregated in existing Haskell.
(There's some more complications about things like infinite event-loops, that can be solved very similarly; and for some things you might want the user to provide proofs that they are indeed finite, instead of just overriding the compiler's judgement with an unsafe cast.)
I haven’t used Haskell professionally so I can’t actually weigh in on the veracity of the prominence of difficult-to-learn code. I do know about using another “weird” language though: Common Lisp. We at Rigetti took a bet with Common Lisp and it passes the “senior-written idiomatic code can be junior-learned and modified” smoke test with flying colors. Every group of interns and every new grad that has become involved in the tens of thousands of lines of code has been able to contribute substantially in less than two weeks.