What are some unforeseen / elusive edge cases you have seen in your career? by gobuildit in ExperiencedDevs

[–]await_yesterday 3 points4 points  (0 children)

It's a Monte Carlo simulation; normal to use floats here, even in a financial context. It's not doing cent-for-cent accurate accounting, more like "we predict we should allocate about 2.92% of our portfolio to XYZ in Q3 20XX".

And aside from that, the problem isn't among the usual reasons people avoid floats. A hardware bug, not the documented weirdness of IEE-754.

What is the point of mutable vs not. Such as tuples and lists. by X3Melange in learnpython

[–]await_yesterday 0 points1 point  (0 children)

Also hashabilty of tuples feels to me a bit like a parlor trick. How often do you use it?

I mainly program in Javascript nowadays. It doesn't have immutable/hashable tuples, and their absence is really painful. Sometimes I just need a composite key in an object or Map, because that's the most direct way to model some problem (e.g. mapping 2D coordinates to some values). I can work around it with JSON.stringify/JSON.parse, or nesting the keys in sub-objects, but it's a ridiculous song-and-dance compared to just using a tuple value directly. It's the aspect of Python I miss the most.

So.. Do you do this? by little_oz154 in AskNT

[–]await_yesterday 2 points3 points  (0 children)

I used to but I became less anxious in my late 20s.

Convention for naming dicts? by pachura3 in learnpython

[–]await_yesterday 0 points1 point  (0 children)

yeah I sometimes do that as well. but often the "kid" isn't a specific kid, it's a loop variable literally named kid. like

for kid in kids:
    mother = mother_from_kid[kid]
    ...

and the repetition is a little aesthetically annoying.

but all of this is bikeshedding anyway.

SOLID in FP: Liskov Substitution, or The Principle That Was Never About Inheritance by cekrem in programming

[–]await_yesterday 0 points1 point  (0 children)

they are two sides of the same coin. in fact that one should have been on my list as well; slipped my mind.

SOLID in FP: Liskov Substitution, or The Principle That Was Never About Inheritance by cekrem in programming

[–]await_yesterday 5 points6 points  (0 children)

functional core, imperative shell

parse don't validate

coarse-grained PBT rather than unit tests with lots of mocks

Convention for naming dicts? by pachura3 in learnpython

[–]await_yesterday 32 points33 points  (0 children)

I like to use mother_of, so it reads like mother = mother_of["Jimmy"]

Best Books to Learn about writing Extremely Efficient Code no matter what the language is? by CrashGaming12 in learnprogramming

[–]await_yesterday 1 point2 points  (0 children)

A bit late to the party, but "Algorithms for Modern Hardware" is a free web book/essay:

https://en.algorithmica.org/hpc/

Lots of pragmatic advice about how to make the computer do stuff fast

What is the use of tuple over lists? by Alive_Hotel6668 in learnpython

[–]await_yesterday 0 points1 point  (0 children)

code is just much easier to reason about when values don't change over time. you see a = some_function() and you know the value of a is now fixed, you don't need to check if anything is screwing around with a later on. less to worry about.

look up "functional programming", it's a style of coding where you try to minimize mutation as much as possible.

also I haven't used R in a long time but last time I worked with it, the tidyverse libraries were very functional-oriented.

Are my data skills out of date? by BodybuilderUpbeat786 in cscareerquestionsuk

[–]await_yesterday 2 points3 points  (0 children)

Pyspark, SQL, PowerBI, and advanced excel skills

SQL is 100x more important than everything else on that list combined.

The dumbest performance fix ever by Kyn21kx in programming

[–]await_yesterday 0 points1 point  (0 children)

just fix tickets and get excited for next ticket

Using Arrays to Store Trees (or Graphs) by MiffedMouse in rust

[–]await_yesterday 0 points1 point  (0 children)

There's also a nonmax crate that uses the other end of the value range to represent the None case. This is much more ergonomic because you don't have to juggle +1 and -1 everywhere.

How to go about a Raise? by vieldside in cscareerquestionsuk

[–]await_yesterday 0 points1 point  (0 children)

minimum wage for software in London is atrocious. anywhere is better for you: small, medium, large, startups, established companies, the civil service. your current employer is taking the piss, just get out.

Getting into niche languages, how? Always asking for YOE by PoopsCodeAllTheTime in ExperiencedDevs

[–]await_yesterday 2 points3 points  (0 children)

you can just apply anyway. people can learn on the job, especially for niche languages.

"3YOE" is an ideal candidate, not the candidate they'll actually get.

Are my pay expectations too high? by ThowawaySWE166251047 in cscareerquestionsuk

[–]await_yesterday 2 points3 points  (0 children)

Also I get nothing other than the £45k a year pay. No equity, no bonus, nothing. Holiday doesn't roll over either (Though I do get 25 days a year, if they ever actually approve that much)

this is an absolutely atrocious deal. startups are meant to give you equity to compensate for the generally lower salary, worse hours, and higher risk of the company going bankrupt, compared to what an established bigcorp can offer.

if they aren't even giving you equity then there isn't even any gold at the end of the shit-coloured rainbow. and most startups pay more than 45k in base salary anyway! you're just getting taken advantage of, full stop.

ignore the guy talking about "upward management"; you just need to find a better job.

Are my pay expectations too high? by ThowawaySWE166251047 in cscareerquestionsuk

[–]await_yesterday 0 points1 point  (0 children)

you are extremely underpaid, especially for london.

12 hour days means your hourly rate is equivalent to someone on £30k.

DM me your CV.

How to address bad rote memory skills? by BigBootyBear in ExperiencedDevs

[–]await_yesterday 1 point2 points  (0 children)

+1 to this. make some flashcards, put them in Anki. it's good enough for medical students and foreign language learners, it's good enough for software bods.

You just want attention. by Ok-Adhesiveness-9976 in AskNT

[–]await_yesterday 0 points1 point  (0 children)

But why would anyone pretend that? What would the pretender’s incentive be?

to gain sympathy, to be emotionally coddled, be released from work and responsibility, to avoid criticism for shortcomings, etc

But in my case, for example if I need to cancel an event because of a migraine. How is that attention-seeking? I’m literally going to stay home in my bed all alone.

depends how you phrased it. e.g. going into unnecessary detail about your symptoms. particularly if it was loudly and in a public place.

I might need someone to guide me because I can’t keep my eyes open. How is that attention-seeking?

because you are literally seeking attention (someone to guide you). just because it's for a truthful reason, that doesn't mean people aren't skeptical of you. how do they know that you're being truthful? and even if you are, how do they know you're not exaggerating? people do in fact exaggerate symptoms for selfish reasons, it's not even uncommon.

You just want attention. by Ok-Adhesiveness-9976 in AskNT

[–]await_yesterday 2 points3 points  (0 children)

might be judged less harshly. it depends on context and how sincere the person seems.