News for hackers. Stuff that matters.
Re:Don’t assume that safety comes for free: a Swift case study by mikeash on Tuesday December 06, 2016 @02:04PM (#13117307)
Displaying corrupt data in the UI can be just as bad as saving it to disk, if the user actually reads and uses the data you display (and if not, why are you displaying it?).

And since the UI almost certainly shares data with the rest of the program, bugs in the UI can corrupt the underlying data.

Separation of concerns is great, but if you really want different parts of your system to have different reliability constraints, then you need to truly separate them, for example by running them in different processes. Running them in the same process but having some of the code be more lax about state because it's less important is just begging for horrible bugs.

Re:Don’t assume that safety comes for free: a Swift case study by lomnakkus on Tuesday December 06, 2016 @02:15PM (#13117389)
> Separation of concerns is great, but if you really want different parts of your system to have different reliability constraints, then you need to truly separate them, for example by running them in different processes. Running them in the same process but having some of the code be more lax about state because it's less important is just begging for horrible bugs.

Indeed, and you might even want to run them on entirely different and independent systems (connected by some type of network/bus) depending on exactly what bits are critical vs. non-critical.

Re:Don’t assume that safety comes for free: a Swift case study by IgorPartola on Tuesday December 06, 2016 @08:14PM (#13119744)
Why can't it be opt-in instead of opt-out? Or can we have more granular control overall? On an application, module, class, function, and block level? That way my super tight hit loop that I can prove does not overflow gets a 2x speed up, while the rest of the code is safe. Oh and I can always recompile it to be always safe and analyze crashes in the real world, no t just my silly unit tests that amount to 2 + 2 == 4.
Re:Don’t assume that safety comes for free: a Swift case study by stouset on Tuesday December 06, 2016 @10:25PM (#13120212)
Continuing on as a default is dangerous, and has led to hundreds of thousands of security vulnerabilities. Not continuing is inconvenient, but safe.
Re:Don’t assume that safety comes for free: a Swift case study by emodendroket on Tuesday December 06, 2016 @11:08PM (#13120403)
Maybe it's time to bring back VB6 and On Error Resume Next.
Re:Don’t assume that safety comes for free: a Swift case study by flukus on Tuesday December 06, 2016 @11:17PM (#13120423)
It never went away, now it's just "catch (Exception) { }" spread liberally throughout the code base.
Re:Don’t assume that safety comes for free: a Swift case study by vurpo on Wednesday December 07, 2016 @02:15AM (#13121039)
How to fix all errors in Python:

  try:
    #your code goes here
  except:
    pass
Re:Don’t assume that safety comes for free: a Swift case study by emodendroket on Wednesday December 07, 2016 @09:27AM (#13122701)
Well, technically the behavior of that is somewhat different.