Programming thread

  • 🔎 If you see an alert for analytics.usips.org, this is a self-hosted system I am running as a test. It is GDPR compliant and collects no invasive information.
  • Want to keep track of this thread?
    Accounts can bookmark posts, watch threads for updates, and jump back to where you stopped reading.
    Create account
I, however, can store it as JSON (as it basically is) and tell my ORM that the type is stored as JSON, and it can deal with it, e.g., update the code later to marshal known fields into my EventDetail type.
Event detail, though, can and often is arbitrary because it just comes from someone on the ground entering it into a computer as the event is taking place.

Seems like EventDetail is just a big text blob you'll want to have search on but is likely unstructured.

Trying to comb play by plays flat sounds like a good way to lose any hair you might still have.
 
Seems like EventDetail is just a big text blob you'll want to have search on but is likely unstructured.
No, it is structured. I just don't have a full list of everything, or stuff isn't documented properly.

A lot of stuff I have to work with is either completely undocumented or has poor/incomplete documentation.
Trying to comb play by plays flat sounds like a good way to lose any hair you might still have.
You log any fields that aren't mapped as a warning and pick it up later.
 
Is there some obligation/contract here? If you're working with something that isn't documented, is there someone to demand it from?
This sounds like a "go get the nasty management prick buzzed and on the phone" situation. Or is this a project?
 
Is there some obligation/contract here? If you're working with something that isn't documented, is there someone to demand it from?
This sounds like a "go get the nasty management prick buzzed and on the phone" situation. Or is this a project?
It is an example of a system I was working on. Often I used to get Google-autotranslated documentation, as often the supplier of software was somewhere like Belarus or Serbia. The point being made is that there are plenty of times when JSON is perfectly okay to just dump into a field in a table.

I've done lots of work with feeds and other shitty software suppliers while the data is structured most of the time, there are plenty of times when stuff is incomplete, influx and/or just straight up made by bodgers, and you have to make it work.
 
I've learned to CYA with stuff like that, but I tended to be involved with billing.

I might as well share the worst story from those years :story:

💅 Hey, this check reader reads checks.
🧑‍🌾 Yes. Yes that is what it does.
💅 Sometimes when it reads the nth check of the day, it spits out the n-1st check's info instead.
🧑‍🌾What!?
💅 Yeah look into that.
🧑‍🌾*LOOKING INTO THINGS*
🧑‍🌾Yeah our session is entirely wiped between readings. it sends a new request to the device every single time. How often does this happen?
💅 4 times out of 300,000.
🧑‍🌾 Oh my god

[time passes]

👴 Hey, I got news from the supplier!
🧑‍🌾 Oh?
👴 Yeah there was an undocumented feature for forensics we accidentally hit
🧑‍🌾 lol
👴 lol
 
I found that I'm a schizophrenic programmer.

When I write C++ code, I make it a sport to avoid unnecessary heap allocations (e.g. by replacing std::vector with something similar to Boost's `small_vector` when I expect the size to almost always stay under a small limit). I also obsess over CPU cache friendliness, e.g. by eschewing OOP for data-oriented programming techniques like "struct of arrays rather than array of structs" where applicable. I almost always avoid polymorphic inheritance. My heart warms when I know that the target platform ABI will pass a function return value in registers, or that RVO is guaranteed to apply, or that a move constructor will be used rather than a copy constructor.

Buuuut... when I write Java code, I go full no-fucks-given OOP code-monkey. Lots of polymorphic method calls via interfaces. Singleton classes, Adapter classes, Observer classes. A Factory object creating a Builder object which creates the final immutable object. Instantiating an object with two fields (with the heap allocation and all the Java object overhead that entails) just to return two integers from a method. I worry about the overall "elegance" and "self-documenting quality" of the Java code, but not about how much it rapes the RAM and CPU.

And funnily enough, in both cases, the code that comes out (and the speed at which it gets done) seems to be satisfactory to my boss and customers.
Is anyone else like that, or just me?
 
Last edited:
I found that I'm a schizophrenic programmer.

When I write C++ code, I make it a sport to avoid unnecessary heap allocations (e.g. by replacing std::vector with something similar to Boost's `small_vector` when I expect the size to almost always stay under a small limit). I also obsess over CPU cache friendliness, e.g. by eschewing OOP for data-oriented programming techniques like "struct of arrays rather than array of structs" where applicable. I almost always avoid virtual inheritance. My heart warms when I know that the target platform ABI will pass a function return value in registers, or that RVO is guaranteed to apply, or that a move constructor will be used rather than a copy constructor.

Buuuut... when I write Java code, I go full no-fucks-given OOP code-monkey. Lots of polymorphic method calls via interfaces. Singleton classes, Adapter classes, Observer classes. A Factory object creating a Builder object which creates the final immutable object. Instantiating an object with two fields (with the heap allocation and all the Java object overhead that entails) just to return two integers from a method. I worry about the overall "elegance" and "self-documenting quality" of the Java code, but not about how much it rapes the RAM and CPU.

And funnily enough, in both cases, the code that comes out (and the speed at which it gets done) seems to be satisfactory to my boss and customers.
Is anyone else like that, or just me?
Nah you're not schizophrenic, you're normal.
A language like C++ is intended to make you think about performance; that's where you write the hot loops, do the data parsing, etc. Then in a language like Java you do the management and stitch everything together. You're not supposed to micro optimize Java code, at that point you're using the wrong language.
The design of the tools influence the way you use them, and you seem to have picked that up correctly.
 
And funnily enough, in both cases, the code that comes out (and the speed at which it gets done) seems to be satisfactory to my boss and customers.
Is anyone else like that, or just me?
I can write fast stuff in "slow" languages because almost all the slowness for the work I am doing is due to I/O bottlenecks, so avoiding round trips and unnecessary lookups is where you get most of the performance back. Rarely do people care that I've done this, though.

Generally people want stuff to work reasonably well. Also, the standards are so low that often, if you can write things that work (not even optimised), you are often better than many of your peers e.g. I handed a project at one place I was contracting to a permie engineer, and he was amazed that he could just git clone the repo and build it.
 
I can write fast stuff in "slow" languages because almost all the slowness for the work I am doing is due to I/O bottlenecks, so avoiding round trips and unnecessary lookups is where you get most of the performance back. Rarely do people care that I've done this, though.

Generally people want stuff to work reasonably well. Also, the standards are so low that often, if you can write things that work (not even optimised), you are often better than many of your peers e.g. I handed a project at one place I was contracting to a permie engineer, and he was amazed that he could just git clone the repo and build it.

Cloud deployed stuff that bills you for all the pointer hops and dynamic reflective "is this an operator or ooperator or object or s-exp or SSRI or SRS!?!?!" is a good argument to fix those languages tbh.
 
Cloud deployed stuff that bills you for all the pointer hops and dynamic reflective "is this an operator or ooperator or object or s-exp or SSRI or SRS!?!?!" is a good argument to fix those languages tbh.
Nobody in these companies cares. They just rip off the clients.

Also, often people are so fucking moronic; if you don't spoon-feed them how to do everything, they can't do it. Go is really good for AWS; it isn't that hard as a programming language. However, because it is designed as better C and inherits many of the idioms, most programmers I've found who don't really know how to use Unix/Linux or never touch C basically struggle, as they won't/can't read documentation.

So managers always want stuff done in slow languages that the sort of tards I work with can handle.
 
Last edited:
Nobody in these companies cares. They just rip off the clients.

The point is you should write code that costs you less, lol. Or commission cheaper code.

most programmers I've found who don't really know how to use Unix/Linux or never touch C basically struggle, as they won't/can't read documentation.

I hate reading documentation. AIs replacing the autists of stack overflow was the best thing ever.

Also w/r/t "Go is good for AWS" - I think GC freezes are still literally a separate billable thing. Zero-Alloc is the shit.
 
It's always funny to me how much of "if we use this new AWS feature we can save 7% on developer time" let alone it will bill you by the transaction, and you're now even further locked in to AWS.

On the plus side there's good money to be made as a consultant telling them that they're morons for doing that, and then getting them to pay you to do it anyway.
 
I hate reading documentation. AIs replacing the autists of stack overflow was the best thing ever.
Documentation is awesome. Stackoverflow was already bad, and AI made things worse. Now all written matter will be garbage (likely spit out by AI) and intended to be processed by AI. One "person" posts 2 pages of jeetery, everyone else makes AI summarize.

"If the capacity is 100k items per day and the input is 110k items per day, how long will the queue be, on average? Can you model that?" Normally, individuals like that would be out of a job unless they're dedicated Jira shuffles (which that guy was), but with AI you'll be stuck in a maze of some perfectly self-confident retard's AI hallucinations, and when it almost looks that you've arrived at a coherent vision, there'll be more maze.

(I remember when we got grant money for the lab and bought a 200k oil-free pump with it. "Where's the manual?" "lmao why do you need a manual, you just press this button and it works". Consoomer ass attitude.)
 
The point is you should write code that costs you less, lol. Or commission cheaper code.
I don't think you understand what I am saying. They (management) do the calculus on whether it is worth doing shit in Go because they need to hire Go engineers, which costs much more than JavaScript and .NET monkeys. That extra spend isn't going to be reflected in the billing.

The vast majority of shit doesn't need to be in the cloud anyway.
Documentation is awesome.
It's awesome if done properly or at all. Rarely is it.
 
I don't think you understand what I am saying. They (management) do the calculus on whether it is worth doing shit in Go because they need to hire Go engineers, which costs much more than JavaScript and .NET monkeys. That extra spend isn't going to be reflected in the billing.
No one should make the mistake of going into software development with code quality as a priority. Software development is what you do to pay the bills. Management doesn't care about quality, leadership doesn't care about quality and with a very high likelihood your peers are snot-gobbling retards who barely know how to write a for-loop. And should you be self-destructive enough to push for quality, you'll soon discover that any improvement is swallowed up and digested into the blob-like body horror that is your repo, where it is shat out and re-digested over and over again, until the status quo of low grade mediocrity returns. A million monkeys typing with good grammar is still a million monkeys bashing at typewriters.

Your side projects are where you practice your code bonsai.
 
Back
Top Bottom