![]() |
#27061 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,111
Karma: 34000001
Join Date: Mar 2008
Device: KPW1, KA1
|
That could be true; I don't know. What I do know is that I often write very simple code to get a machine to do something:
- Get a box from there. - Move jars along this track. - Push the jars into the box. - Keep moving and pushing until the box is full. - Move the box. - Put a lid on it. - Move the box onto a pallet machine. - Done. - Restart.... Something like that takes me about a day or two days to write, and it works perfectly every time (if the machine itself is OK). Then I spend 2 months writing all the error handling. What if the box isn't picked up correctly? What if there is no box to pick up? What if the track doesn't move? What if the pusher fails or jams? What if someone stops the machine mid-movement? What if the lid gets put on askew (your pallet will be wacky and unstable)? What if the machine making the pallets is not ready? And so on.... And all of that has to be remedied by two things: An error message, and a button called "Reset" which needs to fix the problem without messing with the rest of the machine. Writing the actual process is mostly easy. Writing the error handling of all the five million things that can go wrong, and do it in such a way that the entire process doesn't need to be restarted, can be *** hard. |
![]() |
![]() |
![]() |
#27062 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,063
Karma: 10944084
Join Date: Jun 2014
Location: New England
Device: Oasis 2,Voyage, Kindlle hdx 8.9, Ipad mini 4. Air 2
|
Quote:
![]() |
|
![]() |
![]() |
Advert | |
|
![]() |
#27063 | |
Bookmaker & Cat Slave
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,503
Karma: 158448243
Join Date: Apr 2010
Location: Phoenix, AZ
Device: K2, iPad, KFire, PPW, Voyage, NookColor. 2 Droid, Oasis, Boox Note2
|
Quote:
Hitch (who is often compused). |
|
![]() |
![]() |
![]() |
#27064 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,111
Karma: 34000001
Join Date: Mar 2008
Device: KPW1, KA1
|
Quote:
|
|
![]() |
![]() |
![]() |
#27065 |
temp. out of service
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,815
Karma: 24285242
Join Date: May 2010
Location: Duisburg (DE)
Device: PB 623
|
@Katsunami: to support you with a very simple example: back when I was a kid and storage was precious I wrote (with Pascal) a simple equivalent to 'du -h <drive>' for DOS for my own use, just for not to have to juggle with bytes when I crammed my stuff in as little floppies as possible.
But I wanted to do it RIGHT. Thus I thought about all the "what ifs" a user could pass as command line argument. Gave them exit codes and proper error descriptions. The code to do the task was 3 lines. The code to catch all the shit which might hit the fan - the rest of an A4 page. It was a little shitty prog. But I was damn proud of it because I did it error proof. Is this somehow along with what you had in mind? If so then you might like the following answer when a user asks what the fuss is all about: To tell the computer what to do is just the beginning; the real fun starts when you are telling what to do if shit hits the fan. Because you have to anticipate every direction and angle it might come from. |
![]() |
![]() |
Advert | |
|
![]() |
#27066 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,553
Karma: 64462893
Join Date: Jan 2008
Location: Harrisburg outskirts
Device: Palms, K1-4s, iPads, iPhones, KV, KO1
|
Yup. "You can't make anything idiot proof because idiots are so ingenious."
|
![]() |
![]() |
![]() |
#27067 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,111
Karma: 34000001
Join Date: Mar 2008
Device: KPW1, KA1
|
Quote:
Code:
(* This task will keep running, even if boxes are being placed and filled *) IF (InputBuffer.Count < (NUMBER_OF_JARS_SET_BY_UI + EXTRA_BUFFER)) AND (JarInputTrack.Status = STATUS_READY) AND (TASK_Get_Batch_Of_Jars = TASK_IDLE) THEN TASK_Get_Batch_Of_Jars := TASK_RUN; END_IF IF (BoxPickupArm.Status = STATUS_READY) AND (BoxPlatform.Status = STATUS_EMPTY) THEN TASK_Place_Box := TASK_RUN; END_IF IF (BoxPlatforum.Status = STATUS_BOX_PLACED) AND (JarPusher.Status = STATUS_READY) AND (InputBuffer.Count >= NUMBER_OF_JARS_SET_BY_UI) THEN TASK_Fill_Box := TASK_RUN; END_IF Then you start to read the tasks themselves, which have a fairly simple code as well; it's comparable to the code above, but only for one part of the machine. Each task also detects errors, which is fairly obvious code as well. Then you start reading the error handling, (re)initialization procedures and communication with the main user interface to disable/enable buttons while the program runs.... and you'll probably want to kill yourself before you finish, because in there, you'll find stuff describing what needs to happen if handling the fail actually fails itself. ** ERROR ** *box was crushed* Action: Retract box placement arm, then remove crushed b.... ** ERROR ** *Retract of box placement arm failed* Action: Shutdown this part of the machine, wait for manual removal of the box, restart, re-initialize box placement arm.... Then try to place a new box... while the REST of the machine (input of jars, output of already finished boxes) keeps running. You not fast enough removing that box? ** ERROR ** *Input buffer overflow* Action: Stop input track. Result: Preceding machine will be stopped as well. * chain reaction of stopped machines * Have a nice day reading code if you didn't write such a program yourself. Last edited by Katsunami; 01-29-2016 at 05:53 PM. |
|
![]() |
![]() |
![]() |
#27068 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 19,226
Karma: 67780237
Join Date: Jul 2011
Device: none
|
Sometimes subdivision of process is not really useful.
|
![]() |
![]() |
![]() |
#27069 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,111
Karma: 34000001
Join Date: Mar 2008
Device: KPW1, KA1
|
In cases where 3-10 processes run simultaneously to get one main process done, it is.
|
![]() |
![]() |
![]() |
#27070 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 19,226
Karma: 67780237
Join Date: Jul 2011
Device: none
|
Oh I completely agree, but we have to be open to what the consequences might be.
|
![]() |
![]() |
![]() |
#27071 | |
Just a Yellow Smiley.
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 19,161
Karma: 83862859
Join Date: Jul 2015
Location: Texas
Device: K4, K5, fire, kobo, galaxy
|
Quote:
|
|
![]() |
![]() |
![]() |
#27072 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,111
Karma: 34000001
Join Date: Mar 2008
Device: KPW1, KA1
|
Heh. Sorry
![]() Imagine what the real code looks like. Still, there are many who can understand code like this, and some are even able to write a half-decent to good Word or Excel macro. That doesn't make one a software engineer though. Building a nice doghouse is not the same as building a small mansion either ![]() Last edited by Katsunami; 01-29-2016 at 05:55 PM. |
![]() |
![]() |
![]() |
#27073 | |
Just a Yellow Smiley.
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 19,161
Karma: 83862859
Join Date: Jul 2015
Location: Texas
Device: K4, K5, fire, kobo, galaxy
|
Quote:
Must ask on your jars and boxes, do you have a code for human behavior? There is a show here called "Dirty Jobs" and I could see the host messing up the box loading. I did once write a program in BASIC. It was a strobe light. Does that make me an engineer??? Please know I am just kidding on the engineer part. My thought would be plumbing and electrical are two different skills. And just because one can turn on a faucet does not make them a plumber nor does flipping a switch make them an electrician. |
|
![]() |
![]() |
![]() |
#27074 | |||
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,111
Karma: 34000001
Join Date: Mar 2008
Device: KPW1, KA1
|
Quote:
![]() Quote:
Quote:
![]() ![]() One of my earliest real programs from 1990 or 1991 was a front-end for pkzip/unzip. It basically had one (1) useful line of code: the one that executed the command-line to actually zip or unzip something. The rest of the program was the front-end, and error handling. I used it for years, until I switched to OS/2 and later Windows NT, and it worked well. I found it 10 years ago during a cleanout, and took a look at the code before throwing out those 15 year old floppies. I really wanted to have a look at the extreme smartness of my past self. This is the closest approximation, as it's impossible to describe: ![]() I'm still amazed it actually worked at all ![]() Last edited by Katsunami; 01-29-2016 at 06:57 PM. |
|||
![]() |
![]() |
![]() |
#27075 |
Just a Yellow Smiley.
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 19,161
Karma: 83862859
Join Date: Jul 2015
Location: Texas
Device: K4, K5, fire, kobo, galaxy
|
Let's see if I remember the program.
1 COLOR 1 2 COLOR 0 3 COLOR 1 4 GO TO 1 RUN. Note the double Color 1 worked better than just one color one. I can't remember if 1 was black or white. I want to say it was black and 0 was white. That was in 1982 so excuse failing memory. It was also originally my younger brother's computer. He gave it to me when it did not have enough memory for him to do anything on it. It was a TRS-80. |
![]() |
![]() |
![]() |
Tags |
creepy crawlers!, dell computers, monteverdi, thread that never ends, tubery, unutterable silliness |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
I just have to vent... | lacymarie7575 | Sony Reader | 5 | 08-18-2010 07:59 PM |
I need to vent! Booksonboard! Ugh! | Mrgauth | News | 25 | 12-17-2009 09:26 AM |
Why, Oh Why! [RANT] | Vesper | Lounge | 19 | 06-19-2008 11:50 AM |
Am I allowed to vent here? | sborsody | Which one should I buy? | 25 | 06-12-2007 01:30 PM |