6 ms·
I'm really hoping that functional languages will evolve in a way that they become more readable at a glance.
by bubblicious 12y ago
I'm really hoping that functional languages will evolve in a way that they become more readable at a glance.
- EdwardDiego 12y agoScala can be as readable or as unreadable as you like. Which is the problem with using Scala in a corporate environment, it can become a terrible weapon in the hands of a bad developer.
- seanmcdirmid 12y agoYou also have to decide whether to use scala as a functional language or as a better java. Each approach has its merits and drawbacks.
- judk 12y agoDo you think Scala could succeed with a "Scala--" fork: "Java, the good parts". Just a few things like type inference and implicits and case classes would be enough to make Java devs drool without getting scared by FP or performance scares.
- frowaway001 12y agoThat exists: http://en.wikipedia.org/wiki/Pizza_%28programming_language%29 http://en.wikipedia.org/wiki/Pizza_%28programming_language%2...
- seanmcdirmid 12y agoYou could totally use Scala as a language without the laziness, which can be quite a pain when doing perf-sensitive work. Traits are also a huge deal. I don't think the community wants to go in that direction though. Who Scala attracted was a lot of FP programmers (Haskell/ML) who wanted to do work on the JVM; not Java programmers looking for a better alternative to Java on the JVM. So is life.
- the_af 12y agoThis probably depends on where you work, though. I work in the industry, and in my experience people using Scala (1) are simply looking for a better Java, and have no prior knowledge of FP or other languages which are not C-like OO. They would probably freak out if they saw a language similar to ML. On the other hand, the few people I know working in academia have very little interest in Scala. (1) i.e. my coworkers, and people I know in other companies.
- virtualwhys 12y agoReadability is in the eye of the beholder, which is to say, familiarity breeds content.
- yogthos 12y agoI find Clojure to be one of the most scannable languages. The s-expression syntax gives you a visual representation of the relations between different pieces of code. When you see one expression nested inside another, you know they're related. You can tell what branching and relations are there by a quickly scanning the code and looking at the indentation. Having a bit more syntax than traditional Lisps helps break the code up visually as well. For example, things like bindings jump out immediately.
- shepardrtc 12y agoHaskell is very clean and readable. The problem, however, is that its such a departure from imperative languages that you can't bring much of anything you already know over to it. You really do have to forget everything you're learned about programming and start from scratch. Until then, its all alien. That being said, I think that Haskell is the most clean looking of all the FP languages, but that's purely my opinion.
- dragonwriter 12y ago> The problem, however, is that its such a departure from imperative languages that you can't bring much of anything you already know over to it. I don't find that really true; if you've used any structured language with static typing, there's a lot of carryover, especially if you've ever done any formal study of CS, since even when imperative languages are used functional patterns are pretty common. The biggest problem I see is that there isn't a lot of pragmatic guidance on the bits that are unique to Haskell -- a lot of the documentation is very abstract, without a lot of guidance on solving specific real world problems. The power of Haskell is that you can make very general solutions in it quite easily; the weakness of the documentation of Haskell is that virtually all of it focusses on that highly general facilities and not enough on the kind of specifics that would help people get familiar with it while solving real problems.
- tormeh 12y agoHaskell suffers from people who want to make things look clean and achieve it by using symbols and very short names. These things have to be memorized before you can understand anything. Basically, people are trying to make Haskell code look like math and the truth is that math's symbolic notation is optimized for hand writing speed, /not/ reading comprehension. Take a look at Ada code. Maybe they're taking it a bit far, but it's very readable. Spelling words out and being very very sparing with symbols is a very good thing, I think.
- the_af 12y agoI don't think this is true. I think Haskell's notation is the way it is because it emphasizes the "look" of certain abstract patterns that would be obscured by the notation used in other languages (I believe this is the case for math as well... I doubt it's that way for hand writing speed, since I doubt that's the bottleneck in maths). This is not what many of us who come from other programming languages are used to, and therefore we identify it as "more difficult", but it actually is lack of familiarity. Not only with Haskell itself, but with the abstractions and the way of looking at programs. I doubt the majority of Haskell programmers would prefer a more verbose notation. I think that, like the parent post, they consider Haskell very clean and readable. A friend of mine who is a proficient Haskeller told me he often struggles to understand new Haskell libraries. Then the library "clicks" for him and he can begin to use it. I -- who program in Java for my day job -- have trouble understanding this, because this is seldom the case for Java: you may not understand what problem a Java library is intended to solve, but using it is usually trivial (and mis-using it is trivial as well, of course!). I think it's unfair to compare both languages this way, because in Java there is a fairly low use of general abstractions, and Java's syntax (and coding practices) have evolved to reflect this. The verbose syntax that works (1) for Java is not suitable for other kinds of programming. (1) for some values of "works".
- tel 12y agoI think that has a lot to do with personal familiarity over language design. FP designers are rarely trying to make their languages feel familiar to C/Awk/Python/Lua/Ruby/Java programmers---though it certainly is an influence from time to time.