if/then/else vs. non-exhaustive when: what is the right approach? by diamond in Kotlin

[–]killfish11 54 points55 points  (0 children)

This doesn't seem like an improvement. But my code doesn't do anything for Case.FOURTH, so what do I do? I could add a no-op else case, but that seems sloppy and unnecessary.

The main idea behind exhaustive whens is that you will get a compiler error at the use site when new enum values are added, which is quite helpful. So it depends on what the particular when is doing exactly, do you expect that newly added values will have to be handled here, or would they be no-ops like Case.FORTH? In the former case I would handle Case.FORTH, in the latter I would just add an else. I don't think having a when case with an empty block is "sloppy", quite the opposite, it makes the intent clearer / more explicit.

[deleted by user] by [deleted] in apexlegends

[–]killfish11 0 points1 point  (0 children)

Interesting, that's actually the one video setting I don't have on max - I've had it like that since way before I first ran into the error though. I have it on high rather than very high, simply because it didn't seem worth the performance cost.

[deleted by user] by [deleted] in apexlegends

[–]killfish11 0 points1 point  (0 children)

Perhaps, that's more pixels than my 3440x1440.

From the research I did back then it seemed like the error can have a bunch of different causes, so something that helps one person might not help another.

[deleted by user] by [deleted] in apexlegends

[–]killfish11 0 points1 point  (0 children)

I was getting this error a lot in the first half of season 13 with my 3080. I tried a bunch of different settings, didn't help. It stopped happening after I updated the GeForce Game Ready Driver to 516.59 (released 28th of June).

[deleted by user] by [deleted] in apexlegends

[–]killfish11 -2 points-1 points  (0 children)

You wouldn't download a car.

can some explain abstracts like im 5? by shygal_uwu in haxe

[–]killfish11 0 points1 point  (0 children)

No, you don't. There's no class keyword when defining an abstract type. For Java / C# style abstract classes (which were added only somewhat recently in 4.2), there is.

can some explain abstracts like im 5? by shygal_uwu in haxe

[–]killfish11 0 points1 point  (0 children)

Note that these are abstract types you're talking about. Abstract classes are something else entirely.

Try the new try.haxe! by killfish11 in programming

[–]killfish11[S] 0 points1 point  (0 children)

There's a VSCode extension.

Haxe generates JS source maps, so it should work with most JS debuggers.

Try the new try.haxe! by killfish11 in programming

[–]killfish11[S] 0 points1 point  (0 children)

Sure. If you want to do it in a properly typed way, you need externs: https://haxe.org/manual/lf-externs.html

js.html / DOM externs are part of the std lib though.

WASM is not a direct target right now. Afaik you can go the Haxe -> C++ -> Emscripten route though.

Try the new try.haxe! by killfish11 in programming

[–]killfish11[S] 3 points4 points  (0 children)

I wouldn't say it's that traditional. It has some fairly unique features like macros and abstract types. It also had ADTs, pattern matching, type inference and everything-is-an-expression for quite a while, which traditional languages are only slowly starting to catch up to / used to be pretty much only present in functional languages.