|
|
My sympathies ... they should have used a different keyword for switch really. "break " makes sense in a loop, but esac might have been a better choice way back when.
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
esac might have been a better choice Are you trying to ALGOL us here?
Mircea
|
|
|
|
|
Some of my best friends are Algolians!
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
That's your go-to rant about C and C++ as far as I can tell.
You should really consider using exit conditions instead of while(true);
Real programmers use butterflies
|
|
|
|
|
Yes, I'd previously said it was a design flaw. Now it bit me. Your advice is good, at least when there's a switch inside a loop.
But a rant would focus on the pendantry of how the standards group has evolved C++.
|
|
|
|
|
Were you trying to emulate Duff?
I’ve given up trying to be calm. However, I am open to feeling slightly less agitated.
|
|
|
|
|
I have no idea what you're talking about.
|
|
|
|
|
Duff's device - Wikipedia[^]
send(to, from, count)
register short *to, *from;
register count;
{
register n = (count + 7) / 8;
switch (count % 8) {
case 0: do { *to = *from++;
case 7: *to = *from++;
case 6: *to = *from++;
case 5: *to = *from++;
case 4: *to = *from++;
case 3: *to = *from++;
case 2: *to = *from++;
case 1: *to = *from++;
} while (--n > 0);
}
}
I’ve given up trying to be calm. However, I am open to feeling slightly less agitated.
|
|
|
|
|
I'd seen that before but forgot its name. I'm just thankful I don't have to read or write that kind of thing!
|
|
|
|
|
You need to be a bit more philosophical about this.
When you have an infinite loop the program stays busy - keeps itself out of trouble for, as we all know, "Idle Hands are the Devil's Playthings".
While it's looping you know where it is and don't have to worry about anything in the remainder of the code going wrong.
Ravings en masse^ |
---|
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein | "If you are searching for perfection in others, then you seek disappointment. If you seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010 |
|
|
|
|
|
You've been around a while, I see.
|
|
|
|
|
. . . and around and around and around and . . .
Ravings en masse^ |
---|
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein | "If you are searching for perfection in others, then you seek disappointment. If you seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010 |
|
|
|
|
|
Indeed, break should only break loops, a switch is not a loop.
Additionally, "fall-through" should never have been allowed in switch .
|
|
|
|
|
[[fallthrough]] is what happens if a break is forgotten. C++ views switch as a series of statement sequences that can only be exited with a break . Whether it's a good design can be debated. The language that I used for over 20 years didn't support the equivalent of [[fallthrough]] .
|
|
|
|
|
Ties for first, second and third place. We should start a betting pool.
Real programmers use butterflies
|
|
|
|
|
honey the codewitch wrote: We should start a betting pool. I bet horse #1.
What did we win?
Bastard Programmer from Hell
"If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
|
|
|
|
|
|
|
First of all, regarding the requirement of using code generators and drag and drop widgets to "program" in C++, can we simply not? Whoever thought that was a good idea is currently at the top of my naughty list.
I'm looking at you stm32CubeIDE.
Tell me what the venn diagram looks like between people that code in C and C++ and people that want drag and drop heavy handed code generator "modules" they have to muck with in a weird IDE that you're suddenly tied to? Because I don't think the intersection is very big. This junk makes VB6 look streamlined.
Also why does it have to be such a hassle to code ARM devices? I have two of them collecting dust because every single framework has something terrible about it that makes it unusable.
All I want is to code in C++, in a framework people actually use, and one that doesn't take an hour ever time the firmware needs to be rebuilt.
Apparently the people that write the toolchains for ARM find that to be too tall an order.
I just don't get it. At this rate, I'm never coding for ARM Cortex-Ms.
Real programmers use butterflies
|
|
|
|
|
I absolutely agree! I tried using STM32CubeIDE while working with a custom board using the STM32 processor. The libraries were either horrible or non-existent. We ended up hiring an electronics engineer to develop a specific framework to use with the design of the board from scratch. I don't see how this IDE and framework are used in a professional setting. It's like it's designed to teach rather than produce.
"When you are dead, you won't even know that you are dead. It's a pain only felt by others; same thing when you are stupid."
Ignorant - An individual without knowledge, but is willing to learn.
Stupid - An individual without knowledge and is incapable of learning.
Idiot - An individual without knowledge and allows social media to do the thinking for them.
modified 19-Nov-21 21:01pm.
|
|
|
|
|
Hello,
I am using the MS visual studio (2019) with some external tools for compiling and linking. The tools are the .bat file invoking the GNU compiler. I am using the same construction also for the AVR processor. It is working good enough (after my opinion). The main reason to implement this system was to keep the same development tool for any application.
If you need more details, contact me.
Emil Motolici
|
|
|
|
|
Are you using Azure Resource Manager scripts?
I found the Azure CLI to be a lot shorter and more readable
Seriously though, we're running out of abbreviations and this one always gets me
|
|
|
|
|
Oh heck no. ARM processors.
Real programmers use butterflies
|
|
|
|
|
I know
|
|
|
|