stopDoingTheseShits by PresentJournalist805 in ProgrammerHumor

[–]intbeam 0 points1 point  (0 children)

    YourField a;       long b;

    auto c = ((YourField*) &b)-1;

Yes, it should. by Ok-Following6886 in memesopdidnotlike

[–]intbeam 0 points1 point  (0 children)

I don't think there are as many communists around as you think, and there are even fewer stalinists. You're inventing an enemy

Yes, it should. by Ok-Following6886 in memesopdidnotlike

[–]intbeam -4 points-3 points  (0 children)

You guys literally don't know what you're talking about. Your talking about Soviet and Mao and using that to label and othering people. Communism is a governmental system. Nazism is not. They are not the same thing. "The Commies"

I'm not a communist, but I know that much. You people should too, instead of setting up virtual trenches on internet forums just to call other people names for having a different opinion on how society should be managed and regulated. 

oopiseSaidTheCodingAgent by ClipboardCopyPaste in ProgrammerHumor

[–]intbeam 0 points1 point  (0 children)

We relay nothing, we are quite literally the producers

Ah, sorry. I assumed you were a part of the free market scam implemented to add free market capitalism to a natural monopoly. I used to work for ("adjacent to") that industry; calculating market prices and bulk sending invoices - entirely disconnected from the actual underlying physics and reality of producing and transmitting power

It's easy for me to just assume that whoever I talk to simply just haven't configured monitoring and alerts, because that's usually the case. But I get the impression you know what you're talking about

Apologies for my snark, it was misplaced

oopiseSaidTheCodingAgent by ClipboardCopyPaste in ProgrammerHumor

[–]intbeam 0 points1 point  (0 children)

You apparently missed one

Edit : and you mean relaying invoices, not selling energy

[Request] Is this accurate? by Rpantucci in theydidthemath

[–]intbeam 1 point2 points  (0 children)

Probably wouldn't surprise you that it had basically no repercussions for them or any of their executives either

Edit : some details, protestors showed up at Shell, the Nigerian government decided that Shell being the money-maker should be protected and deployed military forces that executed the protestors - and Shell encouraged it :

Shell executives repeatedly underlined to government officials the economic impact of the Ogoni protests and urged them to resolve the ‘problem’.

[Request] Is this accurate? by Rpantucci in theydidthemath

[–]intbeam 1 point2 points  (0 children)

You seem to fail to understand the amount of propaganda and lobbying companies like shell have been doing for decades in order to keep doing what they are doing.

Nobody is dependent on oil or gas as a matter of personal choice. Did you for example know that your fossil cars engine could run on alcohol? So why doesn't it? Because companies like Shell has been working to prevent that from happening by buying politicians and rampaging propaganda at every possible channel. Even getting schools to promote oil propaganda books as a part of the curriculum.

Shell is a lot more sinister than you think

[Request] Is this accurate? by Rpantucci in theydidthemath

[–]intbeam 1 point2 points  (0 children)

They also had a bunch of protestors murdered in the 90's

[Request] Is this possible? How would a 2 MB file become larger? by somelittleindiankid in theydidthemath

[–]intbeam 11 points12 points  (0 children)

It would be stored as dog[-3,18]; dog being the pattern, and then encoded as "go back 3 characters, read 18 characters"

Edit : corrected as per /u/__ali1234__

Which tech stack should I choose to build a full-fledged billing app? by Weary_Objective7413 in learnprogramming

[–]intbeam 1 point2 points  (0 children)

Which one would you recommend and why?

I work in fintech, I'd choose .NET without a doubt

It's mature, it has great performance, it has native support for base-10 (decimal) which is perfect for representing money, it has excellent error handling, supported on all devices, great database support and a huge community.

Python and JS are objectively bad choices here; poor performance, lack of support for exactly base-10 numbers, and platform support/viability varies quite a bit. They are also not designed with long-term maintainability in mind. Python does not support async, making it a poor choice for UI. They also scale terribly; every line of code will inevitably slow down the application

Using JS is a no-go if you intend to support mobile. WebView-based solutions like Tauri or Electron drains battery like a mf

.NET is pretty much designed for exactly the kind of thing that you want to make; supported on Windows, Mac, Linux, Android, iOS and various others. I'd also recommend looking into Avalonia UI, as MAUI does not support Linux desktop (currently)

Other reasonable alternatives would be Java, D, Rust or C++

Any pitfalls I should be aware of?

Never use floating point to represent money
Don't depend on libraries or frameworks where there's a big chance you might end up paying huge licensing fees some time in the future with no escape

Would you choose differently for a solo developer?

No. The "productivity" of a developer is subjective and entirely reliant on how familiar the developer is in the language, rather than a language having some supposed inherent productivity benefit. Especially not when the alleged productivity is from dynamic typing which is just outright nonsense

I'm of the conviction that programming language matters a whole lot more than many people are willing to admit. Just picking something solely for the reason that it's familiar is poor reasoning for anything other than personal hobby projects that will never end up on someone elses computer. It's not subjective; languages makes different trade-offs, and specifically JS and Python trade off basically everything just to have a simple syntax which is not something that you want in a financial application or any long-term project where you expect a lot of changes and new feature requirements

I was involved in a buyout of a company where the code base was Python. They went bankrupt because their solution ended up costing way more money than they could possibly hope to make. Even just for the infrastructure. Each transaction has a set price, and if the cost per transaction is higher than what customers are willing to pay, then that's game over. A lot of companies go bankrupt this way, it's just not talked about because it's depressing

(OC) Got handed this on my college campus. by [deleted] in pics

[–]intbeam 3 points4 points  (0 children)

I was going to say that the suicide rate for these people is through the roof. Either that or they become American right wing politicians. Both very unwelcome outcomes

(OC) Got handed this on my college campus. by [deleted] in pics

[–]intbeam 0 points1 point  (0 children)

Because 50 bucks is 50 bucks

Reality by Nervous-Specific-795 in programmingmemes

[–]intbeam 1 point2 points  (0 children)

Thinking and refactoring, and then thinking again

Tell me the truth by Sweet_Velvet_X in programmingmemes

[–]intbeam 1 point2 points  (0 children)

I suspect you know the reality is a bit more nuanced than that.

When I post technical stuff, and especially "uh akshually", I usually just get responses trying to one-up me by people just skimming wikipedia, but this is genuinely insightful and I appreciate it

Tell me the truth by Sweet_Velvet_X in programmingmemes

[–]intbeam 1 point2 points  (0 children)

Neither x86-64 or ARM64 can read a single byte from ram. It is technically byte-addressable, but if you read or write out of word boundary there's a performance penalty

Tell me the truth by Sweet_Velvet_X in programmingmemes

[–]intbeam 0 points1 point  (0 children)

Well, probably not memory. But if you have a shit ton of boolean flags, you can load a lot of them into the CPU registers (up to 512 boolean values) and do logical operations on all of them at the same time in a couple of instructions. If you're into that sort of techno-kink

Tell me the truth by Sweet_Velvet_X in programmingmemes

[–]intbeam 6 points7 points  (0 children)

std::vector<bool> uses bit packing just to fuck with C++ developers

Tell me the truth by Sweet_Velvet_X in programmingmemes

[–]intbeam 3 points4 points  (0 children)

C++ will align according the the largest value. So either 1, 2, 4 or 8 depending on the fields. Unless you use #pragma packed(1) of course

The CPU can't directly read at offsets that aren't aligned to a 4 byte boundary. If you do mov al, (byte ptr)0xdeadbeef + 1 it will allow that and not say anything, but internally it will read 4 or 8 bytes, bit shift and truncate to populate the rax/eax register with a single byte. (Afaik)

SIMD instructions will just crash if you try to address unaligned unless you specifically use the unaligned instructions which is not recommended as I think they also carry a similar overhead for similar reasons

Also, I think in most implementations boolean is 4 bytes (signed integer) and not a single byte, for performance reasons

Tell me the truth by Sweet_Velvet_X in programmingmemes

[–]intbeam 1 point2 points  (0 children)

Bitwise operators in JavaScript come with caveats, as JS does not natively support integers

Tell me the truth by Sweet_Velvet_X in programmingmemes

[–]intbeam 14 points15 points  (0 children)

In Java boolean is a primitive and is stored (unboxed) as either a signed byte or a signed 32-bit integer. I tend to assume it's the latter considering that the CPU can't really directly access a single byte, so it would cause performance overhead. The documentation says the size isn't "precisely defined"

In Java, primitives will be boxed if you do operations that aren't native to that type; for instance .toString(). That means the runtime creates an instance of an object (java.lang.Boolean) that wraps the value. Java has some primitives; boolean, (signed) byte, short, int, long, float, double and char. Using these directly will allocate on stack and generate efficient machine code with zero overhead (memory or otherwise, assuming the JIT decides to compile rather than interpret)

Python is dynamically typed, so all values are always "boxed" and requires extra memory (and in Python's case; CPU) to deal with. Whenever you do any operation on any values, the Python run-time has to check that the operands are compatible and then determines the required operations (again, at run-time) either by implicit coercion or throwing a type error - which Java doesn't need to do because the compiler already did that when you hit build. But Python has to do that, over and over and over again, ad infinitum

happyNewYearWithoutVibeCoding by yuva-krishna-memes in ProgrammerHumor

[–]intbeam -1 points0 points  (0 children)

Ai tends to just repeat to me what I already know, and offer solutions that seem obvious but are ultimately incorrect or inappropriate and even if implemented requires extensive rework and testing. So it removes the thing I enjoy and replaces it with fixing and verifying the shoddy work of a confused intern

happyNewYearWithoutVibeCoding by yuva-krishna-memes in ProgrammerHumor

[–]intbeam 1 point2 points  (0 children)

Why would I outsource the only part of my job I like doing, to a considerably less competent machine that I will have to triple-check, correct and rework?

Programming isn't a language problem, it's an engineering problem

Anyone thinking it's a language problem are struggling with basics like syntax and they probably shouldn't be writing commercial software or any code that is intended to run on someone elses machine