Each chapter of the book ends with some exercises to test out the topics the reader just learned. A full description of avro is outside the scope of this documentation, but here is. Regarding the title scala for the impatient dont get fooled by the impatient part. Importing a scala project from github into eclipse stack. Since scala runs on the jvm, it can access any java library and is interoperable with java frameworks. It is the job of the scala compiler to convert between primitive types and wrappers. Check here for the errata, or contribute a new bug report. There are plenty of github repositories that contain exercises for one or two chapters of scala for the impatient. Scala for the impatient 2nd edition pdf free download, this a free book for impatient people who want to learn scala quickly.
I discovered scala during a master course and was immediately seduced by it. Write a scala application, using the app trait, that prints the commandline arguments in reverse order, separated by spaces. It will also help you recognize many counterintuitive traps and pitfalls and prevent them from inflicting further. My solutions for scala for the impatient exercises. Scala is the functional and objectoriented programming language created by lightbend cofounder, prof. Scala puzzlers is a collection of such examples in scala. For the impatient, heres how to get started using scalafx in your development.
There is only one value of type unit, and it is not represented by any object in the. Sign up my solutions for scala for the impatient exercises. This version of api is planned to be available soon there is one dedicated issue on the github of project well, during the waiting time, you can start to develop your service based on scala language. However, despite all above i think scala is definitely worth to invest some time. Using scala, you can write programs more concisely than in java, as well as leverage the full power of concurrency. What are some interesting scala projects to examine for. If you are reading this quickstart guide you probably already know how to use scala in your project and probably have your favorite ide or build setup to program in scala. Here is my attempt to solve the exercises and hopefully learn something new about the scala language.
A method with return type unit is analogous to a java method which is declared void. Aug 25, 20 full coverage of scala is not the goal of the book and so is convincing you to use functional paradigm over objectoriented one or vice versa. At least one person posted student answers on github. Scala made the abstraction much easier compared to other languages. It is not only an entertaining and instructive way of understanding this highly expressive language better. Scala school started as a series of lectures at twitter to prepare experienced engineers to be productive scala programmers. Github lucianofiandesioscalafortheimpatientsolutions. A full description of avro is outside the scope of this documentation, but here is an introduction from avro.
In scala, everything is an object, even an integer. It will also help you recognize many counterintuitive traps and pitfalls and prevent them from inflicting further production bug hunt stress on scala developers. That could lead to blinkered abstraction where abstraction puts a blinker on developers thinking and they try to fit the entire world into their abstraction. Write a function that, given a string, produces a map of the indexes of all characters. My solutions to the exercises from the excellent scala for the impatient book. Scala source code is intended to be compiled to java bytecode, so that the resulting executable code runs on a java virtual machine. But you can also rely on it for large mission critical systems, as many companies, including twitter, linkedin, or intel do. System class, reads the user name from the system property, reads a password from the console object, and prints a message to the standard.
Designed to be concise, many of scalas design decisions aimed to address criticisms of java. Functional programming is becoming increasingly widespread in industry. Here, the first item of the array becomes the firstname. Scala is a relatively new language, but draws on many familiar concepts. For example, scala reverse hello world should print world hello. I started off with the book scala for the impatient, the first half of the book is freely available. And of course, you can ask here at coderanch about a. But the problem is, com is a widely used toplevel package, so in this case the restriction is not very useful.
Notes while working through scala for the impatient github. Mar 11, 2016 also i disagree that scala for impatient is good book for start. Here, we just show how to get an accumulator of the scala map type. Each expression in the above code is followed by and then name. My own solutions to the exercises contained in scala for the impatient by cay horstmann project description. My solutions for the exercises in scala for the impatient, second edition. Alexander mikhailovs repository proved a more useful source of inspirationideas when stuck. Poke around scaladoc to find a way of doing this in scala. Aug 12, 2012 1 points to cascading for the impatient articles 2 cascading version links points to paco nathans github repo, scalding versions point to mine.
Scala is a modern programming language for the java virtual. Scala allows developers write code thats more concise, less costly to maintain, and easier to evolve, and is the language used to build popular distributed computing, big data and streaming technologies like apache spark, apache kafka, and the akka platform. The java api is nice and provides a good experience for the developer but, as a scala developer, i am really impatient to play with the scala api. Scala also makes it easier to leverage the full power of concurrency. Thus, these lectures assumed the audience knew the concepts and showed how to use them in scala. See the int class in the scala doc for a complete list.
My solutions to exercises of cay horstmanns book scala for impatient. Core java for the impatient where are the answers to the. Scala fuses functional and objectoriented programming in a practical package. One recommended approach would be first to make your github project compiledrun with sbt which ensures both ideindependence and thirdparty library dependency management. It make me feel scala is dump of random unrelated features, its very easy to disappoint. For example, if you make an array of int, you get an int array in the virtual machine. Make a class car with readonly properties for manufacturer, model name, and model year, and a readwrite property for the license plate. There is only one value of type unit, and it is not represented by any object in the underlying runtime system. This repository sign in sign up code issues 1 pull requests 0 projects 0 actions security pulse. Here is what worked for me to learn the basics well.
The author simply demonstrate scala with notes about his experience and let you pick what suits you the most. Full coverage of scala is not the goal of the book and so is convincing you to use functional paradigm over objectoriented one or vice versa. Im reading the exceptionally good book scala for the impatient. I decided to share these solutions here in order to help those who couldnt get the hang of one or more exercises. It made all other learning curves for languages, techniques, concepts more flatten. We are excited to announce the release of a new version of the online course functional program design.
Having said that, it has been noted that this feature of scala often has been misused. It interoperates seamlessly with both java and javascript. The code for the scalding version is fairly easy to read if you know scala somewhat harder, but still possible if you dont. Use it in the code of exercise 4 to test it the result should not change, since a tree map is a sorted map. You can play with it by typing oneline expressions and observing the results. Scala for the impatient 2nd edition pdf free download. Scala for the impatient concisely shows developers what scala can do and how to do it. One way to create random file or directory names is to produce a random bigint and convert it to base 36, yielding a string such as qsnvbevtomcj38o06kul. This trend is driven by the adoption of scala as the main programming language for many applications. Contribute to scalascalalang development by creating an account on github.
760 1374 631 233 271 223 1245 500 457 1364 538 531 1305 1492 646 1519 703 861 1533 715 14 230 1066 1263 1399 1252 407 46 494 531 1184 352 288 616 1536 1008 777 659 759 94 1106 726 1464 165 1479