By Developers, For Developers
PDF Pg | Paper Pg | Type | Description | Fixed on | Comments |
---|---|---|---|---|---|
46 | ERROR | listktsfiles.kts doesn’t work with Kotlin 1.3.0. D:\\dev>kotlinc-jvm -script listktsfiles.kts Turning this into a kotlin file and trying to compile it (wrapping it in a fun main()) yields compiler errors about not knowing about java.io.File as well. Running the same inside a scratch in IntelliJ works fine. So it’s something to do with the runtime environment that’s not mentioned in the book. | 2019-02-21 | Hi Jeroen, \n \nThank you. \n \nI am unable to reproduce this error on two different machines. Not sure if some environment variable is not set properly is causing this. Could you please try with final 1.3 release for Kotlin? \n \nAlso, if you could email me at venkats@agiledeveloper.com may be we can try to figure out the setting this may be casing this. \n \nRegards, \n \nVenkat | |
3 | TYPO | …it offers choices and [let’s] us pick… -> lets | 2018-11-03 | ||
33 | TYPO | …it may have endured for most of your programming [carrier]. -> career Sorry, in the previous errata I reported the page was 18. And the same mistake (improper use of let’s) can be found at the page 109 | 2018-11-03 | ||
46-47 | ERROR | The status in the first canVote function can be a val already, so the argument in favor of expressions for that specific case is not very valid. We’d need another example, or state as an advantage that we can infer the type of status from the if/else expression without having to specify it. | 2018-11-04 | Hi Pere, \n \nThe code example shown is written in Kotlin but like the way it is written in Java and C#. The intent of the example was to show how it is done in those languages where if is not an expression. \n \nGood point about stating about type inference. Will do that. Thank you. \n \nRegards, \n \nVenkat | |
47 | SUGGEST | “If a finally part is present it should not end | 2018-11-04 | Good catch, Pere. Thank you. \n \nVenkat | |
57 | TYPO | “Once again, when two arguments are passed to greet(), the default argument | 2018-11-06 | ||
Any | SUGGEST | Hello, Almost all programming languages use english prepositions (“to”) or pronouns (“what”) and any documentation explaining their usage also uses them as well. If their respective scope is not well defined, it becomes harder to understand a sentence, especially for readers from another mother language (french is my case). A sentence like: Would be much easier to read as: I used double quotes here but italic or any character enhancement dedicated for this would be welcomed. Otherwise, M. Subramanian remains an authority and great professor of programming languages in general. Thanks Jacques Ledoux | 2018-12-15 | ||
94 | TYPO | In the sentence “Kotlin/Native can be used to compile your source code to different native targets like iOs, Linux, MacOS, Windows”, “iOs” should be “iOS”. | 2018-12-15 | ||
90 | TYPO | “To implement system level or backend tasks using Kotlin, create a single Kotlin file and run it as script using the —script option. ” “…—script…” should be “..-script…” | 2018-12-15 | ||
57 | SUGGEST | The example iteration/iterate.kts uses arrayOf(1, 2, 3) and the accompanying text says “Since all the values given are of type Int, the array created in this example is I think a remark (or footnote) to point out the difference with intArrayOf (which will create a primitive int array instead of an object Integer array) would be helpful. | 2018-12-15 | ||
68 | TYPO | Second paragraph, “Both Pair and Tuple are immutable”: Tuple should be Triple | 2019-01-16 | Thank you Mark. \n \nIf you could let me know your full name (here or over email at venkats at agiledeveloper dot com) it will help me to include a thank you in the book's acknowledgement. \n \nThanks \n \nVenkat | |
143 | TYPO | Top of page: | 2019-01-30 | ||
137 | ERROR | The statement “Each call to remote will result in a different instance…” at the bottom of the page is incorrect. This is a field and will always return the same instance. | 2019-01-30 | ||
46 | TYPO | Current sentence: “The spread operator is useful to explode or spread I think what is meant here is: “The spread operator is useful to explode or spread | 2019-02-21 | ||
188 | ERROR | “you may create instances of Set setOf() creates an instance of Set | 2019-02-21 | ||
58 | SUGGEST | It might be useful to also include the withIndex() option here, which allows you to iterate over the collection accessing both index and value at the same time e.g for ((index, value) in array.withIndex()) { | 2019-02-21 | ||
4 | SUGGEST | Minor textual suggestion: I think it would be nice to use one way of writing “boilerplate code” (see for example en.wikipedia.org/wiki/Boilerplate_code). These are the variations you can find by searching for “boiler” (in the pdf version): - page 4: boiler plated code - page 5: boiler plated code and boiler plate code - page 6: boiler plated code - page 58: boiler plated code - page 103: boiler-plated code - page 105: boiler-plate code - (page 111: boilerplate code) | 2019-02-21 | ||
70 | TYPO | Small typo (I think an uppercase ‘L’ should be used instead of a lowercase ‘l’). I think on page 70 the function name for creating a mutable list should be mutableListOf (instead of mutablelistOf). In the rest of the book, the mutableListOf function name is used (page numbers 71, 72, 75, 175, and 203). | 2019-02-21 | ||
161 | TYPO | Some nice message “is”, in the output has been highlighted as a keyword by accident | 2019-02-21 | ||
72 | ERROR | “Sets are unordered collection of elements. … The actual idea and definition for sets is to always guarantee uniqueness of elements (that is, if its contained objects have proper equals and hashCode implementations). Hash sets are unordered, but you can keep insertion order with a linked hash set. | 2019-03-03 | ||
xi | ERROR | Introduction When you write object-oriented code, you will see that the compiler works for you instead of should be or something like that : | 2019-04-14 | Hi, \n \nThank you for the note. I did mean "object-oriented code" in that sentence. In that paragraph we are talking about different styles. I don't think there is an error. Please let me know if you still think otherwise. \n \nAlso, if you could let me know your full name, I will be delighted to thank you in the acknowledgement in the book. \n \nThank you \n \nVenkat | |
47 | TYPO | I think this sentence could be improved by using a lowercase ‘w’ (instead of an uppercase ‘W’) and by adding the word “any” (after “pass”): Original text: | 2019-03-22 | ||
83 | TYPO | I think this sentence could be improved by removing the “’s” after the word “Here”: Original text: | 2019-03-22 | ||
98 | TYPO | A minor textual suggestion: would it be clearer to use “[…] we’re interested in here.” (instead of “[…] we’re interested here.”)? (It might also be nice to add a comma after “equal”?) Suggested text: Original text: | 2019-03-22 | ||
81 | TYPO | “The class Nothing has no instances and it represents a value or result that may never exists.” s/exists/exist/ | 2019-03-22 | ||
73 | SUGGEST | This is about the passage “The - operator is useful to create a new list without the specified element, like this:…”. It seems to remove only the first occurrence of an element in the list, so it may be better to rephrase the passage to something like this: The - operator is useful to create a new list without the first occurrence of the specified element, like this: collections/lists.kts | 2019-03-22 | ||
86 | SUGGEST | It’d be good if the link to the code file <types/safecallreturnstring.kts> is provided. The links to code files are missing in some other places too. | 2019-04-14 | Hi Raghavendra, \n \nThank you for the suggestion. I do not provide links to files when doing so will break the flow for the reader. The files internally I use may vary occasionally compared to what the reader is expected to be using if they were practicing along. \n \nThank you. \n \nVenkat | |
90 | SUGGEST | The book says, “All the references in this example were of type Any . If the reference types were of the specific class types—for example, if the greet reference was defined as type String—then the Kotlin compiler will barf at the equality check due to a type mismatch that can be detected from the source code. We kept the references types as Any to get around that check, in order to illustrate type checking.” However, here is what I get: types/equals.kts val greet: String = “hello” println(odie greet) //false println(odie toto) //true $ kotlinc-jvm -Werror -script equals.kts greet is defined as type String, and kotlinc is not protesting at the equaiity check odie == greet, which seems contrary to the quoted passage. Either I am missing the point, or some explanation may be helpful. | 2019-03-22 | ||
91 | TYPO | “Suppose the Animal class has a age property and we need to use that property s/a age/an age | 2019-03-22 | ||
124 | TYPO | Here’s a way to given an explicit name for the companion object of MachineOperator: | 2019-04-14 | Hi, \n \nIf you mention your full name, if you like, I will be delighted to acknowledge in the book. \n \nThanks \n \nVenkat | |
158 | TYPO | Kotlin nicely takes care of resolving method collisions and also makes it easy to override select [ED] methods of the delegate interface in the delegating class. I also added the typo of page 124. | 2019-04-14 | Hi Adekunle, \n \nThank you for reporting. The word should be select and selected (select as in any methods you choose to). In any case, the copy editor will take care of correcting this. \n \nRegards, \n \nVenkat | |
159 | SUGGEST | Do not know if you want to be strict about optional semicolon : assistant.fileTimeSheet(); | 2019-04-14 | ||
222 | TYPO | May be Should be | 2019-04-14 | ||
185 | TYPO | A few years ago a conference organizer asked if I’d like to talk about Lamb*a*da expressions | 2019-04-14 | Hi Adekunle, \n \nThank you for reporting. The word Lambada is correct in that sentence, I am referring to the dance and not lambda here. \n \nThanks \n \nVenkat | |
212 | TYPO | Let’s replace the sort[ed]By() call in the above example with sortByDescending() to see this in action: There is only sortedBy() and no sortBy() | 2019-04-14 | ||
250 | TYPO | That can be a lot of effort, and you have to balance that agains[*] the flexibility you get. | 2019-04-14 | ||
315 | TYPO | The reason for this behavior is that coroutines started using launch() don’t propagate exceptions to their caller. | 2019-04-15 | Hi Adekunle, \n \nMy apologies, I am not able to detect the error in that sentence. Could you please point out what's incorrect. \n \nThanks \n \nVenkat | |
318 | TYPO | Don’t know what is intended here : “Both Job, which is returned by launch(), and Deferred | 2019-04-14 | ||
102 | TYPO | In the “Star Projection” section, just before the types/star.kts example - use “piece” instead of “pice”: “Here’s a piece of code to use star projection:” (instead of “Here’s a pice of code to use star projection:”) | 2019-04-14 | ||
119 | ERROR | Hello! In the access modifiers section of the book, it lists the four possible access modifiers: public, private, protected and internal. The next sentence following the listing states that “the first three have the same meaning as in Java”. This isn’t exactly true for protected. Kotlin’s protected is equivalent to private + visible in subclass, whereas Java’s protected is equivalent to package private + visible in subclass. Thanks! | 2019-04-14 | ||
5 | SUGGEST | The terminology infix annotation is not strictly correct. I would suggest replacing it with infix notation as used later in the chapter on this subject. | 2019-05-15 | ||
34 | TYPO | Second paragraph, third sentence: “Let’s rework the about code”, should be “above code” | 2019-05-15 | ||
51 | TYPO | “You may pass a variable number of arguments to functions without loosing compile-time safety” Did you mean “losing compile-time safety”? | 2019-05-15 | ||
ix | ERROR | About #84653 : Hi Venkat Thx for tour reply. | 2019-05-15 | Thank you for the response. I will leave it to the copy editor to make necessary changes where needed. \n \nVenkat | |
193 | ERROR | In the ePub version of the book the line numbers printed are out of sync with the lines printed in the non-local return example. The line 5 reference is therefore confusing. In the PDF the line number reference is correct. A screenshot is available if reproduction is hard or my description is poorly described. | 2019-08-15 | ||
326 | TYPO | The last sentence just before Wrapping Up: “The coroutines that took its sweet time got canned” should be “got canceled” | 2019-05-15 | ||
60 | ERROR | Hi, I had to use the full path of the kotlinc-jvm executable, like so : #! /opt/idea-IC-191.6707.61/plugins/Kotlin/kotlinc/bin/kotlinc-jvm -script | 2019-05-15 | ||
234 | SUGGEST | Note : I use the epub version, and it is not possible here to give the epub version page number !! Very bad… In Part 1.6 “Generics: Variance and Constraints on Parametric Types”, p. 234 epub version, the paragraph about “Type Invariance” begins as follows : | 2019-06-11 | ||
68 | ERROR | The paragraph starting with “A word of caution…”, has got the collection and reference the wrong way around - the collection can be changed but the reference not. There’s also a typo: “there’s no guaranteed…” should not have the ‘d’. | 2019-08-12 | ||
326 | ERROR | Is it the correct approach to have a SupervisorJob declared as the context of the coroutine obtained with the launch builder when discussing default coroutine ex. handling behavior? The line of code I’m referring to is this one: | 2019-08-12 | ||
425 | TYPO | “On the receiving end, the parameters | 2019-08-12 | ||
373 | TYPO | “getAirportStatus calls getAirportData asynchrously” { -> asynchronously | 2019-08-12 | ||
24 | TYPO | in an fateful termination -> a fateful | 2019-08-12 | ||
26 | TYPO | preemptive strike agains potential errors -> against potential | 2019-08-12 | ||
67 | TYPO | The withIndex() is but one | 2019-08-12 | ||
67 | TYPO | The withIndex() is but one | 2019-08-12 | ||
67 | TYPO | The withIndex() is but one | 2019-08-12 | ||
70 | SUGGEST | “When used on the left-hand side, the index operator [] | 2019-08-12 | ||
84 | TYPO | String? will becomeS String | 2019-08-12 | ||
96 | TYPO | Kotlin permits contravariance | 2019-08-12 | ||
96 | TYPO | an object of a GENETIC object of derived type | 2019-08-12 | ||
104 | TYPO | fun The first left angular bracket has a different color than right one (fun | |||
105 | SUGGEST | Maybe this signature inline fun | 2019-08-12 | ||
105 | SUGGEST | It seems to that this sentence is no complete “Keep your eyes open for functions that use reified type parameters as you | 2019-08-12 | ||
114 | SUGGEST | fun precision(): Int = throw RuntimeException(“Not implemented yet”) Maybe is more appropriate in this case to use the TODO top level function declared in Standard.kt (the reader can also see another usage of the Nothing type). The example would became: | 2019-08-12 | ||
147 | TYPO | for any of the derived class —-> classes | 2019-08-12 | ||
158 | SUGGEST | I’d also mention that one additional pro of the approach presented in “Delegating to a Parameter” is also testability. The Manager class can be easily provided with a convenient implementation of Worker. This is not possible in the example presented in the paragraph “Delegation using Kotlin’s by”. | 2019-08-12 | ||
164 | TYPO | a delegate that filter out —-> filters out | 2019-08-12 | ||
192 | TYPO | if (it == 2) { return } //ERROR, return is not allowed here // —-> the final “//” in the comment is not necessary | 2019-08-12 | ||
193 | TYPO | line in the the overall context —-> “the” is repeated | 2019-08-12 | ||
198 | SUGGEST | Paragraph “Inline Optimization”. | 2019-08-12 | ||
202 | TYPO | The reason is by the time —-> …is THAT by ? | 2019-08-12 | ||
202 | TYPO | will be not be permitted | 2019-08-12 | ||
210 | SUGGEST | Example: val totalAge2 = people.map { person -> person.age }.sum(). I was wondering if a reference to the sumBy function would be useful at this stage to remove the map function and reduce the amount of code. | 2019-08-12 | ||
210 | SUGGEST | In the diagram that represents the filter -> map -> map -> reduce pipeline I’d put in emphasis that the operations are executed on the whole list for each operator (filter all the list, then the resulting list is passed to the first map and so on). At a glance I read it from right to left following the horizontal arrows for every element in the input collection. | 2019-08-12 | ||
217 | SUGGEST | When speaking about the pros and cons of eager vs lazy evaluation related to collections and sequences there is no reference to the fact lambdas in sequences cannot be inlined so anonymous class are used under the covers. | 2019-08-12 | ||
218 | SUGGEST | (2..n - 1) —-> (2 until n) | 2019-08-12 | ||
218 | TYPO | sequence of prime numbers start with 5 —-> … starting with … | 2019-08-12 | ||
219 | ERROR | “The call to take() triggers the evaluation of the elements in the sequence, but Shouldn’t it be the call to toList() to trigger the evaluation since take() is an intermediate operation? | 2019-08-12 | ||
229 | SUGGEST | Maybe it’s worth mentioning that by adding the operator keyword to the extension function signature the code “circle.contains(point2)” could be written as “point2 in circle”. Sounds good :) | 2019-08-12 | ||
229 | SUGGEST | #85622 is wrong. The same suggested example is reported on page 230. Sorry | 2019-08-12 | ||
230 | SUGGEST | “method in Circle with operator” the operator keyword should use a different style | 2019-08-12 | ||
236 | SUGGEST | Function andThen signature: in fun <T, R, U> the color of “<T” should be black. | |||
238 | SUGGEST | “Specifically Kotlin’s Any class has four significant methods that can make code I don’t get why those methods are specifically associated with the Any class in the book. They are top level functions declared in Standard.kt and available to any type given they operate on generic types and are not specifically declared for Any. | 2019-08-12 | ||
239 | ERROR | val result1 = str.let { arg -> This code does not compile: “this is not defined in this context”. “this” inside the lambda does not exist, the only argument is “arg” given that the function type of the let function param is defined as (T) -> R and not as T.() -> R. The same goes for “also”: val result2 = str.also { arg -> | 2019-08-12 | ||
246 | SUGGEST | IMHO the section entitled “Passing a Receiver” should be treated before the section that presents some of the most used Scope functions. It would help readers to grasp the notation used by the function type parameters that have a receiver. | 2019-08-12 | ||
663 | ERROR | Hi, I am working on a Linux Ubuntu machine. | |||
102 | TYPO | “Thankfully, we have a much better alternatively in Kotlin—reified type parameters.” Should be “alternative” | |||
185 | 168 | ERROR | There’s a part on that page that says “Once the expression within the lambda is evaluated, the delegate will memoize the result and future requests for the value will receive the saved value. The lambda expression is not reevaluated.” Unless I’m misunderstanding precisely what you mean by memoization here, I do not think this is correct. I wrote some code locally expanding on the “lazyevaluation.kts” example to prove this to myself. When referring to the same ‘temperature’ value, the ‘getTemperature’ function is not executed again. But, when actually calling ‘getTemperature’ again (and passing it the same arg as before) it does get executed again. Based on the statement in the book, I expected this function to not be executed again (within some reasonable scope). Maybe it’s not technically incorrect, but some rephrasing or clarification of what precisely is getting memoized, or what you should be using in subsequent code (the value, or another call to the function) in order to take advantage of the memoization would be helpful. Re-reading the original book text after laying it out here makes me believe it is not strictly an error in the text, perhaps just something that could be communicated with more precision. | ||
75 | SUGGEST | In the section called “Wrapping up” it says “Kotlin’s Pair and Triple are useful to create finite small-sized collections. For a larger fixed-sized collection, reach for the Array class.” Here you should repeate the recommendation given on page 68: “If you need to group more than three immutable values, then consider creating a data class”. So the wrapping up on page 75 should be something like “Kotlin’s Pair and Triple are useful to create finite small-sized collections. If you need to group more than three immutable values, then consider creating a data class. For a larger fixed-sized and mutable collection, reach for the Array class.” | |||
58 | SUGGEST | Just above the code iteration/withIndex.kts, the paragraph starts “Alternatively, we can get both the index and the position in one shot”. I think it should be “Alternatively, we can get both the index and the value in one shot” or “Alternatively, we can get both the index and the value at the position in one shot” This code is also an example of destructuring, but noting that probably takes focus away from iteration. | |||
259 | SUGGEST | In the example dsl/meetingdsl.kts I was trying to complete the example before reading the solution. I came up to a different solution that achieves the same result (readability and “type guidance”) by defining “start” and “end” as constants of two different enums (nested in the Meeting class) and by declaring at() an by() as extension functions respectively on “start” and “end”. Maybe it’s a bit less longer than the proposed solution… | |||
261 | ERROR | fun main() { p { “This is a sample” } is missing a “+” in front of the String (the same holds for the subsequent example). | |||
12 | ERROR | (On Linux) the example using “#!/usr/bin/env kotlinc-jvm -script” doesn’t work: /usr/bin/env: ‘kotlinc-jvm -script’: No such file or directory It needs to be “#!/usr/bin/env -S kotlinc-jvm -script”. (But “#!/usr/bin/env kotlin” also seems to work fine.) | |||
8 | 8 | TYPO | running/Hello.kt <<— what is that? The above does not compile… If I remove the “running/Hello.kt” it does run. | ||
32 | ERROR | Original: With no arguments the trimmargin() method removes the spaces until the leading | character. Proposed correction: With no arguments the trimmargin() method removes the spaces until AND INCLUDING the leading | character |