|
For no reason of which I am aware, I suddenly began to compare certain aspects of my careers (real life: chemistry vs. continuing story: programming).
A particular aspect of the two that really distinguishes the two is the type of results one expects.
With a computer program it is a series of steps/procedures/what-ever's that are deterministic. I am using the term 'deterministic' to imply that the results of specific input exactly defines the specific output. That is, in fact, the real point of using the computer: exactly predictable outcomes. It cannot be a mere 99.9999% predictable or, if you think of it and how many operations take place for almost anything calculation of consequence, that one-chance-in-a-million of uncertainty would make it useless. It sort of follows one of Einstein's quotes to the effect that 'insanity is doing the same thing over and over again and expecting different results'.
Now contrast that with chemical processes. They're really all statistical. For any of you who've taken organic chemistry, you know that you are looking for a "% yield" - in other words taking a bunch of stuff and putting them through a process has a multitude of outcomes. Not only that, but let's say you have a 70% yield as a predicted outcome (from previous information). You still will not likely see exactly 70% but will, if your "recipe" was well documented, have an expectation of something like 70±10 % as the yield. So there's uncertainty at two levels: what the reactants will do when they interact and a bit of kismet. Throw in that your starting materials are real substances that will "invariably vary" and it completes the fog. In organic chem lab, your product generally started out looking like (and was part of) a tar.
All that being said, it works damn well and chemistry is part of everything around you that makes life good. Forget popular opinions - nearly everything you look at required chemistry to bring it about.
Now, for computers, you could break that determinsitic paradigm you have built the perfect Turing Test. For chemistry, there are some reactions that are essentially "quantitative" meaning that all of the reactants go to a single product limited only by the relative proportions of the reactants (something might be in excess). A beautiful example of the latter is the preparation of cobaltus tetrakis(thiocyanato)mercurate. You mix solution of two salts and, after an induction period, it begins to form a brilliant blue snow storm, continuing towards this single inorganic polymer product until one reagent is totally exhausted. It is, however, a rare thing. I tried to find some videos of it but they were made by bored hacks. Here's a still[^]
So now, I'm in a world of a + b always gives c as before it was c (and some d, e, f, . . . ). In a way, we have it easy. As long as the plug isn't pulled or coffee spilled.
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 |
|
|
|
|
|
Garbage in, Salad out.
If you can keep your head while those about you are losing theirs, perhaps you don't understand the situation.
|
|
|
|
|
theoldfool wrote: Garbage in, Salad out
The words of a Jedi Compost Master ! ?
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 |
|
|
|
|
|
Or the words of someone who hates what my grandfather called "rabbit food".
|
|
|
|
|
Just consider this about rabbit food: rabbits have a pretty good time making more rabbits. That food is definitely good for something!
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 |
|
|
|
|
|
The words of a ?Jedi Compost Master dreamer.
If you can keep your head while those about you are losing theirs, perhaps you don't understand the situation.
|
|
|
|
|
Chemistry has no "undo" button.
|
|
|
|
|
W∴ Balboos, GHB wrote: Now, for computers, you could break that determinsitic paradigm you have built the perfect Turing Test.
Your ways of finding one needs refinement.
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.
|
|
|
|
|
W∴ Balboos, GHB wrote: the results of specific input exactly defines the specific output It surely doesn't always feel that way
|
|
|
|
|
If you're not part of the solution, are you part of the precipitate?
"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!
|
|
|
|
|
"... there's good money to be made in prolonging the problem." -- Despair
|
|
|
|
|
Said every pharmaceutical company executive on the planet.
|
|
|
|
|
Condense readers understand the difference? I won't resort to micelle for an answer, preferring to keep you readers in suspension.
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 |
|
|
|
|
|
Don't know, I'll have to flask my friend Florence Erlenmeyer.
"the debugger doesn't tell me anything because this code compiles just fine" - random QA comment
"Facebook is where you tell lies to your friends. Twitter is where you tell the truth to strangers." - chriselst
"I don't drink any more... then again, I don't drink any less." - Mike Mullikins uncle
|
|
|
|
|
Listen geneous! Its awfully political these days to be asking people if they support homo or hetero!
Tread carefully!
If you can't laugh at yourself - ask me and I will do it for you.
|
|
|
|
|
Did you hear about the dedicated chemist who got absorbed in his work?
Freedom is the freedom to say that two plus two make four. If that is granted, all else follows.
-- 6079 Smith W.
|
|
|
|
|
I've been repurposing a bunch of my old C# code for use as C++ code on microcontroller devices.
This is going far far better than I would have ever imagined.
For starters, C# under .NET is a garbage collected memory pig.
The environment this code gets ported to could not be more different. I have 320kB of usable RAM, no garbage collection, and an allergy to new and malloc .
And yet my JSON parser i built for it was originally written in C#. It will run comfortably on 4kB of RAM. The same code on .NET uses tens of megabytes or more.
And don't get me started on my latest endeavor - stealing Microsoft .NET's SynchronizationContext paradigm for use on my ESP32 IoT devices.
Porting the code was cake, in both of the above cases. It was almost too easy.
It's shocking to me because the differences in environments and development paradigms are profound, but the code is almost copy-paste-search-replaceable in terms of porting it.
C#/.NET:
private struct Message
{
public SendOrPostCallback Callback;
public object State;
public ManualResetEventSlim FinishedEvent;
}
C++/ESP32:
struct Message
{
std::function<void(void *)> callback;
void *state;
TaskHandle_t finishedNotifyHandle;
};
It's the same code!
Callback: C++ functor vs. C# singlecast delegate
State: C++ void* vs. C# object
Finished event: C++ TaskHandle_t based notification vs C# ManualResetEvent
It's incredible how similar it is for something so platform specific. And now that C++ has things like coroutines and awaitable methods it will be even easier to port .NET code to C++ going forward.
How did this happen? When did this happen? I'm thrilled!
Real programmers use butterflies
|
|
|
|
|
OK - now it's time to really "put the pedal to the metal" and port this to C . Those last bits of fluff will fade away.
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 |
|
|
|
|
|
In recent years I haven't found a good use case for strict C development except in one case (ESP8266 IDF) due to a broken developers framework.
Even my little 8-bit monsters, while not supporting most of the STL, will handle classes and functors and things like that just fine, with just 4-8kB of RAM.
I mean, several years ago it wasn't uncommon to find devices with less RAM than that. Now you have to go out of your way to find them.
So don't get me wrong - I'm not saying those use cases for C don't exist. But they seem rare these days, and I personally don't tend to encounter them.
Real programmers use butterflies
|
|
|
|
|
The suggestion was purely for sport programming.
Actually, it's been a very long time since I've done sport program. That was for FORTRAN callable assembly functions on a VAX/VMS system - myself and a (now deceased) friend would compete for who could make the most compact version of a function.
In your specific case, any space saved could be used to install some games. If none found are small enough, that becomes yet another challenging project!
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 |
|
|
|
|
|
When I was younger, sport programming involved rewriting autoexec.bat and config.sys to play a game: getting the sound card and mouse working together, sometimes with EMM386, sometimes without - that kind of thing.
I'm pretty sure I spent more time and effort on that than playing the damn game sometimes!
"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!
|
|
|
|
|
"I didn't mention the bats - he'd see them soon enough" - Hunter S Thompson - RIP
|
|
|
|
|
I remember doing that for my job. My product ran under the DOS4GW DOS Extender (just like DOOM), and I had to work really hard to have enough real-mode and protected-mode memory. I had to tweak CONFIG.SYS and AUTOEXEC.BAT settings to both allocate memory the way I needed, plus support UI languages and such.
Software Zen: delete this;
|
|
|
|
|
Quote: For starters, C# under .NET is a garbage collected memory pig.
That is one of several reasons why I have nothing what so ever to do with it.
"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?"
|
|
|
|
|
I don't mind it because all that memory use buys me things, and I have more RAM than sense on a modern desktop anyway.
Still, it is a little off putting at first.
There are some great ideas in there though, like the way you can pass calls around to execute on other threads instead of having to do synchronization through read/write barriers.
Real programmers use butterflies
|
|
|
|