Atjaunināt sīkdatņu piekrišanu

Programming Kotlin: Create Elegant, Expressive, and Performant JVM and Android Applications [Mīkstie vāki]

4.43/5 (61 ratings by Goodreads)
  • Formāts: Paperback / softback, 450 pages, height x width: 235x191 mm
  • Izdošanas datums: 05-Dec-2019
  • Izdevniecība: Pragmatic Bookshelf
  • ISBN-10: 1680506358
  • ISBN-13: 9781680506358
Citas grāmatas par šo tēmu:
  • Mīkstie vāki
  • Cena: 56,67 €
  • Grāmatu piegādes laiks ir 3-4 nedēļas, ja grāmata ir uz vietas izdevniecības noliktavā. Ja izdevējam nepieciešams publicēt jaunu tirāžu, grāmatas piegāde var aizkavēties.
  • Daudzums:
  • Ielikt grozā
  • Piegādes laiks - 4-6 nedēļas
  • Pievienot vēlmju sarakstam
  • Formāts: Paperback / softback, 450 pages, height x width: 235x191 mm
  • Izdošanas datums: 05-Dec-2019
  • Izdevniecība: Pragmatic Bookshelf
  • ISBN-10: 1680506358
  • ISBN-13: 9781680506358
Citas grāmatas par šo tēmu:

Programmers don't just use Kotlin, they love it. Even Google has adopted it as a first-class language for Android development. With Kotlin, you can intermix imperative, functional, and object-oriented styles of programming and benefit from the approach that's most suitable for the problem at hand. Learn to use the many features of this highly concise, fluent, elegant, and expressive statically typed language with easy-to-understand examples. Learn to write easy-to-maintain, high-performing JVM and Android applications, create DSLs, program asynchrony, and much more.

Kotlin is a highly concise, elegant, fluent, and expressive statically typed multi-paradigm language. It is one of the few languages that compiles down to both Java bytecode and JavaScript. You can use it to build server-side, front-end, and Android applications. With Kotlin, you need less code to accomplish your tasks, while keeping the code type-safe and less prone to error. If you want to learn the essentials of Kotlin, from the fundamentals to more advanced concepts, you've picked the right book.

Fire up your favorite IDE and practice hundreds of examples and exercises to sharpen your Kotlin skills. Learn to build standalone small programs to run as scripts, create type safe code, and then carry that knowledge forward to create fully object-oriented and functional style code that's easier to extend. Learn how to program with elegance but without compromising efficiency or performance, and how to use metaprogramming to build highly expressive code and create internal DSLs that exploit the fluency of the language. Explore coroutines, program asynchrony, run automated tests, and intermix Kotlin with Java in your enterprise applications.

This book will help you master one of the few languages that you can use for the entire full stack - from the server to mobile devices - to create performant, concise, and easy to maintain applications.

What You Need:

To try out the examples in the book you'll need a computer with Kotlin SDK, JDK, and a text editor or a Kotlin IDE installed in it.

Foreword xi
Acknowledgments xiii
Introduction xv
1 Hello Kotlin
1(18)
Reasons to Love Kotlin
3(3)
Why Should You Choose Kotlin?
6(1)
Taking Kotlin for a Ride
7(1)
Compile to Bytecode and Run
8(5)
Compiling to Other Targets
13(1)
Which Option to Choose?
14(1)
Wrapping Up
14(5)
Part I Scripting with Kotlin
2 Kotlin Essentials for the Java Eyes
19(18)
Less Typing
20(4)
Sensible Warnings
24(2)
Prefer val over var
26(2)
Improved Equality Check
28(1)
String Templates
29(1)
Raw Strings
30(3)
More Expressions, Fewer Statements
33(2)
Wrapping Up
35(2)
3 Working with Functions
37(16)
Creating Functions
38(5)
Default and Named Arguments
43(3)
Vararg and Spread
46(3)
Destructuring
49(2)
Wrapping Up
51(2)
4 External Iteration and Argument Matching
53(10)
Range and Iteration
54(3)
Iterating over Arrays and Lists
57(1)
When It's Time to Use when
58(4)
Wrapping Up
62(1)
5 Using Collections
63(14)
Flavors of Collections
63(3)
Using Pair and Triple
66(2)
Arrays of Objects and Primitives
68(2)
Using List
70(2)
Using Set
72(1)
Using Map
73(2)
Wrapping Up
75(2)
6 Type Safety to Save the Day
77(30)
Any and Nothing Classes
78(2)
Nullable References
80(7)
Type Checking and Casting
87(4)
Explicit Type Casting
91(2)
Generics: Variance and Constraints of Parametric Types
93(8)
Reified Type Parameters
101(3)
Wrapping Up
104(3)
Part II Object-Oriented Kotlin
7 Objects and Classes
107(26)
Objects and Singletons
107(6)
Creating Classes
113(11)
Companion Objects and Class Members
124(3)
Creating Generics Classes
127(2)
Data Classes
129(3)
Wrapping Up
132(1)
8 Class Hierarchies and Inheritance
133(16)
Creating Interfaces and Abstract Classes
134(4)
Nested and Inner Classes
138(2)
Inheritance
140(4)
Sealed Classes
144(1)
Creating and Using Enums
145(3)
Wrapping Up
148(1)
9 Extension Through Delegation
149(26)
When to Choose Delegation over Inheritance?
150(1)
Designing with Delegates
151(5)
Delegating to a Parameter
156(1)
Dealing with Method Collisions
157(3)
Caveats of Kotlin Delegation
160(2)
Delegating Variables and Properties
162(4)
Built-in Standard Delegates
166(4)
Wrapping Up
170(5)
Part III Functional Kotlin
10 Functional Programming with Lambdas
175(28)
The Functional Style
176(3)
Lambda Expressions
179(7)
Lambdas and Anonymous Functions
186(2)
Closures and Lexical Scoping
188(2)
Non-Local and Labeled return
190(4)
Mining Functions with Lambdas
194(7)
Wrapping Up
201(2)
11 Internal Iteration and Lazy Evaluation
203(18)
External vs. Internal Iterators
204(2)
Internal Iterators
206(7)
Sequences for Lazy Evaluation
213(5)
Wrapping Up
218(3)
Part IV Elegant and Efficient Kotlin
12 Fluency in Kotlin
221(28)
Overloading Operators
222(4)
Injecting Using Extension Functions and Properties
226(8)
Extending Functions
234(1)
Function Fluency with infix
235(1)
Fluency with Any Object
236(7)
Implicit Receivers
243(4)
Wrapping Up
247(2)
13 Creating Internal DSLs
249(20)
Types and Characteristics of DSLs
250(1)
Kotlin for Internal DSLs
251(3)
Challenges in Building for Fluency
254(6)
Type-Safe Builders
260(5)
Narrowing Access with Scope Control
265(3)
Wrapping Up
268(1)
14 Programming Recursion and Memoization
269(16)
The Power and Perils of Recursion
269(2)
Tail Call Optimization
271(3)
Memoization
274(5)
Applying Memoization to Dynamic Programming
279(2)
Wrapping Up
281(4)
Part V Programming Asynchronous Applications
15 Exploring Coroutines
285(24)
Coroutines and Concurrency
285(2)
Running Concurrently Using Coroutines
287(6)
Coroutine Context and Threads
293(5)
Debugging Coroutines
298(2)
Async and await
300(1)
A Peek at Continuations
301(2)
Creating Infinite Sequences
303(4)
Wrapping Up
307(2)
16 Asynchronous Programming
309(20)
Programming Asynchronously
309(5)
Exception Handling
314(4)
Cancellations and Timeouts
318(8)
Wrapping Up
326(3)
Part VI Interop and Testing
17 Intermixing Java and Kotlin
329(18)
Joint Compilation
330(3)
Calling Java from Kotlin
333(3)
Calling Kotlin from Java
336(10)
Wrapping Up
346(1)
18 Unit Testing with Kotlin
347(28)
The Code Under Test
348(1)
Getting the Project Files
349(3)
Starting with a Canary Test
352(1)
Writing Empirical Tests
353(3)
Writing Data-Driven Tests
356(1)
Mocking Out Dependencies
357(6)
Testing Top-Level Functions
363(3)
Testing Coroutines and Asynchronous Calls
366(4)
Integrating with the Service
370(1)
Viewing the Code Coverage
371(1)
Taking the App for a Drive
372(1)
Wrapping Up
373(2)
19 Programming Spring Applications with Kotlin
375(12)
Creating a Starter Project
376(2)
Creating a Controller
378(2)
Creating an Entity Class
380(1)
Creating a Repository Interface
381(1)
Creating a Service
381(2)
Integrating the Service with Controller
383(2)
Taking It for a Ride
385(1)
Wrapping Up
386(1)
20 Writing Android Applications with Kotlin
387(18)
Creating a Project
388(2)
Defining Domain Objects
390(1)
Creating Layouts
391(4)
Implementing the Activity
395(4)
Updating the RecyclerView
399(2)
Seeing the App in Action
401(1)
Wrapping Up
402(3)
A1 Transpiring to JavaScript 405(4)
A2 Kotlin/Native 409(4)
A3 Kotlin to WebAssembly 413(4)
Bibliography 417(2)
Index 419
Dr. Venkat Subramaniam is an award-winning author, founder of Agile Developer, Inc., and an instructional professor at the University of Houston. He has trained and mentored thousands of software developers in the US, Canada, Europe, and Asia, and is a regularly invited speaker at several international conferences. He's the (co)author of multiple books, including the 2007 Jolt Productivity award winning book Practices of an Agile Developer.