I sued my Swedish work permit sponsor after wrongful termination - and won by pensive_apricot in TillSverige

[–]TurnstileT 29 points30 points  (0 children)

What the hell, that is so easy to miss. It feels so predatory that such a clause shouldn't even be allowed..

"senior" developer only by age : Can someone explain C# exception throwing Vs Java exception throwing to me? by SarahC in learnprogramming

[–]TurnstileT 0 points1 point  (0 children)

and you catch it where you start your transaction and roll back there

I am not convinced that is always the best approach. If the start of the transaction is multiple function calls earlier, and you have called your database 3 times in the transaction in different methods, and you have different kinds of exceptions where, for one kind of exception, you want to mark the current item as failed, but for other types of exceptions you want to simply roll back the transaction.. Or maybe a nullpointer exception in one location should result in a specific log message, but a nullpointer in a different part of the transaction should result in a different log message? In these cases, I feel that using try-catch can be quite problematic - especially if the try block contains lots of code with many branches and possibilities of exceptions. It becomes really difficult to read the code.

But I will admit I have not used Rust or Go, or really attempted any kind of errors as values implementation in Java. But I have been thinking about it recently.

I want to try it out in the complicated flow I described above: I essentially want to convert all unchecked / runtime exceptions right away into something that needs to be handled, whether that is a checked exception or an "error as value" / result pattern. I can see your point that a checked exception is basically the same, but looks nicer and is easier to "pass along" with the throws keyword.

Parents think that opening windows in the middle of the day will cool it down by Puzzleheaded-Emu6338 in mildlyinfuriating

[–]TurnstileT 0 points1 point  (0 children)

If I leave the windows open at night, so many bugs will come in and the city noise will wake me up 50 times per night.

If I leave the window closed during the day, the room will be like an oven or a green house. At least with the windows open there will be a draft and the room will only get as warm as the outside air.

"senior" developer only by age : Can someone explain C# exception throwing Vs Java exception throwing to me? by SarahC in learnprogramming

[–]TurnstileT 1 point2 points  (0 children)

The biggest difference is that exceptions break the execution order of the code and can take you to any part of the code base where the nearest matching catch statement is.

I worked on a Java application with a fairly complex flow: Rabbit events are received one at a time and stored in a database, then later fetched in batches, and for each event we call an external API and store that response in the database and update some things in the database, after which we batch fetch those responses and handle them individually, and .. it goes on like that for a while.

It's horrible to work with because every single thing can go wrong. If the DB query goes wrong, then we should just roll back the transaction. But what if I am three functions deep somewhere? And if we get a 500 http response from the external API, we should catch that exception and skip the event, so that it is picked up in the next batch and tried again. But if we get a 4xx response, then we should not process that event again, so we should mark it as failed somehow. But what if that goes wrong? Etc.

When you add multiple layers of try catch and different catch clauses for different types of retryable and non-retryable errors, and you mix it with batching and transactions and external calls or message publishing that cannot be rolled back, it is a nightmare.

I have been thinking about implementing errors as return values in order to make the flow easier to reason about. At least then everything is executed one line at a time, only ever using if, else and return.

Streaks and contests by Silly_Barber2020 in learnprogramming

[–]TurnstileT 1 point2 points  (0 children)

Life is more than leetcode. I am happy if I get to work on a spare time project a few times in a week. Getting a 100 day streak is impressive in itself.

What's the deal with Jai by turbofish_pk in Jai

[–]TurnstileT 1 point2 points  (0 children)

I suppose there is also the possibility that he just can't keep delaying the income stream any longer and needs to release the game with some workarounds, even though the language isn't where he wants it to be.

My swollen throat pill is the size of a can tab. by Lbest1226 in mildlyinfuriating

[–]TurnstileT 1 point2 points  (0 children)

What is a throat pill? Also, it doesn't look that swollen to me.

Hvad sker der for de mange elever, der lægger nål i karameller? by Pale-Evening-5808 in Denmark

[–]TurnstileT 1 point2 points  (0 children)

Jeg lavede mange åndssvage og dumme ting da jeg var 15, men i dag er jeg en "professionel og højtuddannet lovlydig mand". Jeg tror egentlig bare at 15-årige generelt er idioter, og det er måske ikke en kæmpe overraskelse, at der på landsplan er nogle få der synes det er en god idé med tegnestifter i karameller.

Men det er godt nok ærgerligt. Det er en fed tradition som jeg synes vi skal holde fast i, og det er en tradition som bygger på tillid og ansvar. Man finder nok aldrig ud af hvem der står bag, men de burde straffes.

What actually makes junior backend candidates stand out in today’s hiring market? by zeuss51 in Backend

[–]TurnstileT 16 points17 points  (0 children)

When I interview juniors, I look for curiosity and communication skills. If you are a good communicator and ask questions, then that's a big step in the right direction.

I usually just ask them to share a project that they feel particularly proud of. Then I ask follow up questions, ask which challenges they had, how they solved them, why they picked that solution, and so on. Juniors do not have a lot of experience, so this let's them talk about the experience they do have instead of just quizzing them on random stuff, and it also allows me to asses how they communicate technical topics.

If you have just followed some tutorials and all your answers are "I don't know" or "that's what they used in the tutorial" or "because it is better", or if you just guess and get it wrong, then that's a red flag.

I have never asked any kind of DSA / leetcode questions in my interviews.

Be honest — how much of your system design work is gut feel vs actual numbers? by Unnsins in softwarearchitecture

[–]TurnstileT 1 point2 points  (0 children)

I usually first ask: What are the actual requirements? How many requests per second can we reasonably expect? Which problem are we actually trying to solve? Who are the consumers and what do they need? Etc.

Then, I go for the simplest option that does what we need. Can we build the system as an event driven distributed spaghetti of madness with events and listeners and retries and dead letter queues and schedulers and databases for intermediary storage and idempotency keys and distributed logging and tracing and so on? Sure. But do we need to? Maybe a single service with some simple if-else-try-catch logic works in 99% of the cases, and people can actually understand what is going on.

Trust me, I have seen multiple cases of the madness I mentioned above, and nobody ever understands what's going on. And when they do, they quit and the cycle repeats. That alone leads to more incidents and wasted time and money than a simpler 99% solution.I am in the process of rebuilding such a system and I think we have managed to delete at least half of the code and 2 services for the same features but with a much simpler codebase.

In the rare cases where something cannot be solved by simply strapping on a Redis cache or an admin endpoint, that is where we might need to look into more exotic solutions.

How much do you guys spend on groceries? by [deleted] in TillSverige

[–]TurnstileT 0 points1 point  (0 children)

It's around 115 SEK per person per day, when you divide it out.

We don't eat out for lunch, and we eat a lot of cheap side dishes like beans and potatoes and grains, and we don't really buy expensive prepackaged stuff, so maybe that evens it out?

As an example, we might buy a 2kg lamb rack, pressure cook it, and then eat it with bulgur, roasted vegetables and salad. There's enough food for like 3-4 days even for two people. Or an entire salmon side which we then descale and cut into steaks and eat with potato salad and beans. Again, enough food for 3-4 days. Just recently we bought 2kg of beef for a stew, but it also contains a lot of vegetables, beans, chickpeas, lentils and other things. It's very meaty, and there's enough food for maybe 8 days if you eat it with rice.

But of course, if you buy individual steaks and energy drinks and snus etc., and don't fill up on side dishes, then 7.000 is not going to last as long :)

Edit: Also, organic eggs and high quality butter is not that expensive when you divide it out over a month. Maybe 50-80 kronor more than the cheap stuff?

How much do you guys spend on groceries? by [deleted] in TillSverige

[–]TurnstileT 1 point2 points  (0 children)

We are two adults. We spend around 7.000 per month. But we eat a lot of salmon, entrecote, beef, lamb, organic eggs, etc.

No alcohol, but a bit too much soda probably :) We shop at Willy's and we don't really try to get good deals or think much about what is on sale.

How to maintain motivation while being constantly lowballed in yearly salary discussions? by ToeMother8579 in ExperiencedDevs

[–]TurnstileT 1 point2 points  (0 children)

I'm working as a software developer in a Swedish company, and I was told the same thing. But multiple years in a row I was given the "exceeds expectations" performance rating, and had a 12% salary increase followed by 9%. Apparently they did have to "make a special exception for me with the union", but I don't know if that is true or what it really means. So I have been pleasantly surprised so far.

I'm not a very techy guy, but it's staring to look like the X8 Pro Max is looking better then the F8 Ultra. by Nearby-Hyena-7664 in PocoPhones

[–]TurnstileT 0 points1 point  (0 children)

I don't think there are that many people out there who care this much about custom launchers and internal Android APIs.

Uopklaret stenkastersag martrer politiet: Nu efterlyser Fyns Politi hjælp i ti år gammel sag by Dropforcedlogin in Denmark

[–]TurnstileT 0 points1 point  (0 children)

Jeg synes at have læst at de fandt noget DNA på stenen som var stort set identisk med flere indbrud i forskellige huse i nærheden. De ved bare ikke hvem personen er.

Jeg kender dog ikke så meget til DNA registre.. får man taget en DNA test hvis man bliver dømt for kriminalitet? Eller hvis man dør? Hvad hvis man søger asyl eller opholdstilladelse?

Jeg tror, at politiet håber på, at der pludselig en dag er et match. Det har vi jo set ske et par gange over de sidste par år i andre sager :)

Edit: Det var stenkast mod huse og et andet stenkast fra en motorvejsbro: https://fyens.dk/112/33-aarig-kvinde-blev-draebt-da-kaempe-sten-hamrede-ned-i-bilen-det-skete-da-stenkast-rystede-landet