HackerTrans
TopNewTrendsCommentsPastAskShowJobs

X0Refraction

no profile record

comments

X0Refraction
·2 माह पहले·discuss
> Why though? What do you gain other than longer stacktraces with all those wrappers? People always trot out some theoretical notion that a caller is going to catch that framework's different exceptions and handle them differently, but have you ever seen calling code that actually did that?

You've never seen a try that has more than 1 catch block for different exception types?

> There are many different kinds of values. There really aren't that many different kinds of error - there's "transient error that you might want to retry", "programmer called the API wrong", and that's about it, most other cases (like bad user input) probably shouldn't be exceptions.

Do you think bad user input should be a result type? Because exceptions are essentially the same thing.

You've hit on a couple of problems with exceptions in Java though. The first is I think the default for checked exceptions should be no stack trace. As the designer of the method you've left it to the caller to decide to handle it or not, if they choose to turn it into an unchecked exception then I believe that is where the stack trace should start from. Assuming there's enough context in the checked exception the designer of the method gave you everything you needed to handle it so why do we need to capture that part of the stack trace? If it ends up getting logged the source of the issue was where it was changed to an unchecked exception.

The other issue comes down to usability. Try catch blocks aren't expressions so if you want to default something in the case of a checked exception it's a lot of low information density lines. Converting to an unchecked exception is also more ceremony than it really needs to be, but there's not really a reason why it couldn't be made simpler with some syntax sugar.
X0Refraction
·2 माह पहले·discuss
Not sure I'm following honestly. Your primary goes down and it fails over to the secondary (which becomes the primary), but if you can't boot how do you then get another secondary ready to fail over to again when the new primary inevitably fails?
X0Refraction
·2 माह पहले·discuss
What language doesn't allow memory leaks?
X0Refraction
·2 माह पहले·discuss
Why would the law being different mean they wouldn't use 3DS though? Surely it'd cut out a good amount of fraud along with the realtime monitoring? I understand that US consumers don't have a stake in this, but can't all the banks just agree to enforce 3DS? I can't imagine Americans are going to stop using their cards because of a small amount of friction added
X0Refraction
·3 माह पहले·discuss
Being a burden on the healthcare system in a country that has nationalised healthcare is being a burden on everyone through increased taxes and reduced spending in areas the money could be more useful.

Those erratic behaviours you talk about are generally illegal in most countries as well with drink driving, public intoxication, assault laws etc.

Drinking does have some positives as well, pubs are one of the few third spaces we have remaining. I know there are alternatives, but there are people who won't socialise in a cafe or a book club, but will go to the pub to see the regulars. Considering lots of Western countries have loneliness epidemics I think there'd be a downside to removing that option.

Drinking does seem to lubricate social situations, weed can help with pain etc. The only upside from smoking for the individual as far as I can tell is that it fixes the problem it created from you being addicted to it i.e. you get calmer when you get your fix.
X0Refraction
·3 माह पहले·discuss
I think there is a reasonable argument to be made that they're a different degree of societal problem. I think there's quite a few people who drink on special occasions, but not every week or even every month (I'm one of them).

I think it's very rare though for a smoker to not smoke several a day. A friend of mine was that rare breed and would buy a 10 pack occasionally - usually on a Friday and it'd be gone by Monday - but that would maybe be once a month. I think every other smoker I've met though goes through that amount every day.

So it seems to me the average smoker is much more likely to become a burden on a nationalised health service than the average drinker. There's more to this of course, smoking to excess generally doesn't increase the chances of you getting into a fight like drinking does for some people, but social pressure counters that partially too.
X0Refraction
·8 माह पहले·discuss
Won't that particular code fail to compile in java because the return is unreachable?
X0Refraction
·4 वर्ष पहले·discuss
It takes a long time to introduce a new cat, we have 3 indoor cats all introduced one at a time. It took around a month for both the second and third cat to be completely accepted.

The approach we took was to keep the new cat in a separate room for the first few days to allow them to begin to get used to the new scent. We would then swap blankets to give them further time to get used to each other's scents. Then we'd open the door and allow them to interact under supervision for short periods and then we gradually increased the time they could interact each day.

I'm not sure this would work if you had outdoor cats. We didn't actually intend to get the third cat, but we ended up taking him in as our friend's original cat refused to acclimate to the point that he was spending all but 20 mins a day outside of the house and so they needed a good home for their new cat.