|
Quote: I love C where types are basically a suggestion rather than a rule
That doesn't sound like C. The only place in C where types are not enforced are in void pointers. Everywhere else you have to literally force the compiler to accept incorrect types.
How is this different from other languages?
|
|
|
|
|
You misunderstand me.
I'm not saying C doesn't enforce types.
I'm saying if you want to change the type it's enforcing you just have to give it a little nudge.
For example
struct S {
int x;
int y;
};
...
S s;
s.x=1;
s.y=1;
byte* bp = (byte*)&s;
Real programmers use butterflies
|
|
|
|
|
Quote: byte* bp = (byte*)&s;
That's a bug :-/. C does not allow conversion of pointers to anything other than a void pointer and back again. A compiler may let you do it but the language standard calls it a bug (undefined behaviour).
In other words, that isn't correct C; many compilers will allow it and let the program produce unpredictable results (anything from producing the correct results, producing incorrect results, all the way to crashing).
The correct way to do that is to use a union, at which point the strong typing gets enforced and alignment is guaranteed and you have not broken any of the C standards rules. While this way isn't Undefined Behaviour, it's not fully defined either - it's Implementation Defined (someone will correct me if I am wrong on this point, no doubt due to padding that may or may not occur depending on what flags were given to the compiler.
To be honest, any time you need to put in a cast in C (not C++) because the compiler is complaining, it's probably a bug. There are very few uses of casting in C (not C++) that aren't bugs. All uses of casting that I've seen in production code were alignment bugs. The few cases you need casting in C is when you are writing generic container functions and want to provide const guarantees to the callers.
Also, 'byte' is not a type in C. You probably mean to use 'uint8_t' or 'uint_least8_t'. I've seen programs use 'char' for bytes, but that isn't correct either as the standard doesn't require 'char' to be unsigned or to be signed (it's left up to the implementation) and 'working' code will suddenly stop working if the program is recompiled on a compiler which defaults to signed char (left bitshift operations on signed integer types are undefined. It's only defined for unsigned integer types).
I've been seeing more and more of this meme "C has weak typing" in various forums recently. In reality there is literally only one or two specific instances where the typing breaks down in C.
|
|
|
|
|
It's power and speed meant no extra weight from seat belts allowed. Just like any language, you learned where and how to be careful. "it corners on like it is on rails! (Pretty Woman)
|
|
|
|
|
I miss the days when all code was C. To quote the master:
“Moira nodded vigorously. She didn't know what BASIC or COBOL were, except that Wiz said they caused brain damage in those who used them.”
― Rick Cook, The Wizardry Compiled
|
|
|
|
|
Love you for bringing this up.
Spent my best years doing C, starting on Atari ST.
Now I'm lazy and use C++ (up to a point).
Much more productive, owing mostly to other people's work (ashamed).
Long live piraCy!
|
|
|
|
|
Technically I'm using C++ but I forget because it's on a microcontroller and no STL so I find myself doing more c-isms than anything.
Real programmers use butterflies
|
|
|
|
|
|
A) It's a juicer, not a bank vault. Whoever decided they needed 12 steps to set it up should be forced to use it
B) It seems easier just to use a regular juicer. Why is your phone even involved?
What even is this?
Real programmers use butterflies
|
|
|
|
|
Because Clooooooooud.
"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!
|
|
|
|
|
Actually, you need to see my juicer for comparison: 950W motor, spinning wheel-of-death-teeth with filter mesh, I get nervous just washing the damn thing up.
But ... I can drop a whole lemons in it and get the wet and dry components!
Is it connected to the cloud? Not on your nellie ...
"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 probably for the best - if it became sentient it would probably be dangerous.
Real programmers use butterflies
|
|
|
|
|
Stephen King could do a follow-up to Christine about your juicer being cloud-connected
Probably have more deaths than that great story...
|
|
|
|
|
Same reason as HP use with their printers - to ensure that you can't use any consumables with it apart from the stupid expensive ones they sell...
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
He hehe he!
It's not even a juicer. It's a sorting device used for separating money and idiots.
From: Squeezed out: widely mocked startup Juicero is shutting down | Technology | The Guardian
"Juicero, a Silicon Valley juicer startup that raised $120m from investors and was widely ridiculed after the $400 machines were revealed to be the equivalent of two hands squeezing a juice box, is shutting down."
"Juicero offered pre-sold packets of diced fruits and vegetables that users plugged into the $400 machines, which then transformed the contents into juice. The company was roundly mocked in April when Bloomberg News reported that users could easily squeeze the packets with their hands and turn the contents into juice at a faster rate than the expensive cold-press juicer machine."
|
|
|
|
|
I mean that's fair.
Real programmers use butterflies
|
|
|
|
|
Oh good grief ...
Not a single good or necessary idea in there. Not a one ... and $400? Plus $7 a pack for the ingredients? Which could probably be squashed by hand to get the same effect ...
"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!
|
|
|
|
|
A solution in search of a problem. Unfortunately, it did not pick an appropriate one.
"They have a consciousness, they have a life, they have a soul! Damn you! Let the rabbits wear glasses! Save our brothers! Can I get an amen?"
|
|
|
|
|
That's old.
There were many issues with the product, most obvious that it was useless and expensive.
I'd rather be phishing!
|
|
|
|
|
Put an Apple badge on it ...
"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!
|
|
|
|
|
Two things I didn't understood...
What the purpose of the phone in this setup?
Where are the fruits that a press should press? For those bags all you need is a knife...
"The only place where Success comes before Work is in the dictionary." Vidal Sassoon, 1928 - 2012
|
|
|
|
|
|
This is probably the only reason I would subscribe to Amazon Prime - but it could be worth it. I guess I could watch the episodes from the previous seasons too. Tempting!
Since they left Top Gear, it has, frankly, been a disaster. And on that bombshell....
|
|
|
|
|
Have never seen/heard before. Is this a documentary or some story in place?
|
|
|
|
|
You've not heard of The Grand Tour?
Remember Top Gear? Clarkson (The Orangutang), Hammond (The Hamster), and May (Captain Slow) being very daft with cars? It was sold worldwide for over twenty years!
Clarkson was thrown out of the BBC for punching a producer, and went to Amazon to make a not-a-copy-honest show called The Grand Tour with the other two, while the original Top Gear fell apart at the seams trying to do the same thing with different presenters.
Episode 1 of Season 4 came out in November 2019, and we've been waiting ever since for Episode 2 ...
"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!
|
|
|
|