Hacker Newsnew | past | comments | ask | show | jobs | submit | ahci8e's commentslogin

Uff, yeah. I used to work with a guy who would immediately turn the panic up to 11 at the first thought of a bug in prod. We would end up with worse architecture after his "fix" or he would end up breaking something else.


I have a Supernote A5X! It's great! I got it to replace my old rm and never looked back. I also recently bought the Supernote A6X2. Not sure which I prefer size-wise. Sometimes the smaller A6X2 is great, especially for reading. Other times drawing on the A5X is more comfortable.

One thing I don't like about the A6X2 is that there is a noticeable gap between the screen and the pen. This gap isn't there (or maybe is just way smaller) on the A5X. The screen on the A6X2 is also textured, I guess to try to mimic paper, but I grew to like the gel pen feel of the A5X screen.


Also a very happy user of the A5X. Using it for about 3 years now, with a Lamy pen. I could not imagine reviewing papers sent to me as pdf without it.


How would this work if I need to update multiple variables?

  int value1 = 0;
  int value2 = 0;
  if (condition) {
    value1 = 8;
    value2 = 16;
  } else {
    value1 = 128;
    value2 = 256;
  }
Would I have to repeat the if expression twice?

  int value1 = if (condition) { 8 } else { 128 };
  int value2 = if (condition) { 16 } else { 256 };


Depends on the language a bit, but a common feature in these languages is the tuple. Using a tuple you would end up with something like:

let (value1, value2) = if (condition) { (8, 16) } else { (16, 256) }

Or else you’d just use some other sort of compound value like a struct or something. Tuple is just convenient for doing it on the fly.


hah we gave basically the same example on the same minute.

I love destructuring so much, I don't know if I'd want to use a language without it anymore.


It’s actually so painful to go back to languages without destructuring and pattern matching.


As someone who writes a fair bit of c# making switch and if's into expressions and adding Discriminated Unions (which they are actually working on) are my biggest "please give me this."

Plus side I dabble in f# which is so much more expressive.


Same for me in the Scala vs. Java world, it's hard once you get used to how awesome expressions over statements and algebraic data types/case enums/"discriminated unions" are. But I haven't done much C# (yet) myself, could you clarify for me: does C# have discriminated unions? I didn't think the language supported that (only F# has them)?


The c# team is working on a version of them they are calling Typed Unions, not guaranteed yet but there is an official proposal that I believe is 2 weeks old.

https://github.com/dotnet/csharplang/blob/main/proposals/Typ...


Cool, thanks for answering


Depends on the language. if you have destructuring you can do it all at once.

So like I believe you can do this in Rust (haven't written it in a while, I know it has destructuring of tuples)

let (a, b) = if (condition) { (1, "hello") } else { (3,"goodbye") }


.. save yourself an else :

int value1 = 128;

int value2 = 256;

if (condition) {

    value1 = 8;

    value2 = 16;

  }


Almost zero drama, yeah. I do remember the dep drama though...


And the telemetry drama.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: