arisuchan    [ tech / cult / art ]   [ λ / Δ ]   [ psy ]   [ ru ]   [ random ]   [ meta ]   [ all ]    info / stickers     temporarily disabledtemporarily disabled

/λ/ - programming

structure and interpretation of computer programs.
Name
Email
Subject
Comment

formatting options

File
Password (For file deletion.)

Help me fix this shit. https://legacy.arisuchan.jp/q/res/2703.html#2703

Kalyx ######


File: 1506484538091.png (78.13 KB, 304x492, scala-spiral.png)

 No.737

Have the best of both worlds. Construct elegant class hierarchies for maximum code reuse and extensibility, implement their behavior using higher-order functions. Or anything in-between.

Pull your head out of your SICP book and learn you some Scala.

Already know java?
https://docs.scala-lang.org/tutorials/scala-for-java-programmers.html

Need some tutorials straight from the source?
https://docs.scala-lang.org/tutorials/#

Don't know what a program is?
https://www.scala-exercises.org/scala_tutorial

Like koans(one tiny bite sized lesson at a time)?
http://scalakoans.webfactional.com

Wanna take a class from the guy who created the fucking thing?
https://www.coursera.org/learn/progfun1

Need an IDE?
https://www.jetbrains.com/idea/

 No.738

>>737
I'm pretty new to functional design, but I use java and OOP daily. In a nutshell why is it worth it for me to learn scala (aside from a purely academic interest)? Also does anyone here actually use scala on the job?

 No.739

>>738
I use scala on the job daily, and previously used java on the job primarily.

I'd say why you should use functional design and why use scala are different questions, since it's perfectly OK to write nothing but side-effecting OO scala.

I'd say in a nutshell, scala's advantage is that it just has more language features. You can do everything you can do in java, plus more. Case classes and pattern matching dramatically cut down on boilerplate for everyday tasks, type classes allow you to have incredible libraries that would just be too cumbersome to bear in java, etc.

The main reason (and pretty much the definition) to use functional design is that it decreases your ability to make runtime mistakes from not calling side-effecting methods enough, in the right order, at the right time, or too much. Also makes doing things in parallel easier to reason about.

 No.742

>>739
Okay, that makes sense. I think the thing that turned me off scala a couple years ago was the syntactical learning curve. Scala source is so dense I found myself taking 3-4x as long to understand a code snippet as a similar function in java. That and the backwards compatibility was awful, though that might have changed.

 No.743

>>742
I found the syntax daunting at first too, but it's a pretty small initial hurdle. Once you know what the basic set of syntax rules are, everything is pretty easy.
Try one of the courses, I found that if I stuck through one of them that was about all I needed.

 No.826

File: 1509056900888.pdf (3.54 MB, AtomicScalaV2.0.pdf)

I've been learning Scala recently (mostly for use with Spark), and Eckel and Marsh's "Atomic Scala" is proving a useful guide.



[Return] [Go to top] [ Catalog ] [Post a Reply]
Delete Post [ ]