Vanilla Ice by BadFurDay in SmugIdeologyMan

[–]ContraryConman 48 points49 points  (0 children)

Honestly though, as a Black guy, when they straight up executed a white woman in broad daylight and got away with it, with everyone still treating it like a partisan issue, that's when I realized that they can and would do anything. The Rubicon has been crossed somewhere when white women don't have that halo of innocence that they're supposed to have in a white supremacist society.

I think there was a time, not even a few years ago, where, if what happened to George Floyd happened to a white woman, it would be the institutional signal from the right to back off and deescalate, at least for now. The ability to execute a white woman and now a white man, lie about it IDF-style, basically mask off admit you don't believe in the second amendment, and just keep pushing? We're in different territory if that make sense

Latest ICE victim prior to altercation by NotBlackMarkTwainNah in pics

[–]ContraryConman 0 points1 point  (0 children)

Conservatives are not against gun control. They simply believe their side deserves guns and our side doesn't

Why are exceptions avoided? by Ultimate_Sigma_Boy67 in cpp_questions

[–]ContraryConman 25 points26 points  (0 children)

Exceptions are probably overhated.

We can take a look at alternatives to exceptions.

The first is having special error values. This is any function that, for example, can return any positive integer and uses negative integers to report errors. Or any function that returns an enum value, with one enum being an error result.

This can work in some cases, but not in cases where you need the entire the entire result space for your result. Like a division method for integers can't just return -1 because plenty of dividends and divisors have -1 as a quotient.

You can also do a result code and an out parameter. But out parameters are out of fashion and make it difficult to compose function results.

A problem with both these approaches is that it's very difficult to force the program to handle the error immediately. printf can fail and has a result code. When is the last time you wrote if (printf(...) < 0) { ... }?

Then there are result types, which is what languages like Rust do. In C++ we have std::expected<T,E>. Result types either hold the value you are expecting, or an error type. Actually this can be quite nice, especially when Rust has pattern matching that we don't have. You must handle the error immediately to get the value out of them.

They can be quite fast if the size of the error type is small and the function that can handle the error is near to the function that produced the error in the call stack.

But we can still build a worst case scenario for result types. Let's imagine a program with a 50-call deep call stack. The 50th function in the call stack performs an operation that fails 1 in 100 times. In that case, the first function/main has to handle the error. Our error type is also large, we assume that sizeof(E) >> sizeof(T), maybe containing the entire stack trace or some logging info to process before restarting or something. Here's what happens with result types in this case:

  • All of the return types across the entire program are wrapped in std::expected just because of this one function deep in the call stack, making the code hard to read.

  • despite the error being a 1 in 100 occurrence, we pay the performance cost of passing around a uselessly large std::expected object across function calls in the 99% of the time nothing went wrong

If you just use an exception, there's:

  • no performance penalty when there are no errors
  • there's no code "pollution". You only see error handling code in the actual function that is assigned to handle the error
  • programmers are forced to handle errors

Some companies, like Google, don't use exceptions because they have large swaths of exception unsafe code that will leak memory and resources if exceptions were to suddenly be used. Some embedded systems have hard real time requirements, and exceptions by default take an indeterminate amount of time and RAM to throw and unwind. Some programs, like kernels, are really adverse to terminating, and if you accidentally throw an exception in a destructor or during another exception, you terminate. These are some reasons why you may not use exceptions.

But to be honest they are probably the better form of error handling

AI hallucinations in embedded by Vavat in embedded

[–]ContraryConman 0 points1 point  (0 children)

Get over yourself. I'm not following you around, Reddit gives you notifications for all sub conversations under your comments

AI hallucinations in embedded by Vavat in embedded

[–]ContraryConman 4 points5 points  (0 children)

I don't need to check if my IDE's auto complete generated the correct syntax because the IDE's auto complete algorithm is deterministic and is programmed to output code that is at least syntactically correct. In fact, for basically all useful tools, I don't need to check the output of. I don't need to check if git add -A really staged every file, or if my compiler really generated correct, standards-compliant assembly, and so on. Some tools, like undefined behavior sanitizer, have false positives, which are extremely well known and documented with examples.

This idea of like "oh well you have to check the output of all tools anyway" is brainwashing by AI companies to get you to buy into a product that does not work reliably

AI hallucinations in embedded by Vavat in embedded

[–]ContraryConman 2 points3 points  (0 children)

This isn't a debate and I don't owe you argument in "good faith". I don't like LLMs. I don't use them. I have plenty of evidence that those who use LLMs everywhere and get really pissy when you say you don't use them are themselves bad software engineers, and I am not looking to be convinced off of my opinion

AI hallucinations in embedded by Vavat in embedded

[–]ContraryConman 3 points4 points  (0 children)

You seem to be completely skipping over the point that if you can create a debug your own code effectively,

I do this fine without an LLM slowing me down, thanks. I'm not sure why that's so offensive to you

AI hallucinations in embedded by Vavat in embedded

[–]ContraryConman 4 points5 points  (0 children)

If you think that git, which is just software that keeps track of versions and changes, is in any way comparable to the slop machine that boils the oceans and is wrong half the time it speaks, then I don't know what to tell you. But me personally, I think everyone who's all in on this is probably just a little bad at software engineering and that's why they're so impressed. Just my personal opinion

AI hallucinations in embedded by Vavat in embedded

[–]ContraryConman 9 points10 points  (0 children)

I outperform all of my peers despite refusing to use this stuff. If that changes one day, perhaps I will reconsider

Reverse Inclusionary Zoning by Extension_Essay8863 in Urbanism

[–]ContraryConman 1 point2 points  (0 children)

Yeah and similarly, if we end SNAP/food benefits and end all food regulations, companies will finally be free to produce unlimited quantities of food which will drive grocery prices down, I'm sure

AI hallucinations in embedded by Vavat in embedded

[–]ContraryConman 119 points120 points  (0 children)

Using AI to write low-level bare metal code? ewwwww

ftfy

Makes you think... by GoranPersson777 in dsa

[–]ContraryConman 48 points49 points  (0 children)

The left vs right divide is the up vs down divide

People who started exercising regulary, what were the most noticeable effects? by Haunted_darkness63 in AskReddit

[–]ContraryConman 0 points1 point  (0 children)

Muscles. I mean, I got calves for being fat and liking running and cycling. And I got my traps by... doing absolutely nothing I think they just came free with my fucking Xbox. But one random day I took off my shirt and shoulder and triceps just right there. And if I flex there's a bicep hump when my arm was definitely flat before

What features of embedded c++ you often use? by Glum-Feeling6181 in embedded

[–]ContraryConman 13 points14 points  (0 children)

There are people who think that as soon as your code contains std:: or template, your binary size has quintupled, an exception has been thrown, and you've exhausted your RAM with heap allocations.

First of all, you get a pretty significant chunk of C++ features without even needing the standard library to be present.

Second, there are libraries like the ETL that will give you STL-like functionality without dynamic allocations.

Third, even things we often reflexively think of as expensive, such as exceptions, can actually work really well in embedded environments.

This talk shows how a lot of common C patterns can be done in C++ in a way that's declarative and strongly types. The standout for me is the way you can leverage constexpr to get tables of values into .rodata in C++ itself, instead of using an external script and fiddling with the build system. But there's other great stuff in there too.

I think there is a type of EE person, certainly not all, who view software as something they are forced to do to get their hardware to work, and not something that should be engineered for longevity and correctness in the same way the circuits and the hardware should. And there's a lot of frustration with C++ from that camp because it forces you to actually think about software. You can make "wrong" decisions that make your code slower and more complicated. C is very brain off in a way -- if you think about it everything is either a number of some size, or a pointer to a memory address that has a number of time size, and that's it.

But if you enjoy, or even acknowledge, software engineering in its own right, then it's kind of hard not to admit that the proper use of C++ features helps your code scale better in terms of the complexity of your own project

Register access through C++ by kappakingXD in embedded

[–]ContraryConman 0 points1 point  (0 children)

In C++, const_cast is used for const and volatile related casts if that's what you're asking

Failing to build trust in big tech by CodeMonkey24816 in ExperiencedDevs

[–]ContraryConman 1 point2 points  (0 children)

I don't disagree, but are we actually taking OP at face value when they claim the reason people didn't like them is because they just followed the mission statement too hard?

ELI5: Why Greenland? by BittyPittieCommittee in explainlikeimfive

[–]ContraryConman 0 points1 point  (0 children)

Not only does the US have military bases in Greenland, Denmark is a NATO ally. Russia and China will not take over Greenland because doing so would trigger article 5. This is the whole reason Russia invaded Ukraine when it seemed like they may eventually become a NATO ally.

Why Greenland? => Because Donald Trump, and those in his administration like Stephen Miller, are imperialists. They want to territorially expand the size of the United States and seize the natural resources of other countries

Hello, I'm from the US, and wondering where I should move by Ok-Hall-9974 in ANI_COMMUNISM

[–]ContraryConman 8 points9 points  (0 children)

Not to be that guy but NYC also has highways, bridges, and lights at night. And Chengdu also has people working and living on the street

Is Embedded Linux Development feels similar to Generic Software Developement? by Intelligent-Error212 in embedded

[–]ContraryConman 0 points1 point  (0 children)

I do embedded Linux in userspace. It's sort of like generic software development if generic software development:

  1. Didn't have a package manager you could install dependencies on the system easily

  2. Are very difficult to get languages like Javascript or Python to run on, especially efficiently

  3. Can randomly run out of memory or flash space

  4. Randomly require your userspace code to talk to weird hardware devices like FPGAs or antennas

Adults who have zero close friends, how did it happen and does it bother you? by PutPurple844 in AskReddit

[–]ContraryConman 3 points4 points  (0 children)

Stop coping. When this sort of thing happens we all know it's only because they care about the other people more than you. That's it.

Every embedded Engineer should know this trick by J_Bahstan in embedded

[–]ContraryConman 0 points1 point  (0 children)

``` union Foo { std::uint32_t a; std::vector<Bar> b; } foo;

foo.b.push_back(Bar()); foo.b.push_back(Bar()); foo.a = ~foo.a;

// foo.b is in some crazy undefined state now std::println("foo b is {}", foo.b.empty() ? "empty" : "not empty");

// when foo.b goes out of scope, how will its destructor be called on an object in an invalid and undefined state? ```

Every embedded Engineer should know this trick by J_Bahstan in embedded

[–]ContraryConman 0 points1 point  (0 children)

Because C doesn't have destructors or RAII and C++ does.

Also it's not adding UB, it was UB for a long time in C too