pharaoh fortune slot
ExamNotes.net
Welcome, Guest. Please login or register.
November 21, 2017, 11:29:47 PM

Login with username, password and session length
* Home Help Search Login Register
+  ExamNotes.net
|-+  General discussions
| |-+  Programming Forum
| | |-+  programmin illiterate
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: [1] 2 Print
Author Topic: programmin illiterate  (Read 4282 times)
DaPunisher
Pasta Guru
Hero Member
*****
Offline Offline

Posts: 937

2


View Profile WWW
« on: February 11, 2004, 05:39:42 PM »

all i know about programming is:

10 print "Dapunisher is cool!"
20 goto 10
Logged

BestTests.com- New and improved forums!  Practice exams for A+, Network+ MCDST, MCSE, CCNA and more!

_______________________
Dr. C
Senior Member
Sr. Member
****
Offline Offline

Posts: 331

0


View Profile WWW
« Reply #1 on: February 11, 2004, 05:48:49 PM »

Quote
Originally posted by DaPunisher
all i know about programming is:

10 print "Dapunisher is cool!"
20 goto 10


goto's lead to spaghetti code . . . you should avoid them whenever possible.
Logged

Nothing says "I Love You" like Corrugated Aluminum.
Rex_tacy
Member
Jr. Member
**
Offline Offline

Posts: 66

0


View Profile
« Reply #2 on: February 14, 2004, 12:45:03 PM »

He's only has two lines of Basic.  I don't think that the would be considered Spaghetti code! Cheesy
Logged
lseals
Senior Member
Hero Member
*****
Offline Offline

Posts: 1306

0


View Profile
« Reply #3 on: February 15, 2004, 02:26:37 AM »

Two is better than one.
Logged

24 Hours in a day...24 Beers in a case...Coincidence?

Avoid hangovers, stay drunk!


icertify dot net

www.ComputerWorld.org
Dr. C
Senior Member
Sr. Member
****
Offline Offline

Posts: 331

0


View Profile WWW
« Reply #4 on: February 15, 2004, 03:49:56 PM »

Quote
Originally posted by Rex_tacy
He's only has two lines of Basic.  I don't think that the would be considered Spaghetti code! Cheesy


Simple programs are incorporated into big ones eventually. Goto's make it very difficult to trace program flow. If you start out programming with poor practices, you learn to program that way which causes problems later.

Trust me, I learned this the hard way.
Logged

Nothing says "I Love You" like Corrugated Aluminum.
Rex_tacy
Member
Jr. Member
**
Offline Offline

Posts: 66

0


View Profile
« Reply #5 on: February 15, 2004, 06:37:52 PM »

Apparently you haven't ever used Basic.  GOTO is a necessity, it isn't like C.
Logged
Dr. C
Senior Member
Sr. Member
****
Offline Offline

Posts: 331

0


View Profile WWW
« Reply #6 on: February 17, 2004, 04:24:03 PM »

Quote
Originally posted by Rex_tacy
Apparently you haven't ever used Basic.  GOTO is a necessity, it isn't like C.


I have used BASIC, and if you have ever had the misfortune of debugging or rewriting a considerable amount of code in old BASIC, you will see exactly what I am talking about!
Logged

Nothing says "I Love You" like Corrugated Aluminum.
Rex_tacy
Member
Jr. Member
**
Offline Offline

Posts: 66

0


View Profile
« Reply #7 on: February 17, 2004, 05:47:46 PM »

The argument for the goto is characterized by advocating its use in specific circumstances rather than its indiscriminate use. Most arguments against gotos are based on indiscriminate use, rather than careful use. The goto controversy began when Fortran was the most popular language. Fortran lacked any presentable loop structures, and, in the absence of any good advice on programming structured loops with gotos, programmers wrote a lot of spaghetti code. Such code undoubtedly was correlated with low quality programs but has little to do with careful use of a goto to make up for a gap in a structured language's capabilities.

A well-placed goto can eliminate duplicate code. Duplicate code leads to problems with the two sets of code being modified differently. It increases the size of source and executable files. The bad effect of the goto is outweighed in such a case by the worse effect of duplicate code.

The gotos is useful in a routine that allocates resources, performs operations on those resources, then deallocates the resources. With gotos, you can cleanup in one section of code, and they reduce the danger of forgetting to deallocate the resources in each place you detect an error.

In some cases, gotos can result in faster and smaller code. Knuth's marvelous 1974 article cited a few cases in which gotos produce a legitimate gain (Knuth 1974).

Good programming doesn't mean eliminating gotos. Methodical decomposition, refinement, and selection of control structures automatically leads to goto-free programs in most cases. gotolessness is not the aim, but the outcome, and putting the focus on no gotos isn't helpful.

Two decades worth of research with gotos has been inconclusive in demonstrating their badness. In a survey of the literature, B. A. Sheil concluded that unrealistic test conditions, poor data analysis, and inconclusive results failed to support the claim that the number of bugs was proportional to the number of gotos (Sheil 1981). That criticism applies to Shneiderman's survey of the literature, cited in the argument against gotos, as well as other studies. Sheil did not conclude that gotos were good, rather that experimental evidence against them was not conclusive.

Finally, goto was included as part of the Ada language, the most carefully engineered programming language in history. Ada was developed long after both sides of the goto debate were fully developed, and, after considering all sides of the issue, included the goto.
Logged
Dr. C
Senior Member
Sr. Member
****
Offline Offline

Posts: 331

0


View Profile WWW
« Reply #8 on: February 18, 2004, 10:52:25 AM »

Goto's can be useful in certain circumstances, but I still think that beginning programmers should be taught that they are to be used as a last resort rather than as a regular means of branching. The danger in this is that it becomes too easy to use a goto whenever you want to branch and then following the code becomes "hard, harder . . . oh, shit, I had just as soon re-write the whole system than to figure this mess out" kind of thing. They are valuable when necessary, but in practice, many people tend to use them when not necessary and this causes problems.

As for duplicate code, most structured languages now include other constructions that allow you to branch to a subrotuine then return to the place where the branch occured rather than just pointing to a different area of the program, never to return. A PERFORM statement like you see in COBOL or a function call in C would be able to reuse the code in the same way as a goto would with none of the associated problems.

I dislike ADA so much that I won't even comment on it. Smiley
Logged

Nothing says "I Love You" like Corrugated Aluminum.
PoorboyTech
Bastard Operator
Sr. Member
****
Offline Offline

Posts: 366

2


View Profile
« Reply #9 on: February 18, 2004, 11:05:18 AM »

I think an important foundation to theoretical programming would also be the understanding of variable declarations, their meanings, arrays, global and local functions.  These concepts are much the foundation of todays languages used.  I initially began programming in basic, etc..then went to pascal, fortran and cobol.  I really started enjoying it when i began programming in C.  Thats where I felt I actually had more knowledge to do stuff rather than a pocket full of gotos and gosubs
Logged

*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
Users...Can't live with'em, can't leave them under the raised floor in the machine room for more than a few weeks...
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
Dr. C
Senior Member
Sr. Member
****
Offline Offline

Posts: 331

0


View Profile WWW
« Reply #10 on: February 18, 2004, 03:34:56 PM »

Quote
Originally posted by PoorboyTech
I think an important foundation to theoretical programming would also be the understanding of variable declarations, their meanings, arrays, global and local functions.  These concepts are much the foundation of todays languages used.  I initially began programming in basic, etc..then went to pascal, fortran and cobol.  I really started enjoying it when i began programming in C.  Thats where I felt I actually had more knowledge to do stuff rather than a pocket full of gotos and gosubs


Actually assembly teaches you more of what actually goes on inside a computer when you tell it to do stuff, but at most colleges, it barely gets a passing nod.
Logged

Nothing says "I Love You" like Corrugated Aluminum.
DaPunisher
Pasta Guru
Hero Member
*****
Offline Offline

Posts: 937

2


View Profile WWW
« Reply #11 on: March 02, 2004, 03:13:47 PM »

ummmmm....like...it was a joke, eh?

I learned how to do that on my Commodore 64 and I thought I was the shiznit!
Logged

BestTests.com- New and improved forums!  Practice exams for A+, Network+ MCDST, MCSE, CCNA and more!

_______________________
Dr. C
Senior Member
Sr. Member
****
Offline Offline

Posts: 331

0


View Profile WWW
« Reply #12 on: March 02, 2004, 04:52:06 PM »

Quote
Originally posted by DaPunisher
ummmmm....like...it was a joke, eh?


Programming is no joke, my friend. It is serious business indeed. So make sure you wear a recently-pressed suit and display proper decorum when speaking of it.
Logged

Nothing says "I Love You" like Corrugated Aluminum.
azimuth40
Senior Member
Hero Member
*****
Offline Offline

Posts: 2073

0


View Profile WWW
« Reply #13 on: March 02, 2004, 07:07:17 PM »

Quote
Originally posted by Dr. C
Programming is no joke, my friend. It is serious business indeed. So make sure you wear a recently-pressed suit and display proper decorum when speaking of it.


Cheesy :cool: Cheesy pressed suit??? Guess you have never been inside Microsoft or Apple or Borland for example.  Suits are for daylight, where real people walk, after a once a week shave, when the algorithm or module of the moment has been beaten into submission and regression tested.

Showers are OK but it is bad karma to shave. Broken little hairs or electric razor residue might fall into your favorite keyboard.  Bugs are really whiskers falling into the keyboard and mixing with pizza cheese and caffeine causing the off by one key to stick down.
Logged
Dr. C
Senior Member
Sr. Member
****
Offline Offline

Posts: 331

0


View Profile WWW
« Reply #14 on: March 03, 2004, 10:42:25 AM »

Quote
Originally posted by azimuth40
Cheesy :cool: Cheesy pressed suit??? Guess you have never been inside Microsoft or Apple or Borland for example.  Suits are for daylight, where real people walk, after a once a week shave, when the algorithm or module of the moment has been beaten into submission and regression tested.

Showers are OK but it is bad karma to shave. Broken little hairs or electric razor residue might fall into your favorite keyboard.  Bugs are really whiskers falling into the keyboard and mixing with pizza cheese and caffeine causing the off by one key to stick down.


I wasn't being literal, but merely trying to impress upon hom the gravity with which programming should be taken.

Personally I have never actually been in a suit and have no intentions of getting in one.

As for showers and shaves . . . those are for non-geeks! Wink
Logged

Nothing says "I Love You" like Corrugated Aluminum.
Pages: [1] 2 Print 
« previous next »
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.13 | SMF © 2006-2011, Simple Machines LLC Valid XHTML 1.0! Valid CSS!