Conversation
Response to reviewer comments
Clarified maximum and minimum value references for Kotlin types.
|
My recommendation is:
If you hate my version and want a total rewrite, that is a separate problem we will need to address! Also: I made some recent changes to PR #711 to address review comments, so it may be worth waiting until that is merged. |
| "colinleach" | ||
| ], | ||
| "contributors": [], | ||
| "blurb": "Kotlin has a variety of integer and floating point types, and a math library to manipulate them." |
There was a problem hiding this comment.
| "blurb": "Kotlin has a variety of integer and floating point types, and a math library to manipulate them." | |
| "blurb": "Kotlin has a variety of integer and floating point types, and a math library to manipulate them." |
There was a problem hiding this comment.
I'll make changes in PR #711 (I can't edit this PR)
| Assigning larger values will cause ["overflow"][wiki-overflow], causing either an exception (_bad_) or corrupted data (_worse_). | ||
|
|
||
| - Integers can be `Byte`, `Short`, `Int` or `Long`, respectively 8, 16, 32 and 64 bits (1, 2 4, 8 bytes). | ||
| - Unsigned integers have a `U` prefix: `UByte`, `UShort`, `UInt` or `ULong`. |
There was a problem hiding this comment.
We should explain signed versus unsigned at some point before this.
There was a problem hiding this comment.
There isn't much "before", so I tried to clarify these bullets.
There was a problem hiding this comment.
I am now reviewing this and I saw that is a suggestion I already made on the concept doc.
| - Unsigned integers have a `U` prefix: `UByte`, `UShort`, `UInt` or `ULong`. | ||
| - Floating point types are `Float` (32-bit) or `Double` (64-bit). | ||
|
|
||
| Integer variables relying on type inference default to `Int`, even on 64-bit machines, but floating point variables default to `Double`. |
There was a problem hiding this comment.
Would students be expected to know what type inference is by this point?
| val lightSpeed = 3.0e8 // scientific notation (units of m/s) | ||
| ``` | ||
|
|
||
| Hexadecimal and binary literals are conventional: `0x7F` and `0b100101` respectively. |
There was a problem hiding this comment.
conventional relative to what? What makes them a hexadecimal or binary literal specifically?
There was a problem hiding this comment.
I am now reviewing this and I saw that is a suggestion I already made on the concept doc.
| } | ||
|
|
||
| @Test | ||
| fun `calculate working cars per minute with 0 production rate`() { |
There was a problem hiding this comment.
| fun `calculate working cars per minute with 0 production rate`() { | |
| fun `calculate working cars per minute with 0 success rate`() { |
Response to comments in exercism#713 (@BNAndras)
This ports the cars assemble from the Go track. The reason for going with the Go version instead of Java is that the Java version uses
ifstatements in the same exercise, which I thought could be a separate concept.This is a draft as it still missing an introduction (I plan on doing writing an introduction based on the concept introduction before taking this out of draft).