Scala for the Impatient
Home > Computing and Information Technology > Computer programming / software engineering > Programming and scripting languages: general > Scala for the Impatient
Scala for the Impatient

Scala for the Impatient


     0     
5
4
3
2
1



Out of Stock


Notify me when this book is in stock
X
About the Book

Scala 3--A Clear, Concise Guide Scala 3 is concise, consistent, flexible, robust, and efficient, but there's a lot to learn and navigating features and improvements can be challenging. Scala for the Impatient, Third Edition, is a complete yet concise guide that reflects the major enhancements of Scala 3, from improved syntax and revamped type system to powerful contextual abstractions. This indispensable tutorial offers a faster, easier pathway for learning today's Scala. Horstmann--author of the programming classic, Core Java--covers everything working developers need to know, focusing on hands-on solutions, not academic theory. Given the size and scope of Scala 3, there's plenty to cover but it's presented in small chunks organized for quick access and easy understanding, with plenty of practical insights and focused sample code. Get started quickly with Scala 3 interpreter, syntax, tools, and current usage Master core language features: functions, arrays, maps, tuples, packages, imports, exception handling, and more Design and build better object-oriented code with Scala 3 Use Scala for real-world programming tasks: working with files, regular expressions, and processes Work with higher-order functions and the powerful Scala collections library Create concurrent programs with Scala futures Understand the Scala type system, including revamped enums, intersection and union types, and enhanced type inference Use contextual abstractions to easily extend class hierarchies, enrich existing classes, perform automatic conversions, and elegantly hide tedious details Apply advanced "power tools" such as annotations and given values Discover how to "program with types," analyzing and generating types at compile time Get a taste of what's now possible with Scala macros If you're a Java, Python, C++, or C# programmer who's new to Scala or functional programming--or even if you've already used earlier versions of Scala--this guide will help you write code that's more robust, more efficient, and more secure. Register your book for convenient access to downloads, updates, and/or corrections as they become available. See inside book for details.

Table of Contents:
Foreword to the First Edition xix Preface xxi About the Author xxv Chapter 1: The Basics 1 1.1 The Scala Interpreter 1 1.2 Declaring Values and Variables 4 1.3 Commonly Used Types 5 1.4 Arithmetic and Operator Overloading 7 1.5 More about Calling Methods 8 1.6 The apply Method 9 1.7 Scaladoc 11 Exercises 14 Chapter 2: Control Structures and Functions 17 2.1 Conditional Expressions 18 2.2 Statement Termination 20 2.3 Block Expressions and Assignments 21 2.4 Input and Output 22 2.5 Loops 23 2.6 More about the for Loop 25 2.7 Functions 27 2.8 Default and Named Arguments 29 2.9 Variable Arguments 30 2.10 The Main Function 31 2.11 Functions without Parameters 31 2.12 Lazy Values 32 2.13 Exceptions 33 Exercises 36 Chapter 3: Working with Arrays 39 3.1 Fixed-Length Arrays 39 3.2 Variable-Length Arrays: Array Buffers 40 3.3 Traversing Arrays and Array Buffers 41 3.4 Transforming Arrays 42 3.5 Common Algorithms 44 3.6 Deciphering Scaladoc 45 3.7 Multidimensional Arrays 46 3.8 Interoperating with Java 47 Exercises 48 Chapter 4: Maps, Options, and Tuples 51 4.1 Constructing a Map 52 4.2 Accessing Map Values 52 4.3 Updating Map Values 53 4.4 Iterating over Maps 54 4.5 Linked and Sorted Maps 54 4.6 Interoperating with Java 55 4.7 The Option Type 56 4.8 Tuples 57 4.9 Zipping 59 Exercises 59 Chapter 5: Classes 63 5.1 Simple Classes and Parameterless Methods 63 5.2 Properties with Getters and Setters 65 5.3 Properties with Only Getters 67 5.4 Private Fields 68 5.5 Auxiliary Constructors 69 5.6 The Primary Constructor 70 5.7 Nested Classes 73 Exercises 74 Chapter 6: Objects and Enumerations 77 6.1 Singletons 78 6.2 Companion Objects 78 6.3 Objects Extending a Class or Trait 79 6.4 The apply Method 80 6.5 Application Objects 81 6.6 Enumerations 81 Exercises 83 Chapter 7: Packages, Imports, and Exports 85 7.1 Packages 86 7.2 Package Scope Nesting 87 7.3 Chained Package Clauses 88 7.4 Top-of-File Notation 88 7.5 Package-Level Functions and Variables 89 7.6 Package Visibility 89 7.7 Imports 90 7.8 Imports Can Be Anywhere 91 7.9 Renaming and Hiding Members 91 7.10 Implicit Imports 92 7.11 Exports 92 Exercises 93 Chapter 8: Inheritance 97 8.1 Extending a Class 98 8.2 Overriding Methods 98 8.3 Type Checks and Casts 99 8.4 Superclass Construction 100 8.5 Anonymous Subclasses 101 8.6 Abstract Classes 101 8.7 Abstract Fields 102 8.8 Overriding Fields 102 8.9 Open and Sealed Classes 104 8.10 Protected Fields and Methods 105 8.11 Construction Order 105 8.12 The Scala Inheritance Hierarchy 106 8.13 Object Equality 109 8.14 Multiversal Equality 110 8.15 Value Classes 111 Exercises 112 Chapter 9: Files and Regular Expressions 117 9.1 Reading Lines 118 9.2 Reading Characters 118 9.3 Reading Tokens and Numbers 119 9.4 Reading from URLs and Other Sources 120 9.5 Writing Files 120 9.6 Visiting Directories 120 9.7 Serialization 121 9.8 Process Control 122 9.9 Regular Expressions 124 9.10 Regular Expression Groups 126 Exercises 126 Chapter 10: Traits 129 10.1 Why No Multiple Inheritance? 129 10.2 Traits as Interfaces 131 10.3 Traits with Concrete Methods 132 10.4 Traits for Rich Interfaces 133 10.5 Objects with Traits 133 10.6 Layered Traits 134 10.7 Overriding Abstract Methods in Traits 135 10.8 Concrete Fields in Traits 136 10.9 Abstract Fields in Traits 137 10.10 Trait Construction Order 138 10.11 Trait Constructors with Parameters 139 10.12 Traits Extending Classes 140 10.13 What Happens under the Hood 141 10.14 Transparent Traits 143 10.15 Self Types 143 Exercises 145 Chapter 11: Operators 149 11.1 Identifiers 150 11.2 Infix Operators 151 11.3 Unary Operators 152 11.4 Assignment Operators 153 11.5 Precedence 153 11.6 Associativity 154 11.7 The apply and update Methods 155 11.8 The unapply Method 155 11.9 The unapplySeq Method 157 11.10 Alternative Forms of the unapply and unapplySeq Methods 158 11.11 Dynamic Invocation 159 11.12 Typesafe Selection and Application 162 Exercises 163 Chapter 12: Higher-Order Functions 169 12.1 Functions as Values 170 12.2 Anonymous Functions 170 12.3 Parameters That Are Functions 171 12.4 Parameter Inference 172 12.5 Useful Higher-Order Functions 173 12.6 Closures 174 12.7 Interoperability with Lambda Expressions 175 12.8 Currying 176 12.9 Methods for Composing, Currying, and Tupling 177 12.10 Control Abstractions 178 12.11 Nonlocal Returns 179 Exercises 180 Chapter 13: Collections 183 13.1 The Main Collections Traits 184 13.2 Mutable and Immutable Collections 185 13.3 Sequences 187 13.4 Lists 188 13.5 Sets 189 13.6 Operators for Adding or Removing Elements 190 13.7 Common Methods 193 13.8 Mapping a Function 195 13.9 Reducing, Folding, and Scanning 197 13.10 Zipping 200 13.11 Iterators 201 13.12 Lazy Lists 202 13.13 Interoperability with Java Collections 204 Exercises 205 Chapter 14: Pattern Matching 209 14.1 A Better Switch 210 14.2 Guards 211 14.3 Variables in Patterns 211 14.4 Type Patterns 212 14.5 The Matchable Trait 213 14.6 Matching Arrays, Lists, and Tuples 214 14.7 Extractors 216 14.8 Patterns in Variable Declarations 217 14.9 Patterns in for Expressions 218 14.10 Case Classes 219 14.11 Matching Nested Structures 221 14.12 Sealed Classes 222 14.13 Parameterized Enumerations 223 14.14 Partial Functions 224 14.15 Infix Notation in case Clauses 225 Exercises 226 Chapter 15: Annotations 231 15.1 What Are Annotations? 232 15.2 Annotation Placement 232 15.3 Annotation Arguments 233 15.4 Annotations for Java Features 234 15.5 Annotations for Optimizations 236 15.6 Annotations for Errors and Warnings 238 15.7 Annotation Declarations 239 Exercises 241 Chapter 16: Futures 245 16.1 Running Tasks in the Future 246 16.2 Waiting for Results 248 16.3 The Try Class 249 16.4 Callbacks 250 16.5 Composing Future Tasks 251 16.6 Other Future Transformations 253 16.7 Methods in the Future Object 255 16.8 Promises 257 16.9 Execution Contexts 258 Exercises 259 Chapter 17: Type Parameters 263 17.1 Generic Classes 264 17.2 Generic Functions 264 17.3 Bounds for Type Variables 265 17.4 Context Bounds 266 17.5 The ClassTag Context Bound 267 17.6 Multiple Bounds 267 17.7 Type Constraints 267 17.8 Variance 268 17.9 Co- and Contravariant Positions 270 17.10 Objects Can't Be Generic 271 17.11 Wildcards 272 17.12 Polymorphic Functions 273 Exercises 274 Chapter 18: Advanced Types 277 18.1 Union Types 277 18.2 Intersection Types 278 18.3 Type Aliases 279 18.4 Structural Types 281 18.5 Literal Types 283 18.6 The Singleton Type Operator 284 18.7 Abstract Types 286 18.8 Dependent Types 287 18.9 Abstract Type Bounds 289 Exercises 290 Chapter 19: Contextual Abstractions 295 19.1 Context Parameters 296 19.2 More about Context Parameters 297 19.3 Declaring Given Instances 299 19.4 Givens in for and match Expressions 301 19.5 Importing Givens 302 19.6 Extension Methods 303 19.7 Where Extension Methods Are Found 304 19.8 Implicit Conversions 306 19.9 Rules for Implicit Conversions 307 19.10 Importing Implicit Conversions 308 19.11 Context Functions 309 19.12 Evidence 311 19.13 The @implicitNotFound Annotation 312 Exercises 313 Chapter 20: Type-Level Programming 317 20.1 Match Types 318 20.2 Heterogeneous Lists 319 20.3 Literal Type Arithmetic 322 20.4 Inline Code 323 20.5 Type Classes 326 20.6 Mirrors 328 20.7 Type Class Derivation 330 20.8 Higher-Kinded Types 332 20.9 Type Lambdas 334 20.10 A Brief Introduction into Macros 335 Exercises 339 Index 343

About the Author :
Cay S. Horstmann is principal author of Core Java, Volumes I and II, Twelfth Edition (Pearson, 2022), and author of Core Java for the Impatient, Third Edition (Addison-Wesley, 2022), and Modern JavaScript for the Impatient (Addison-Wesley, 2020). He has written more than a dozen other books for professional programmers and computer science students. He is professor emeritus of computer science at San Jose State University and a Java Champion.


Best Sellers


Product Details
  • ISBN-13: 9780138033576
  • Publisher: Pearson Education (US)
  • Publisher Imprint: Addison Wesley
  • Language: English
  • ISBN-10: 0138033579
  • Publisher Date: 06 Mar 2023
  • Binding: Digital download
  • No of Pages: 400


Similar Products

Add Photo
Add Photo

Customer Reviews

REVIEWS      0     
Click Here To Be The First to Review this Product
Scala for the Impatient
Pearson Education (US) -
Scala for the Impatient
Writing guidlines
We want to publish your review, so please:
  • keep your review on the product. Review's that defame author's character will be rejected.
  • Keep your review focused on the product.
  • Avoid writing about customer service. contact us instead if you have issue requiring immediate attention.
  • Refrain from mentioning competitors or the specific price you paid for the product.
  • Do not include any personally identifiable information, such as full names.

Scala for the Impatient

Required fields are marked with *

Review Title*
Review
    Add Photo Add up to 6 photos
    Would you recommend this product to a friend?
    Tag this Book Read more
    Does your review contain spoilers?
    What type of reader best describes you?
    I agree to the terms & conditions
    You may receive emails regarding this submission. Any emails will include the ability to opt-out of future communications.

    CUSTOMER RATINGS AND REVIEWS AND QUESTIONS AND ANSWERS TERMS OF USE

    These Terms of Use govern your conduct associated with the Customer Ratings and Reviews and/or Questions and Answers service offered by Bookswagon (the "CRR Service").


    By submitting any content to Bookswagon, you guarantee that:
    • You are the sole author and owner of the intellectual property rights in the content;
    • All "moral rights" that you may have in such content have been voluntarily waived by you;
    • All content that you post is accurate;
    • You are at least 13 years old;
    • Use of the content you supply does not violate these Terms of Use and will not cause injury to any person or entity.
    You further agree that you may not submit any content:
    • That is known by you to be false, inaccurate or misleading;
    • That infringes any third party's copyright, patent, trademark, trade secret or other proprietary rights or rights of publicity or privacy;
    • That violates any law, statute, ordinance or regulation (including, but not limited to, those governing, consumer protection, unfair competition, anti-discrimination or false advertising);
    • That is, or may reasonably be considered to be, defamatory, libelous, hateful, racially or religiously biased or offensive, unlawfully threatening or unlawfully harassing to any individual, partnership or corporation;
    • For which you were compensated or granted any consideration by any unapproved third party;
    • That includes any information that references other websites, addresses, email addresses, contact information or phone numbers;
    • That contains any computer viruses, worms or other potentially damaging computer programs or files.
    You agree to indemnify and hold Bookswagon (and its officers, directors, agents, subsidiaries, joint ventures, employees and third-party service providers, including but not limited to Bazaarvoice, Inc.), harmless from all claims, demands, and damages (actual and consequential) of every kind and nature, known and unknown including reasonable attorneys' fees, arising out of a breach of your representations and warranties set forth above, or your violation of any law or the rights of a third party.


    For any content that you submit, you grant Bookswagon a perpetual, irrevocable, royalty-free, transferable right and license to use, copy, modify, delete in its entirety, adapt, publish, translate, create derivative works from and/or sell, transfer, and/or distribute such content and/or incorporate such content into any form, medium or technology throughout the world without compensation to you. Additionally,  Bookswagon may transfer or share any personal information that you submit with its third-party service providers, including but not limited to Bazaarvoice, Inc. in accordance with  Privacy Policy


    All content that you submit may be used at Bookswagon's sole discretion. Bookswagon reserves the right to change, condense, withhold publication, remove or delete any content on Bookswagon's website that Bookswagon deems, in its sole discretion, to violate the content guidelines or any other provision of these Terms of Use.  Bookswagon does not guarantee that you will have any recourse through Bookswagon to edit or delete any content you have submitted. Ratings and written comments are generally posted within two to four business days. However, Bookswagon reserves the right to remove or to refuse to post any submission to the extent authorized by law. You acknowledge that you, not Bookswagon, are responsible for the contents of your submission. None of the content that you submit shall be subject to any obligation of confidence on the part of Bookswagon, its agents, subsidiaries, affiliates, partners or third party service providers (including but not limited to Bazaarvoice, Inc.)and their respective directors, officers and employees.

    Accept

    New Arrivals


    Inspired by your browsing history


    Your review has been submitted!

    You've already reviewed this product!