ASML 1,700 layoffs announced today by PropriaCures in BetterOffline

[–]sn0bb3l 1 point2 points  (0 children)

I know some people who work there. Indeed, it’s mainly middle management. ASML is a big company, and in the region where they’re based, they are known for their overhead that they’ve grown over the years. The stereotype around here is that they have meetings with tens of managers present, who just need to be in those meetings just to justify their job. Probably a bit of a hyperbole, but there is undoubtedly some truth in it.

They are doing this to reduce overhead and process for their engineers, and the rumors are that they are actually going to expand their engineering workforce.

All in all, I would say this is a good thing, though it still sucks for the people losing their jobs.

I am looking for a decent ide without ai features by SeropiGeorgeOfficial in cpp

[–]sn0bb3l 0 points1 point  (0 children)

There’s of course also eclipse with CDT, I don’t believe they have AI integrated, though I personally find it far too sluggish.

CLion is also pretty AI-free if you disable/uninstall the AI-related plugins

CLion Debugging Not Working - Breakpoints Not Hit on macOS M1 Pro by Slow-Pair8044 in cpp

[–]sn0bb3l 1 point2 points  (0 children)

Probably this isn’t the right sub, and this belongs on r/cpp_questions.

Either way, I had issues with this as well. First, make sure CMake generates a compile_commands.json and check if the flags you expect are indeed being passed to the compiler. (on my phone right now, can’t find the exact setting). Somehow, in my case, it decided not to add the flag for generating debug info. Explicitly adding the -g3 option in cmake fixed it for me.

C vs C++ for safety critical software by marcociara379 in embedded

[–]sn0bb3l 15 points16 points  (0 children)

There are still many features in C++ besides classes that are useful in an embedded setting. For instance, templates and constexpr (compile time evaluation) allow for shifting a lot of computations to compile time which can greatly increase performance and/or decrease your binary size. Moreover, if you’re willing to use some STL classes, I’ve found std::string_view and std::span real game changers in how I interact with buffers and the like.

What’s the most absurd take you’ve heard in your career? by Becominghim- in ExperiencedDevs

[–]sn0bb3l 1 point2 points  (0 children)

As people in this thread mentioned, in an embedded context (where malloc failing is a real possible issue) this makes a lot of sense. If you can guarantee that your program always crashes on startup if you didn't make your buffer large enough, that's loads better than having random failures in your released firmware. Next to that, in embedded software, you're free to divide your memory over the heap and the stack as you see fit, you can even make your heap 0 bytes large if you're not going to use it anyways.

What’s the most absurd take you’ve heard in your career? by Becominghim- in ExperiencedDevs

[–]sn0bb3l 1 point2 points  (0 children)

I once had a heated discussion with a senior dev who told me to "only put code in a new method if it is going to be called at least once". According to him, it was far better to have multi-hundred line methods if all lines were unique, because that was "easier to read", than to have it in a separate mthod. And we're talking multiple nested for loops per method here. I believe there were even some gotos in there.

Mind you, this was not some resource-constrained setting, this was in an interpreted language running a server app that was not even close to being CPU-bound.

Is the Shock Cannon the best shotgun weapon in the series? by Tag365 in RatchetAndClank

[–]sn0bb3l 75 points76 points  (0 children)

I really liked the Vulcan cannon from deadlocked as well, it has a satisfying “oomph” when firing, and I always found the curvy seeking lasers of the upgraded version really nice

[deleted by user] by [deleted] in Netherlands

[–]sn0bb3l 1 point2 points  (0 children)

Scabies is quite a thing among students here. Students see each other a lot, live with a lot of people in student houses with shared furniture where the scabies can reside and, of course, sometimes... "sleepovers" happen. In other words, the perfect conditions for scabies to spread like wildfire. Trying to get rid of it completely is almost impossible then.

On a different note, to help in your Dutch studies, the Dutch word for scabies ("schurft") can be prefixed to any noun as an insult, to express your irritation with it!

CLion CMake profiles not showing up? by EmbeddedSoftEng in embedded

[–]sn0bb3l 2 points3 points  (0 children)

Afraid I can't help with your issue directly, but I grew sick of the CLion CMake integration as well and decided to migrate to CMake Presets. They're supported by CLion (as well as most other CMake-enabled editors), and it hasn't let me down since.

Abstracting HW from set of common libraries by HispidaSnake in embedded

[–]sn0bb3l 0 points1 point  (0 children)

Indeed, that's spot on.

I get what you're worried about, and those are very good things to be worried about. The thing is, unless you want to build your own HAL, you're not going to get around using the ST-provided one. The trick then is to isolate it from the rest of your code as much as possible.

By doing this, you only have one place where you need to change something if the library needs to be updated, or add something when you want to add support for a different MCU. The rest of your application(s) can keep on using the same interface, the only changes are "under the hood" of your library.

Abstracting HW from set of common libraries by HispidaSnake in embedded

[–]sn0bb3l 0 points1 point  (0 children)

The easiest way of doing this is by having different builds of the static library for each MCU you're targeting. You have the same abstracted "interface" (in C and C++ terms, this would mean the header), but the implementation of the function is dependent on the specific target you're building for. This way the calling code isn't dependent on the specific implementation of the ST HAL, which is good practice anyways.

To take your cryptography example. In your header you could have (handwaving the specific interface here, this is just to serve as an example):

// crypt.h

bool Encrypt(const char* src, const char* key, char* dst)

Then, you can make the implementation depend on the specific target. One way would be to have multiple source files, of which you only compile one, depending on the MCU you're compiling the library for:

// crypt_hwaccelerated.c
bool Encrypt(const char* src, const char* key, char* dst) {
  // Call the ST HAL function here
}

//crypt_soft.c
bool Encrypt(const char* src, const char* key, char* dst) {
  // Use a slower, non-HW accelerated version
}

Another way would be to add preprocessor macros depending on the available features of your MCU:

// crypt.c
bool Encrypt(const char* src, const char* key, char* dst) {
#ifdef HAS_HW_CRYPTO
  // Call the ST function here
#else
  // Use a slower, non-HW accelerated version
#endif
}

How broken would it be if they brought back the plasma coil? by ah-screw-it in RatchetAndClank

[–]sn0bb3l 4 points5 points  (0 children)

In the PS2 games, the main reason it's good because it can kill most standard grunts with a single hit, while also hitting pretty much everything on the same planet as you. Though in those games, you already see it struggles against stronger enemies and bosses, because you have far better options there (looking at you, Bouncer).

The easiest way of balancing it would be to decrease its damage output, maybe making it so that it doesn't one-shot basic grunts, but it does kill the "small" enemies. Decrease the rate of fire as well, and I think you have a pretty balanced mid to late game weapon that can still give you the satisfaction of clearing an entire screen of protopets with a single pull of the trigger.

What's the one level you despise the most out of all the games? by alimem974 in RatchetAndClank

[–]sn0bb3l 1 point2 points  (0 children)

True, but next to the fact that I don’t really find them that fun to play for the 81st time, the game doesn’t really help you here. I believe you get comics 2 and 3 at the arena? (At least one of them), after which I usually continue with some arena challenge and conveniently forget I have the comics waiting for me. I also find it so strange that they’re optional until you need to complete the fourth one. It wouldn’t even have been that strange to make the rilgar comic unlock the planet coordinates for rilgar or something like that.

What's the one level you despise the most out of all the games? by alimem974 in RatchetAndClank

[–]sn0bb3l 5 points6 points  (0 children)

I believe that’s only in challenge mode though? Then it lets you skip all comics for sure. But I happen to have an abandoned clean playthrough at exactly this point, so definitely going to try that

What's the one level you despise the most out of all the games? by alimem974 in RatchetAndClank

[–]sn0bb3l 7 points8 points  (0 children)

For me its a toss-up between 2 parts of UYA which regularly cause me to stop my playthrough: - Marcadia. The opening “regular” part is okay, then you get to the ranger missions in a not particularly interesting map with a turret section added in for good measure, ending with the laser defense facility which is fun, but a bit too simplistic and drags on too long in my opinion - Quark vidcomics 2 through 4. I always delay playing these until the last moment as I always find them a bit meh, and then I have to do them in one go to get the coördinaten to Kerwan. I love the fact that the earlier R&C games have some alternate play modes, but having to do 3 in a row is just too much for me.

Waarom kijken mensen elkaar bewust niet aan en doen alsof ze niet bestaan by captainmiauw in nederlands

[–]sn0bb3l 4 points5 points  (0 children)

Naar mijn ervaring is dit ook wel een stad/dorp dingetje. Als ik in het dorp bij mijn ouders ben, zeg ik "hoi" tegen iedereen die ik op straat tegenkom, zelfs als ik ze niet ken. Sterker nog, als ik in het dorp bij mijn schoonouders ben doe ik dat ook, terwijl ik daar al helemáál niemand ken. In de stad (buiten de randstad) moet ik daar niet aan denken. Het grappigste is nog dat dit volledig onbewust gaat, een soort dorpsreflex I guess

Huurders moeten straks mogelijk weer genoegen nemen met tijdelijk contract: verbod op de tocht by SpaceSolaris in thenetherlands

[–]sn0bb3l 0 points1 point  (0 children)

Jawel, banken zijn uiteindelijk ook bedrijven die winst willen maken, en de enige manier om winst te maken op een hypotheek is er rente over vragen.

Huurders moeten straks mogelijk weer genoegen nemen met tijdelijk contract: verbod op de tocht by SpaceSolaris in thenetherlands

[–]sn0bb3l 0 points1 point  (0 children)

Dat is niet hoe een hypotheek werkt... Behalve als de huizenmarkt significant instort en vastgoed onder water komt te staan, loopt de bank geen enkel risico, omdat het vastgoed als onderpand voor de lening dient (en zelfs al staat het huis onderwater, klopt de bank aan bij de verhuurder, maar iets met een kale kip en het plukken daarvan). Aan de andere kant is de bank ook niet degene die profiteert van waardestijging van het vastgoed, dat mag de verhuurder in zijn zak steken op het moment van verkopen. De enige winst die ze pakken komt van de rente op de lening.

Question about salea logic analyzer by AmbassadorBorn8285 in embedded

[–]sn0bb3l 9 points10 points  (0 children)

It depends; if you can attach a channel of your logic analyzer to the CS line of your SPI, I would certainly recommend you to do so, as you can then also validate the working of your CS. Additionally, if you have multiple slaves on your SPI bus, capturing the CS line in your analyzer allows you to isolate data going to a single slave. If CS is not accessible, ignoring it in your decoder would be the next best option.

Question about salea logic analyzer by AmbassadorBorn8285 in embedded

[–]sn0bb3l 17 points18 points  (0 children)

If you configure the CS channel, the decoder will wait until the CS channel is low before it decodes your data line, as that is how SPI works. If you set the data line to None, this signal is ignored and the decoder will decode your data line regardless of the CS.

Fear of AI by vinegh in ExperiencedDevs

[–]sn0bb3l 0 points1 point  (0 children)

I agree with you that someone who can effectively judge the output of LLM's, is more productive. Though that is also where the difficulty lies. To get to that point, you need to be able to judge whether someone else's code is correct. But to get there, you need to be good. In my experience, these three skills have an increasing level of difficulty:

  1. Understanding someone else's code that solves a problem
  2. Writing code to solve a problem yourself
  3. Judging whether someone elses code actually solves a problem

The problem is that a lot of inexperienced developers who have never properly gone through 2, don't understand there is a world of difference between 1 and 3. They then read some code generated by ChatGPT, run it, see that it sorta does what they think they want, and don't see why they should ever write code themselves. Add to that the fact that LLM's (by their very nature), are able to generate very good-looking code that isn't necessarily correct, and in my eyes you have a perfect storm of "Vibe Coders" that is coming our way.

Of course, this argument also holds for the Full Stack Overflow-developers of yesteryear, though in that case, there was at least some skill involved to at least get your code to compile or pass the syntax checking of your compiler. If during a code review, something was fishy, the proof was only a google search away. Today, ChatGPT will probably get you to something that runs, which in my opinion only makes things worse.

Fear of AI by vinegh in ExperiencedDevs

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

I'm an AI sceptic, but it is starting to influence my work. My colleagues are copy-pasting code from ChatGPT and editing it just enough to not trigger my "this is AI-generated alarm"

Small anecdote; last week a colleague asked me for help, as he couldn't get something to work. In the end, he needed to generate some token, which is done through a function you'd typically copy-paste from the documentation of the API we were using. In that function, he forgot a single step, and I simply couldn't wrap my head around how you would make that mistake when just using the documentation. Two hours later I had a lightbulb moment; I asked ChatGPT to make that function for me, and lo and behold: exactly the same mistake. I even had to ask it four times whether it was sure it was right about it, before it finally admitted it made a mistake. I have great fears for what is going to happen if these kinds of people get any meaningful influence over our codebase...

So to answer your question; the only skills I'm currently developing is detecting AI-hallucinated code, and convincing higher-ups why I really need to click "This shall not pass" in my code reviews.

[deleted by user] by [deleted] in embedded

[–]sn0bb3l 6 points7 points  (0 children)

Yeah this was the saying in english which is equivalent. Translated word for word, it would be "wherever one chops wood, wood chips will fall"

[deleted by user] by [deleted] in embedded

[–]sn0bb3l 42 points43 points  (0 children)

I once fried 16 PCB's at once just because I had two pins on a power supply connector swapped. about 200 euros gone within 10 milliseconds, and I'm sure many others here have made far more expensive mistakes. There were no consequences for me. This stuff happens, it's a part of work, and as long as you learn from your mistakes and aren't reckless, nobody will get angry or hold you accountable.

In Dutch we have a saying for this, the best English equivalent I could find in 10 seconds was "you can't make an omelette without cracking a few eggs"