Author Topic: It takes a certain type of personality to write code
AzureTyger 
Title: Awesome
Posts: 29,693
Registered: Apr 1, '02
Extended Info (if available)
Real Post Cnt: 26,594
User ID: 663,926
Subject: It takes a certain type of personality to write code
I gave up on computer science as a major after one semester, I just do not have the aptitude for it. Just writing eSQL stuff at my job gives me a headache if my decision trees are more than a couple deep. Hardware, workflow, analysis, database design, and that sort of thing is right up my alley. But give me a couple of IF or CASE statements and I want to go home for the day.

 

-----signature-----
Using the mirror of ridicule to force conservatives to
confront their own stupidity.

Link to this post
NuEM 
Posts: 15,394
Registered: Mar 2, '04
Extended Info (if available)
Real Post Cnt: 13,662
User ID: 900,449
Subject: It takes a certain type of personality to write code
It's all just applied math.

 

-----signature-----
It's time we became European:
http://www.youtube.com/watch?v=6VzdZ1i8YM8
The Federalist's Song:
http://www.youtube.com/watch?v=lz70fFZHEhw
Link to this post
Coriolus 
Title: Outpost Ice Mexican
Posts: 22,046
Registered: May 17, '02
Extended Info (if available)
Real Post Cnt: 21,595
User ID: 679,996
Subject: It takes a certain type of personality to write code
I agree, I detest coding, detest! But I love configuring network appliances and stuff but not quite the same

 

-----signature-----
A thousand sheep are louder than one man. As long as the Survivor-watching sheep outnumber the thinkers, nothing will change. - BD
Link to this post
Taliesihne 
Title: Wind on the Deep Waters
Posts: 36,223
Registered: Feb 19, '04
Extended Info (if available)
Real Post Cnt: 30,592
User ID: 896,469
Subject: It takes a certain type of personality to write code
ComputerScienceGeek At = new ComputerScienceGeek();

for (int i = 0; i < At.FrustrationLevel; i++)
{
while (At.Semester)
DoWork();
}

 

-----signature-----
Jesus saves, Allah protects, and Cthulhu thinks you'd make a nice sandwich
First comes smiles, then lies. Last is gunfire. -Roland Deschain, of Gilead
Link to this post
AzureTyger 
Title: Awesome
Posts: 29,693
Registered: Apr 1, '02
Extended Info (if available)
Real Post Cnt: 26,594
User ID: 663,926
Subject: It takes a certain type of personality to write code
NuEM posted:
It's all just applied math.


I am terrible at that too. The only math class I did well in was statistics and statistical analysis. I am very visually oriented though. The first thing I always do when I have to write eSQL or VB is to sketch out stuff in Visio with conditions and 'yes' or 'no' lines to the next condition.

When I took the GRE here for grad school, I scored in the 94 percentile on reading, the 98 percentile on analytical, and 54 percentile in math.

I have a problem with abstract thinking.
grin

 

-----signature-----
Using the mirror of ridicule to force conservatives to
confront their own stupidity.

Link to this post
NuEM 
Posts: 15,394
Registered: Mar 2, '04
Extended Info (if available)
Real Post Cnt: 13,662
User ID: 900,449
Subject: It takes a certain type of personality to write code
Well we can't be good at everything.

 

-----signature-----
It's time we became European:
http://www.youtube.com/watch?v=6VzdZ1i8YM8
The Federalist's Song:
http://www.youtube.com/watch?v=lz70fFZHEhw
Link to this post
Modeeb 
Title: A Ghost In The Machine
Posts: 47,242
Registered: Apr 19, '02
Extended Info (if available)
Real Post Cnt: 39,997
User ID: 670,238
Subject: It takes a certain type of personality to write code
I agree AT. I took advanced symbolic logic and got a C minus in the class. I was happy just to pass, although there is not much difference between a D and a C minus. You have to have a certain logical intelligence or you will just be playing to your weaknesses. Playing to your weaknesses can be good for humility. However, it puts you at a practical disadvantage.


AT I would not throw the baby out with the bath water and include all abstract thinking. Ill bet your MAT (Millers Analogies Test) scores were very high.

 

-----signature-----
"What is here is there. What is not here is nowhere." Vishvasara Tantra
"Ever tried, Ever Failed. No matter. Try Again.
Fail Again. Fail Better. Samuel Beckett
Link to this post
RHWarrior 
Posts: 5,026
Registered: Sep 30, '09
Extended Info (if available)
Real Post Cnt: 5,021
User ID: 1,372,077
Subject: It takes a certain type of personality to write code
It usually goes hand in hand.

If you don't like topics like algebra, discreet mathmatics, etc. you're going to have a terrible time (=be terrible at) programming.

peace

 

-----signature-----
"Drink coffee - do stupids things faster with more energy! ...and I'm all out of beans..." -me
"You guys need to stop dick riding wow and compare everything to it. It never invented a godamn thing, just made it popular. " -tinkly
Link to this post
Taliesihne 
Title: Wind on the Deep Waters
Posts: 36,223
Registered: Feb 19, '04
Extended Info (if available)
Real Post Cnt: 30,592
User ID: 896,469
Subject: It takes a certain type of personality to write code
Fwiw At, you are usually either a DB person or a programmer, not both.

 

-----signature-----
Jesus saves, Allah protects, and Cthulhu thinks you'd make a nice sandwich
First comes smiles, then lies. Last is gunfire. -Roland Deschain, of Gilead
Link to this post
sweeny_comodore 
Posts: 9,066
Registered: Aug 23, '07
Extended Info (if available)
Real Post Cnt: 8,113
User ID: 1,248,480
Subject: It takes a certain type of personality to write code
math involves memorization.
if you are not good and memorizing and regurgitating then you will not do well at math.

 

-----signature-----
Jesus? No, but there is indeed a god shaped hole in the heart of man, why is yours so empty? -- snarf igraine
the original monotheism: http://en.wikipedia.org/wiki/Phallus
Link to this post
Sin_of_Onin 
Posts: 35,113
Registered: Jun 29, '05
Extended Info (if available)
Real Post Cnt: 23,763
User ID: 1,062,657
Subject: It takes a certain type of personality to write code
I like if statements but I have never been trained in programming language/syntax. When working with programmers I can usually tell them what the logic is. Translating business practice to logical code is probably going to be my career niche.

 

-----signature-----
"Okay... I'm with you fellas" --Delmar
F is for Fake-believe
"We apologise for the inconvenience" --God
"What Jesus fails to appreciate is that it's the meek who are the problem"--Reg
Run, Forrest! Run!
Link to this post
Taliesihne 
Title: Wind on the Deep Waters
Posts: 36,223
Registered: Feb 19, '04
Extended Info (if available)
Real Post Cnt: 30,592
User ID: 896,469
Subject: It takes a certain type of personality to write code
Sin_of_Onin posted:
I like if statements but I have never been trained in programming language/syntax. When working with programmers I can usually tell them what the logic is. Translating business practice to logical code is probably going to be my career niche.


http://en.wikipedia.org/wiki/Unified_Modeling_Language

Learn this if you haven't already.

 

-----signature-----
Jesus saves, Allah protects, and Cthulhu thinks you'd make a nice sandwich
First comes smiles, then lies. Last is gunfire. -Roland Deschain, of Gilead
Link to this post
Fist_de_Yuma 
Posts: 24,444
Registered: Dec 20, '01
Extended Info (if available)
Real Post Cnt: 21,971
User ID: 566,471
Subject: It takes a certain type of personality to write code
Got years I lived and breathed coding. It was not a job it was a way to play a game all day. Then after 5 years I got burnt out and now have not done any coding in years.

 

-----signature-----
There are three kind of liberals;
Stupid, ignorant or evil
The result is always evil but the intent is not always evil. Not that it makes much difference in the long run.
No one here is exactly as they seem. - G'Kar
Link to this post
ZigmundZag 
Title: Grammar Nazi
Posts: 25,948
Registered: Mar 25, '02
Extended Info (if available)
Real Post Cnt: 22,707
User ID: 661,552
Subject: It takes a certain type of personality to write code
In PowerShell!
Fist_de_Yuma posted:
If (User.Name -ne 'Fisted Puma')
{
User.Politics = 'LIBERALZ'
write-wharbargl
}


 

-----signature-----
"Take the cheese to sickbay!"
Link to this post
Scarne 
Title: Capo di Scientifico
Posts: 27,710
Registered: Jul 23, '01
Extended Info (if available)
Real Post Cnt: 22,798
User ID: 272,061
Subject: It takes a certain type of personality to write code
Taliesihne posted:
http://en.wikipedia.org/wiki/Unified_Modeling_Language

Learn this if you haven't already.

No one should learn that. grin

 

-----signature-----
E Pluribus Unum
Link to this post
Sin_of_Onin 
Posts: 35,113
Registered: Jun 29, '05
Extended Info (if available)
Real Post Cnt: 23,763
User ID: 1,062,657
Subject: It takes a certain type of personality to write code
Taliesihne posted:
Sin_of_Onin posted:
I like if statements but I have never been trained in programming language/syntax. When working with programmers I can usually tell them what the logic is. Translating business practice to logical code is probably going to be my career niche.


http://en.wikipedia.org/wiki/Unified_Modeling_Language

Learn this if you haven't already.


Learning something like that seems inevitable but so far I have been able to get by making other people do the grunt work.

 

-----signature-----
"Okay... I'm with you fellas" --Delmar
F is for Fake-believe
"We apologise for the inconvenience" --God
"What Jesus fails to appreciate is that it's the meek who are the problem"--Reg
Run, Forrest! Run!
Link to this post
Seething199 
Posts: 22,034
Registered: Sep 23, '03
Extended Info (if available)
Real Post Cnt: 15,701
User ID: 840,453
Subject: It takes a certain type of personality to write code
i haven't seen UML since college. programming was like physics for me. started out difficult then one day i just got it. the light bulb came on and it's been easy ever since.

 

-----signature-----
You Are
Sofa King
We Todd Ed
Link to this post
Abaddon_Ambrosius 
Title: Retired Theurgist TL
Posts: 25,187
Registered: Dec 21, '01
Extended Info (if available)
Real Post Cnt: 25,057
User ID: 568,022
Subject: It takes a certain type of personality to write code
I can gear up and slog my way through code others have written to get a sense of what they're doing, once I spend a month or two in the space (I don't do code scans much any more, as a management poser).

However, I was lucky that in my early days I worked with some brilliant programmers. Two things became clear:

1) I'll never, ever be as good as them. Even on their worst day.
2) I don't want to be in a career where I'm a sub-par also-ran.

Sooooo I didn't get deep into programming. I went network deployment/design, db admin, etc.

 

-----signature-----
In the immortal words of Socrates - "I drank what?"
"God you guys suck at the internet - how can you fail to locate porn?!" - Eternal_Midnight
"Knowing means nothing." - Fat-badger
Link to this post
ZigmundZag 
Title: Grammar Nazi
Posts: 25,948
Registered: Mar 25, '02
Extended Info (if available)
Real Post Cnt: 22,707
User ID: 661,552
Subject: It takes a certain type of personality to write code
I just finished up a small VBA project to monitor email alerts. It's easy enough to keep up on the alerts that I receive, but I sometimes don't realize when an expected system-generated email doesn't show up at all, and those are usually the ones I need to follow up on the most. So now all my email alerts write to a text file, which is a data source for a spreadsheet that gives me a red/green status on whether the message passed and whether it was received on time. nerd

 

-----signature-----
"Take the cheese to sickbay!"
Link to this post
eodoll 
Posts: 17,153
Registered: Feb 14, '02
Extended Info (if available)
Real Post Cnt: 15,943
User ID: 645,592
Subject: It takes a certain type of personality to write code
Its very hard at first but gets easy when you figure it out.

Like any language... Youre probably more hung up in the grammar/vocabulary than the actual complexity of the softwatre if youre talking about college level programming.

 

-----signature-----
(none)
Link to this post
ZigmundZag 
Title: Grammar Nazi
Posts: 25,948
Registered: Mar 25, '02
Extended Info (if available)
Real Post Cnt: 22,707
User ID: 661,552
Subject: It takes a certain type of personality to write code
With Teh Googles to help you out when you get stuck, programming is easy. I just started getting into programming in the late 90's, before Google was as popular as it is now. That was a pain in the ass...you had to find code samples in textbooks or from coworkers if you were stuck on a particular problem, and debugging was usually just trial and error if you weren't really familiar with the syntax.

 

-----signature-----
"Take the cheese to sickbay!"
Link to this post
AzureTyger 
Title: Awesome
Posts: 29,693
Registered: Apr 1, '02
Extended Info (if available)
Real Post Cnt: 26,594
User ID: 663,926
Subject: It takes a certain type of personality to write code
eodoll posted:
Its very hard at first but gets easy when you figure it out.

Like any language... Youre probably more hung up in the grammar/vocabulary than the actual complexity of the softwatre if youre talking about college level programming.


Yeah, it's syntax that gives me a headache.

We are trying to filter orders coming from our EMR based on which ones need to be routed to Cardiology.

Basically if it is cardiology, in location A or B, and not a certain type of EKG or TT we send it.
If it is Cardiology and it is not in location A or B and not among another set of order types, we send it.
Otherwise we discard it.

The code someone wrote before I took over the interface used a series of nested IF statements, which always seem to be difficult to get right in eSQL. I am probably going to just change it to several independent functioms that each set a variable to true or false and then check all of those at the end.

This is only a small part of my job, most of it is analyzing the data needs on both ends, creating HL7 specifications for the transfer, building the interface mappings, testing, troubleshooting, and documentation. But almost every interface has at least some kind of filter logic to make it work right. Eventually we'll have enough examples that I can just copy and edit other code that people wrote. Although a real programmer would knock it out in like five minutes blindfolded.

 

-----signature-----
Using the mirror of ridicule to force conservatives to
confront their own stupidity.

Link to this post
Seething199 
Posts: 22,034
Registered: Sep 23, '03
Extended Info (if available)
Real Post Cnt: 15,701
User ID: 840,453
Subject: It takes a certain type of personality to write code
once you decide to leave whatever midwestern hellhole you live in right now let me know. we often have need for people that know emr's, interfacing, and hl7.

 

-----signature-----
You Are
Sofa King
We Todd Ed
Link to this post
Sinlock 
Title: Savior of the Camelot Outpost
Posts: 27,600
Registered: May 14, '00
Extended Info (if available)
Real Post Cnt: 26,129
User ID: 24,657
Subject: It takes a certain type of personality to write code
ZigmundZag posted:
In PowerShell!
Fist_de_Yuma posted:
If (User.Name -ne 'Fisted Puma')
{
User.Politics = 'LIBERALZ'
write-wharbargl
}





The conditional '-ne' is "Not Equal", which means your code will execute when the user is not Fisted Puma. I believe it needs to be changed to '-eq' for 'Equal'.

I've been a software engineer for over 10 years and one of my best skills is debugging other people's code. coffee

 

-----signature-----
THOOOOKA...THOOOOOKA...THOOOOOKA...
Future Grand President For Life of the Universe (you'll see! you'll be sorry then!)
Outpost Terrorist #1! I don't care what any law says!
Link to this post
ZigmundZag 
Title: Grammar Nazi
Posts: 25,948
Registered: Mar 25, '02
Extended Info (if available)
Real Post Cnt: 22,707
User ID: 661,552
Subject: It takes a certain type of personality to write code
Working as intended. Anyone other than Fisted Puma is automatically evaluated as a liberal.

 

-----signature-----
"Take the cheese to sickbay!"
Link to this post
AzureTyger 
Title: Awesome
Posts: 29,693
Registered: Apr 1, '02
Extended Info (if available)
Real Post Cnt: 26,594
User ID: 663,926
Subject: It takes a certain type of personality to write code
Seething199 posted:
once you decide to leave whatever midwestern hellhole you live in right now let me know. we often have need for people that know emr's, interfacing, and hl7.


You wouldn't believe how many job offers I get from people that I don't know because I put my interface engine experience and HL7 certification as well as my Epic Certs on My LinkedIn profile. It is a red hot career path right now. I'll have a Master's degree in HIT come August too money_eyes .

 

-----signature-----
Using the mirror of ridicule to force conservatives to
confront their own stupidity.

Link to this post
Seething199 
Posts: 22,034
Registered: Sep 23, '03
Extended Info (if available)
Real Post Cnt: 15,701
User ID: 840,453
Subject: It takes a certain type of personality to write code
it's well in demand because that line of work is a soul killer. plain

 

-----signature-----
You Are
Sofa King
We Todd Ed
Link to this post
AzureTyger 
Title: Awesome
Posts: 29,693
Registered: Apr 1, '02
Extended Info (if available)
Real Post Cnt: 26,594
User ID: 663,926
Subject: It takes a certain type of personality to write code
Seething199 posted:
it's well in demand because that line of work is a soul killer. plain


I enjoy it sad .

Or do you mean the consulting side? If so, then yeah, I will pass on that lifestyle. I work for a major metro hospital system and they treat people very well, although I could live without 24hr pager duty.

 

-----signature-----
Using the mirror of ridicule to force conservatives to
confront their own stupidity.

Link to this post
Sinlock 
Title: Savior of the Camelot Outpost
Posts: 27,600
Registered: May 14, '00
Extended Info (if available)
Real Post Cnt: 26,129
User ID: 24,657
Subject: It takes a certain type of personality to write code
ZigmundZag posted:
Working as intended. Anyone other than Fisted Puma is automatically evaluated as a liberal.


I get it now.

Debugging code is an iterative process that requires patience. grin coffee

 

-----signature-----
THOOOOKA...THOOOOOKA...THOOOOOKA...
Future Grand President For Life of the Universe (you'll see! you'll be sorry then!)
Outpost Terrorist #1! I don't care what any law says!
Link to this post
Taliesihne 
Title: Wind on the Deep Waters
Posts: 36,223
Registered: Feb 19, '04
Extended Info (if available)
Real Post Cnt: 30,592
User ID: 896,469
Subject: It takes a certain type of personality to write code
Not when you are good at it. kiss

 

-----signature-----
Jesus saves, Allah protects, and Cthulhu thinks you'd make a nice sandwich
First comes smiles, then lies. Last is gunfire. -Roland Deschain, of Gilead
Link to this post
Seething199 
Posts: 22,034
Registered: Sep 23, '03
Extended Info (if available)
Real Post Cnt: 15,701
User ID: 840,453
Subject: It takes a certain type of personality to write code
AzureTyger posted:
Seething199 posted:
it's well in demand because that line of work is a soul killer. plain


I enjoy it sad .

Or do you mean the consulting side? If so, then yeah, I will pass on that lifestyle. I work for a major metro hospital system and they treat people very well, although I could live without 24hr pager duty.


we have over 1000 clients with an array of different EMRs that all interpret the HL7 "standard" a little differently. working with client IT departments, EMR vendors, interface middle-men, etc, is a bitch. luckily we have a team for that so i don't have to do it.

 

-----signature-----
You Are
Sofa King
We Todd Ed
Link to this post
Kjarhall 
Title: The Pungent One
Posts: 29,212
Registered: Mar 1, '02
Extended Info (if available)
Real Post Cnt: 23,233
User ID: 652,381
Subject: It takes a certain type of personality to write code
Sinlock posted:
ZigmundZag posted:
In PowerShell!
Fist_de_Yuma posted:
If (User.Name -ne 'Fisted Puma')
{
User.Politics = 'LIBERALZ'
write-wharbargl
}





The conditional '-ne' is "Not Equal", which means your code will execute when the user is not Fisted Puma. I believe it needs to be changed to '-eq' for 'Equal'.

I've been a software engineer for over 10 years and one of my best skills is debugging other people's code. coffee


Can you write code that will rewrite Fist posts to make him coherent? Or is that beyond anyones mad skillz?

 

-----signature-----
You're a crazy moron*
*http://vnboards.ign.com/outpost/b22180/115147923/r115151508/
hah! true story tho i'm a woman an i even love boobs..how can you not??- HallowEve
Link to this post
Sinlock 
Title: Savior of the Camelot Outpost
Posts: 27,600
Registered: May 14, '00
Extended Info (if available)
Real Post Cnt: 26,129
User ID: 24,657
Subject: It takes a certain type of personality to write code
Taliesihne posted:
Not when you are good at it. kiss


Not true. Dogged, persistent, unwavering patience is mandatory in quality debugging. You cannot be an impatient debugger, or you will fail. coffee

 

-----signature-----
THOOOOKA...THOOOOOKA...THOOOOOKA...
Future Grand President For Life of the Universe (you'll see! you'll be sorry then!)
Outpost Terrorist #1! I don't care what any law says!
Link to this post
Sinlock 
Title: Savior of the Camelot Outpost
Posts: 27,600
Registered: May 14, '00
Extended Info (if available)
Real Post Cnt: 26,129
User ID: 24,657
Subject: It takes a certain type of personality to write code

I wrote this...

Sinlock posted:

if (( ((($clearquest_array[trim($row['cr_id_text'])]['function_assigned'] == $func) || ($func == "func_choose"))
&&
(($clearquest_array[trim($row['cr_id_text'])]['discipline'] == $disc) || ($disc == "disc_choose")) ))
||
( ((($clearquest_array[trim($row['cr_id_text'])]['function_assigned'] == '') && ($func == "func_blank"))
&&
($clearquest_array[trim($row['cr_id_text'])]['discipline'] == $disc || ($disc == "disc_choose")) )
||
( (($clearquest_array[trim($row['cr_id_text'])]['discipline'] == '') && ($disc == "disc_blank"))
&&
($clearquest_array[trim($row['cr_id_text'])]['function_assigned'] == $func || ($func == "func_choose")) ) )
||
(( ($clearquest_array[trim($row['cr_id_text'])]['function_assigned'] == '')&& ($func == "func_blank") )
&&
(($clearquest_array[trim($row['cr_id_text'])]['discipline'] == '') && ($disc == "disc_blank") ) )
)

{
do something
}




...and it still makes me laugh. coffee

 

-----signature-----
THOOOOKA...THOOOOOKA...THOOOOOKA...
Future Grand President For Life of the Universe (you'll see! you'll be sorry then!)
Outpost Terrorist #1! I don't care what any law says!
Link to this post
Taliesihne 
Title: Wind on the Deep Waters
Posts: 36,223
Registered: Feb 19, '04
Extended Info (if available)
Real Post Cnt: 30,592
User ID: 896,469
Subject: It takes a certain type of personality to write code
Sinlock posted:
Taliesihne posted:
Not when you are good at it. kiss


Not true. Dogged, persistent, unwavering patience is mandatory in quality debugging. You cannot be an impatient debugger, or you will fail. coffee


I know, I'm just teasing.

 

-----signature-----
Jesus saves, Allah protects, and Cthulhu thinks you'd make a nice sandwich
First comes smiles, then lies. Last is gunfire. -Roland Deschain, of Gilead
Link to this post
AzureTyger 
Title: Awesome
Posts: 29,693
Registered: Apr 1, '02
Extended Info (if available)
Real Post Cnt: 26,594
User ID: 663,926
Subject: It takes a certain type of personality to write code
Seething199 posted:
AzureTyger posted:
Seething199 posted:
it's well in demand because that line of work is a soul killer. plain


I enjoy it sad .

Or do you mean the consulting side? If so, then yeah, I will pass on that lifestyle. I work for a major metro hospital system and they treat people very well, although I could live without 24hr pager duty.


we have over 1000 clients with an array of different EMRs that all interpret the HL7 "standard" a little differently. working with client IT departments, EMR vendors, interface middle-men, etc, is a bitch. luckily we have a team for that so i don't have to do it.


Yeah that would suck, especially with those awesome vendors who interpret the HL7 standard anyway they want and are big enough to back it up (Cerner, McKesson, Meditech etc). But I don't have to worry as much about that kind of thing because I work on the customer side. God help you if you're a small time vendor going between. It hospitals and big healthcare vendors.

 

-----signature-----
Using the mirror of ridicule to force conservatives to
confront their own stupidity.

Link to this post
Szerek 
Posts: 4,747
Registered: Aug 8, '00
Extended Info (if available)
Real Post Cnt: 4,343
User ID: 38,666
Subject: It takes a certain type of personality to write code
AzureTyger posted:
[quote=eodoll]
We are trying to filter orders coming from our EMR based on which ones need to be routed to Cardiology.

Basically if it is cardiology, in location A or B, and not a certain type of EKG or TT we send it.
If it is Cardiology and it is not in location A or B and not among another set of order types, we send it.
Otherwise we discard it.

The code someone wrote before I took over the interface used a series of nested IF statements, which always seem to be difficult to get right in eSQL. I am probably going to just change it to several independent functioms that each set a variable to true or false and then check all of those at the end.




does it look something like this?



if cardiology = True then do
..if cardio_loc = 'A' or cardio loc = 'B' then do
....If EKG <> 'X' or EKG <> 'Y' or TT <> 'I' or TT <> 'J' then do
......call SendWhatever
....end
..else do
....if something_else <> another_set_of_order_types then do
......call SendWhatever
....end
....else
......call discard
....end
..end
end

 

-----signature-----
"The reason they call it the American Dream is because you have to be asleep to believe it."
"The IQ and the life expectancy of the average American recently passed each other in opposite directions."
- George Carlin
Link to this post
Szerek 
Posts: 4,747
Registered: Aug 8, '00
Extended Info (if available)
Real Post Cnt: 4,343
User ID: 38,666
Subject: It takes a certain type of personality to write code
Sinlock posted:

I wrote this...



...and it still makes me laugh. coffee



Have you ever written something, then years later had to go back and make a change and said, "How the hell did I do this?"

 

-----signature-----
"The reason they call it the American Dream is because you have to be asleep to believe it."
"The IQ and the life expectancy of the average American recently passed each other in opposite directions."
- George Carlin
Link to this post
AzureTyger 
Title: Awesome
Posts: 29,693
Registered: Apr 1, '02
Extended Info (if available)
Real Post Cnt: 26,594
User ID: 663,926
Subject: It takes a certain type of personality to write code
Yes, very similar. I am changing it to do two separate checks that contain each scenario and then setting a Boolean to true or false based on that, then ending it by checking to see if each Boolean passed. So there is only one IF clause withh some ANDs in each one.

 

-----signature-----
Using the mirror of ridicule to force conservatives to
confront their own stupidity.

Link to this post
Szerek 
Posts: 4,747
Registered: Aug 8, '00
Extended Info (if available)
Real Post Cnt: 4,343
User ID: 38,666
Subject: It takes a certain type of personality to write code
I worked on this doozy a few weeks ago. The programmer that wrote it should be shot because there are better ways to do this. FYI, this is one of 20 if statements like this in the program. Due to the commonalities in the IF clusters the whole program should have been written with a select structure. Of course, they won't give us the time to re-write it, but it is a nightmare to maintain and we spend hours every month patching this POS program up.

So, is it cheaper to re-write the program in 40 hours or spend 10 hours a month for the last 2 years tweaking an abomination?

IF VAR1 OF PASSED-DATA NOT = 'VAL1' AND
...((VAR2 OF PASSED-DATA = 'A' AND
....VAR2 OF PASSED-DATA = 'L') OR
....(VAR2 OF PASSED-DATA = 'S' AND
....VAR3 OF PASSED-DATA =
......VAR4 OF PASSED-DATA) OR
....(VAR5 OF PASSED-DATA > 0 AND
.....VAR5 OF PASSED-DATA <= 165)) AND
...VAR4 OF PASSED-DATA NOT = 'VALUE2' AND
...((VAR6 OF PASSED-DATA NOT = 'D' AND
.....VAR6 OF PASSED-DATA NOT = 'C') OR
....(VAR7 OF PASSED-DATA NOT = 'VALUE3')) AND
...NOT ((VAR8 OF PASSED-DATA = 'N' AND
.........VAR9 OF PASSED-DATA = '*' AND
.........VAR10 - VAR11 <= .7) OR
........(VAR8 OF PASSED-DATA = 'N' AND
.........VAR11 OF PASSED-DATA = 'A' AND
.........VAR12 OF PASSED-DATA > 0)) AND
...VAR13 NOT = 0 AND
...VAR14 NOT = 0 AND
...VAR15 >= VAR13 AND
...VAR15 >= VAR14 THEN
...MOVE 'VALUE4' TO VAR16 OF PASSED-DATA

 

-----signature-----
"The reason they call it the American Dream is because you have to be asleep to believe it."
"The IQ and the life expectancy of the average American recently passed each other in opposite directions."
- George Carlin
Link to this post
AzureTyger 
Title: Awesome
Posts: 29,693
Registered: Apr 1, '02
Extended Info (if available)
Real Post Cnt: 26,594
User ID: 663,926
Subject: It takes a certain type of personality to write code
Mine is easier.

This is IBM eSQL, and the criteria were:

If order type is "CARDI" and patient location is "HOSPA" or "HOSPB" and the order type isn't "CARDI-EKG" or "CARDI-TT"  send the message
If order type is "CARDI" and patient location is not "HOSPA"  or " HOSPB " and the order type is not an EKG, TT, HM, PS, SC, TR, TT , send the message

Don't send anything else

The original code was:

 

       CREATE FUNCTION Main() RETURNS BOOLEAN

       BEGIN

              DECLARE input REFERENCE TO Body;

              DECLARE Processchk BOOLEAN 'UNKNOWN';

              DECLARE hl7 NAMESPACE 'urn:hl7-org:v2xml';

              DECLARE flag, pv1_3, obr_4, obr_18 CHAR;

      

              SET flag = substring(input.hl7:OBR.hl7:"OBR.4.UniversalServiceIdentifier".hl7:"CE.1" FROM 1 FOR 5);

              SET pv1_3 = substring(input.hl7:PV1.hl7:"PV1.3.AssignedPatientLocation".hl7:"PL.1" FROM 1 FOR 5);

              SET obr_4 = substring(input.hl7:OBR.hl7:"OBR.4.UniversalServiceIdentifier".hl7:"CE.1" FROM 1 FOR 9);

              SET obr_18 = substring(input.hl7:OBR.hl7:"OBR.18.PlacerField1" FROM 1 FOR 5);

 

                    

              IF (flag ='CARDI') THEN

                     IF (pv1_3 = 'HOSPA' OR pv1_3 = 'HOSPB') THEN

                            IF (CONTAINS(obr_4, 'CARDI-EKG') OR CONTAINS(obr_4, 'CARDI-TT')) THEN

                            SET Processchk = 'FALSE';

                            END IF;

                     ELSE

                            IF (CONTAINS(obr_4, 'CARDI-EKG') OR

                                   CONTAINS(obr_4, 'CARDI-TRI') OR

                                   CONTAINS(obr_4, 'CARDI-HM')  OR

                                   CONTAINS(obr_4, 'CARDI-PS')  OR

                                   CONTAINS(obr_4, 'CARDI-SC')  OR

                                   CONTAINS(obr_4, 'CARDI-TT')  OR

                                   CONTAINS(obr_4, 'CARDI-TR')) THEN

                            SET Processchk = 'FALSE';

                            ELSE

                                   SET Processchk = 'TRUE';

                            END IF;

                     END IF;

              ELSE

                            SET Processchk = 'TRUE';

              END IF;

                           

              RETURN Processchk;

       END;

This basically passed any value through, whether it was "CARDI" or not.

I am going to try this, which passed the syntax check. I am sure there are way more efficient and elegant ways to do it, but I don't have the skill. I would rather have used NOT IN (1,2,3,4,5) on the bottom one instead of calling the same variable over and over, but I have not been able to make that work in the past.

 

       CREATE FUNCTION Main() RETURNS BOOLEAN

       BEGIN

              DECLARE input REFERENCE TO Body;

              DECLARE hl7 NAMESPACE 'urn:hl7-org:v2xml';

              DECLARE Processchk, CHECK1, CHECK2 BOOLEAN 'FALSE';

              DECLARE UID1, PATLOC, UID2 CHAR;
      

              SET UID1 = substring(input.hl7:OBR.hl7:"OBR.4.UniversalServiceIdentifier".hl7:"CE.1" FROM 1 FOR 5);

              SET UID2 = substring(input.hl7:OBR.hl7:"OBR.4.UniversalServiceIdentifier".hl7:"CE.1" FROM 1 FOR 9);

              SET PATLOC = substring(input.hl7:PV1.hl7:"PV1.3.AssignedPatientLocation".hl7:"PL.1" FROM 1 FOR 5);


              -- Check If CARDI and HOSPA or HOSPB and not CARDI-EKG and CARDI-TT

                     IF ((UID1 = 'CARDI') AND

                        (PATLOC = 'HOSPA' OR PATLOC = 'HOSPB') AND

                        (UID2 <> 'CARDI-EKG' AND UID2 <> 'CARDI-TT')) THEN

                            SET CHECK1 = 'TRUE';

                     ELSE

                            SET CHECK1 = 'FALSE';

                     END IF;

                    

              -- Check If CARDI and not HOSPA and HOSPB and not EKG, TT, HM, PS, SC, or TR

                      IF ((UID1 = 'CARDI') AND

                        (PATLOC <> 'HOSPA' AND PATLOC <> 'HOSPB') AND

                        (UID2 <> 'CARDI-EKG' AND

                         UID2 <> 'CARDI-TT' AND

                         UID2 <> 'CARDI-HM' AND

                         UID2 <> 'CARDI-PS' AND

                         UID2 <> 'CARDI-SC' AND

                         UID2 <> 'CARDI-TR')) THEN

                            SET CHECK2 = 'TRUE';

                     ELSE

                            SET CHECK2 = 'FALSE';

                     END IF;

                    

              -- Filter message unless CHECK1 OR CHECK2 are 'TRUE'

                     IF (CHECK1 OR CHECK2) THEN

                            SET Processchk = 'TRUE';

                     ELSE

                            SET Processchk = 'FALSE';

                     END IF;

                           

              RETURN Processchk;        

       END;

 

 

-----signature-----
Using the mirror of ridicule to force conservatives to
confront their own stupidity.

Link to this post
Fist_de_Yuma 
Posts: 24,444
Registered: Dec 20, '01
Extended Info (if available)
Real Post Cnt: 21,971
User ID: 566,471
Subject: It takes a certain type of personality to write code
You guys have it so easy. When I started you had MS Basic, machine and binary. I remember spending two days trying to make a door shut without shutter on an Apple IIe. You had to deal with DOS to get anything done. You needed to write functions for even simple jobs. No tools, no graphics and little outside support. Your boss said, "I need this" without any idea what it took to get it. You had to get around the IT guy to get anything off the network, which was a language in itself. I was given a network to handle where the bosses paid for the system without my input. They decided to save money by getting a 5mb drive instead of a 10mb. I had to uninstall all the programs to sort the database. Most of the people coming for help had a Lotus file they wanted to convert into a dBase database. That is when they were not using Lotus for a Word Processor. Don't talk to me about repair. There was one time we etched our own boards. (You drew the paths on a copper sheet and dropped the board into acid to remove all but where you drew.)

I would love to have the tools today for the jobs then. I could have a years work done by the afternoon; and go home early.

(For the weak minded liberals, that is a joke, which is funny because it is partly true. Really, things were hard but less complicated. I'm sure there are different issues today that make it as hard or harder for the "computer guy")

 

-----signature-----
There are three kind of liberals;
Stupid, ignorant or evil
The result is always evil but the intent is not always evil. Not that it makes much difference in the long run.
No one here is exactly as they seem. - G'Kar
Link to this post
Kjarhall 
Title: The Pungent One
Posts: 29,212
Registered: Mar 1, '02
Extended Info (if available)
Real Post Cnt: 23,233
User ID: 652,381
Subject: It takes a certain type of personality to write code
Clearly all coders are conservatives!

 

-----signature-----
You're a crazy moron*
*http://vnboards.ign.com/outpost/b22180/115147923/r115151508/
hah! true story tho i'm a woman an i even love boobs..how can you not??- HallowEve
Link to this post
AzureTyger 
Title: Awesome
Posts: 29,693
Registered: Apr 1, '02
Extended Info (if available)
Real Post Cnt: 26,594
User ID: 663,926
Subject: It takes a certain type of personality to write code
10 test messages have all worked so far, I'll try about 20 more on Monday.

 

-----signature-----
Using the mirror of ridicule to force conservatives to
confront their own stupidity.

Link to this post
Szerek 
Posts: 4,747
Registered: Aug 8, '00
Extended Info (if available)
Real Post Cnt: 4,343
User ID: 38,666
Subject: It takes a certain type of personality to write code
AzureTyger posted:
10 test messages have all worked so far, I'll try about 20 more on Monday.




What kind of system is this running on? z/OS, Unix, Windows?

 

-----signature-----
"The reason they call it the American Dream is because you have to be asleep to believe it."
"The IQ and the life expectancy of the average American recently passed each other in opposite directions."
- George Carlin
Link to this post
AzureTyger 
Title: Awesome
Posts: 29,693
Registered: Apr 1, '02
Extended Info (if available)
Real Post Cnt: 26,594
User ID: 663,926
Subject: It takes a certain type of personality to write code
Szerek posted:
AzureTyger posted:
10 test messages have all worked so far, I'll try about 20 more on Monday.




What kind of system is this running on? z/OS, Unix, Windows?


IBM AIX

 

-----signature-----
Using the mirror of ridicule to force conservatives to
confront their own stupidity.

Link to this post
ZartanAround 
Title: Torpid Curmudgeon
Posts: 13,775
Registered: Feb 6, '04
Extended Info (if available)
Real Post Cnt: 11,365
User ID: 892,117
Subject: It takes a certain type of personality to write code
Sinlock posted:
Taliesihne posted:
Not when you are good at it. kiss


Not true. Dogged, persistent, unwavering patience is mandatory in quality debugging. You cannot be an impatient debugger, or you will fail. coffee



true dat.


"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." – Brian W. Kernighan

 

-----signature-----
what are nice chickens like you doing in a coop like this?
Link to this post
Sinlock 
Title: Savior of the Camelot Outpost
Posts: 27,600
Registered: May 14, '00
Extended Info (if available)
Real Post Cnt: 26,129
User ID: 24,657
Subject: It takes a certain type of personality to write code


I actually love writing code. The main reason is, I want people to leave me the hell alone. I like getting an assignment - "make this one thing happen" - and then I get to sit and work on it with no one annoying me with anything.

I am not management material mainly because I don't want to deal with bullshit and long meetings. coffee

 

-----signature-----
THOOOOKA...THOOOOOKA...THOOOOOKA...
Future Grand President For Life of the Universe (you'll see! you'll be sorry then!)
Outpost Terrorist #1! I don't care what any law says!
Link to this post
Modeeb 
Title: A Ghost In The Machine
Posts: 47,242
Registered: Apr 19, '02
Extended Info (if available)
Real Post Cnt: 39,997
User ID: 670,238
Subject: It takes a certain type of personality to write code
I had to learn BASIC at USC for undergrad business in the late 70's. It was not something I enjoyed.

 

-----signature-----
"What is here is there. What is not here is nowhere." Vishvasara Tantra
"Ever tried, Ever Failed. No matter. Try Again.
Fail Again. Fail Better. Samuel Beckett
Link to this post
the_great_intex 
Title: This is what cool looks like
Posts: 30,622
Registered: Jun 27, '02
Extended Info (if available)
Real Post Cnt: 27,363
User ID: 692,453
Subject: It takes a certain type of personality to write code
I do high level system architecture now. I haven't coded for months

Way better and allows me to be way more creative. I get to tell the code monkeys what to do tongue

I learned programming very early

 

-----signature-----
Only those who dare to fail greatly, can ever achieve greatly
In the middle of difficulty lies opportunity
The only thing in life achieved without effort is failure
Time Circuits... On. Flux Capacitor.... fluxxing.
Link to this post
Sinlock 
Title: Savior of the Camelot Outpost
Posts: 27,600
Registered: May 14, '00
Extended Info (if available)
Real Post Cnt: 26,129
User ID: 24,657
Subject: It takes a certain type of personality to write code


The trick is to get good enough that you can do a day's worth of coding in about 45 minutes. Then you spend the rest of the day dicking around and pretending to work. coffee

 

-----signature-----
THOOOOKA...THOOOOOKA...THOOOOOKA...
Future Grand President For Life of the Universe (you'll see! you'll be sorry then!)
Outpost Terrorist #1! I don't care what any law says!
Link to this post
Mastara 
Posts: 8,982
Registered: Dec 29, '04
Extended Info (if available)
Real Post Cnt: 8,312
User ID: 1,011,569
Subject: It takes a certain type of personality to write code
Get some books, read and practice all the time. It gets easier. I'm still learning. C++ is the easiest one id recommend. Then java.

 

-----signature-----
Boooooommmm Heeeaaaddddshhhhooooottttt!
http://www.carellaross.com/img/truth_its_the_new_hate_speech.jpg
Mastatheimposta - 10L2 SB Merlin
Link to this post
Sinlock 
Title: Savior of the Camelot Outpost
Posts: 27,600
Registered: May 14, '00
Extended Info (if available)
Real Post Cnt: 26,129
User ID: 24,657
Subject: It takes a certain type of personality to write code



Don't buy any damned books and don't read anything. Just keep winging it and using the force. That's what I do. coffee

 

-----signature-----
THOOOOKA...THOOOOOKA...THOOOOOKA...
Future Grand President For Life of the Universe (you'll see! you'll be sorry then!)
Outpost Terrorist #1! I don't care what any law says!
Link to this post
the_great_intex 
Title: This is what cool looks like
Posts: 30,622
Registered: Jun 27, '02
Extended Info (if available)
Real Post Cnt: 27,363
User ID: 692,453
Subject: It takes a certain type of personality to write code
UML diagramming is really useful for structuring code in efficient ways. Planning can save a lot of headaches and a lot of time

 

-----signature-----
Only those who dare to fail greatly, can ever achieve greatly
In the middle of difficulty lies opportunity
The only thing in life achieved without effort is failure
Time Circuits... On. Flux Capacitor.... fluxxing.
Link to this post

Valid XHTML 1.0 Transitional Powered by PHP