Live data from Hacker News

Hands-on Scala Programming

handsonscala.com

81–90 of 108 posts

Re: Hands-on Scala Programming

#81
post #78

Earlier quoted context omitted.

Could you compare your book to ``Scala for the impatient´´?,

Sure! I have the table of contents for "Scala for the Impatient" open in front of me: - S4tI goes into a lot more detail into language features: custom extractors, abstract overrides, annotations, higher kinded types, custom operators. Hands-on Scala skips all of that. Most developers do not need to know this stuff to get stuff done professionally. - Hands-on Scala spends its pages working on fun use cases instead! A…

Thanks a lot, insightful. It seems the Hands-on is very appropriate.

Re: Hands-on Scala Programming

#82

Earlier quoted context omitted.

Scala has a very wide surface area, and it can be as simple or complex as you want it to be. Written in a certain way, it's that different from writing Python 3 with PEP-484 type annotations. You can easily write Python-like code and just get things done. :) Concurrency-wise, you can implement any concurrency model you want on top of it, and, personally, I find immutability + Task-like implementations (Monix, ZIO, IO…

I think that's the main problem. Everyone writes Scala differently. In Go pretty much everything is quite similar. In JavaScript people also write things differently, like any other language really, but in Scala it is compounded. Is there a concrete example of the Python-like code vs the more complex ones? I appreciate the help. I'm thinking what language next should I pick up. It is either OCaml or Scala.

Experts' code looking like beginners' code is not a good thing! If better learning a language doesn't make your code clearer and more concise, the language isn't pulling its weight.

Re: Hands-on Scala Programming

#83
post #72

Haoyi's libraries (e.g. ujson) are great - and perfect for beginners to learn Scala with, very idiomatic scala without the Haskell-style overhead.

I agree about Haoyi's libraries, but you're mention of overhead reminds me of the overhead you run into trying to be purely functional in Scala.

If you're sold on benefits of purely functional programming, I think it's good to know (at least as of a few years ago) Scala makes that more painful than Haskell if you have even a little Haskell experience.

Re: Hands-on Scala Programming

#84

Haoyi is an amazing guy. Last night at 8pm and 2pm this morning I submitted two PR to the Mill, he merged within one hour. In about 7 years, he helped to create an eco-system around Scala: - REPL (ammonite) - build tool (mill) - JSON serializer(uPickle) - web framework (cask) - test framework(uTest) - http client lib (requests-scala) - HTML tag lib (scalatags) - parser(fast parse) Scala development and tool can be di…

> - Haskell (pure FP, even HKT): good for fun but not for profit. Use Haskell for pure FP.

My day job disagrees Haskell isn't good for profit ;)

Re: Hands-on Scala Programming

#85
post #28

Earlier quoted context omitted.

Will this be a good book to learn your first functional language?

Functional programming is a style or pattern. If a language gives you basic stuff, you can do that pattern. I learned a bit of haskell a long time ago - mind blown kind of time - then found javascript had closures (erm, kind of a way of turning functions into objects-with-state-that-still-look-like-functions) and functions as first class objects (meaning a function can be passed around exactly like and integer or a s…

> Functional programming is a style or pattern. If a language gives you basic stuff, you can do that pattern.

Kind of... correctness isn't as guaranteed though. Having a hard time putting it into words at the moment, maybe I just need some holes poked into it to draw out the rest of my view (or change it).

Re: Hands-on Scala Programming

#86
> Knowing the language alone isn't enough to go to production: Hands-on Scala introduces the reader to the ecosystem of editors, build tools, web frameworks, database libraries, everything necessary to do real work using Scala. You will finish this book having all the necessary building blocks to be productive using Scala in production.

We definitely need more books to include this by default. Kudos!

I only wish a book like this existed for F#! If anyone has any recommendations, I'm all ears

Re: Hands-on Scala Programming

#87
post #42
post #24

Some context for people who have limited knowledge of Scala. Lihaoyi is one of the most prolific coder's, not just in Scala, but in any language. He looks like he is much to humble and modest to claim so himself, so I will do it for him. Here is a by no means exhaustive list of projects - A buildtool - A bash replacement that speaks Scala - A test framework - A parsing library - Ports of several python libraries in S…

I think your argument here is counterproductive. Lihaoyi is a prolific coder but most coder like me are average Joe. How can Scala be useful and make average Joe like me productive. The fact that Lihaoyi is a prolific coder in any language does not help selling Scala.

My personal pitch for Scala comes down to two things: developer experience and suitability for projects of all scales.

I frequently miss basic features when I'm using other languages. Some of these include: - Its system for basic immutable data structures. - Pattern matching for very concisely extracting and branching on data. - A really nice immutable collections library. - Scalacheck for generative testing, driven by the type system. - A bunch of other nice-to-have syntactic features.

From the perspective of building projects, I appreciate that it can model anything from quick utilities to simple web services to concurrent systems, all within a single JVM. And with tools like Akka, you can move that to distributed systems without having to add external software you have to operate.

Re: Hands-on Scala Programming

#88

Haoyi is an amazing guy. Last night at 8pm and 2pm this morning I submitted two PR to the Mill, he merged within one hour. In about 7 years, he helped to create an eco-system around Scala: - REPL (ammonite) - build tool (mill) - JSON serializer(uPickle) - web framework (cask) - test framework(uTest) - http client lib (requests-scala) - HTML tag lib (scalatags) - parser(fast parse) Scala development and tool can be di…

I think you're missing perhaps the biggest camps in the form of the Lightbend ecosystem (very much pragmatic OO/FP hybrid) and the big data ecosystem around Spark. Even though the Lightbend stack also has Java APIs, the Scala APIs are very much their own thing.

Re: Hands-on Scala Programming

#89
Both the content and layout looks really fantastic!

I wanted to ask any experienced Scala folks if its possible become really proficient without a solid background in Java. I understand that its only JVM hosted language so I guess my concern is how much Java you need to know when things go sideways - stack traces, low level debugging etc?

Re: Hands-on Scala Programming

#90
post #28
post #2

I didn't post this, but cool to see this up here! The full book is ~400 pages and will be released Summer 2020 (i.e. soon!). If you're interested in being notified when it comes out, there's a mailing list link on the page and I'll let you know when it's out. There will be both E-Books as well as paperbacks & hardcovers (assuming the supply-chains are still open in this COVID-19 global environment...) The first 5 cha…

Will this be a good book to learn your first functional language?

Regardless of how good a book may be, I think Scala itself might prove to be a challenging language to learn FP through. I use it daily at work and definitely appreciate all its strengths, but I don't think I'd ever really understand it if I hadn't studied Haskell first. I'd recommend it as a second language, after you've been bitten by the bug and want a job writing functional code.
Post reply on HN