skn0tt | 4 years ago | on: Show HN: A more social, Amazon-free alternative to Goodreads
skn0tt's comments
skn0tt | 6 years ago | on: Using TypeScript with React
skn0tt | 6 years ago | on: Using TypeScript with React
Apart from that, Elm is a great language! I've been dabbling around with it in the past and I especially liked its great DX and that it's purely functional. Comparing it to ReasonML would be very interesting, too :)
skn0tt | 6 years ago | on: Using TypeScript with React
Also, +1 on tslint and prettier, they're great tools.
skn0tt | 6 years ago | on: Using TypeScript with React
Could you elaborate on why you think that classes should be used when implementing controllers? I tend to think of controller classes as singletons, which kind of contradict using classes in the first place.
skn0tt | 6 years ago | on: Using TypeScript with React
```java
import java.util.HashMap;
class Main {
class Animal {
String sound = "roar";
}
public static void main(String[] args) {
HashMap<String, String> map = new HashMap<>();
Animal animal = (Animal) (Object) map;
System.out.println(animal.sound);
}
}
```At runtime, this will crash with the following Exception: `Exception in thread "main" java.lang.ClassCastException: class java.util.HashMap cannot be cast to class Main$Animal`, but it will satisfy the type system.
skn0tt | 6 years ago | on: Using TypeScript with React
Nonetheless, I think that TS can catch a lot of errors and will help documenting your code - and that's a very good thing on its own.
skn0tt | 6 years ago | on: Using TypeScript with React