If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#11
|
|||
|
|||
"L Smith" wrote in message ... Roger Long wrote: Got it! Damn parentheses. What a difference a ( ) makes. For me, one of the biggest pains in programming, and the cause of more bugs and other problems than anything else, is trying to get my parentheses in the right places. I've recently had the "opportunity" to work with the Scheme programming language. What's one of the key structural elements of its syntax? Parentheses! Talk about a user-unfriendly language. Yes, it is a big problem-- that is, until you're mind is sufficiently expanded that you look at software in a whole new way and the parenthesis "dissolve" into the background. It's almost a kind of a "magic-eye" sort of thing, IYSWIM. Good luck, hope you eventually "get it" Cheers, John Clonts Temple, Texas |
#12
|
|||
|
|||
Paul Tomblin wrote:
If you use a modern user friendly editor like "vi", you can just hit "%" and it will take you to the matching paren, so you can see if they match up correctly. Be careful, the only thing worse than the high wing-low wing debate is the vi-emacs debate. - awh (vi forever!) |
#13
|
|||
|
|||
Drew Hamilton ) wrote:
: Paul Tomblin wrote: : If you use a modern user friendly editor like "vi", you can just hit "%" : and it will take you to the matching paren, so you can see if they match : up correctly. : : Be careful, the only thing worse than the high wing-low wing debate is the : vi-emacs debate. : : - awh : : (vi forever!) : Or vi vs. VMS' edt debate, or unix vs. VMS. --Jerry Leslie (my opinions are strictly my own) Note: is invalid for email |
#14
|
|||
|
|||
John Clonts wrote:
Yes, it is a big problem-- that is, until you're mind is sufficiently expanded that you look at software in a whole new way and the parenthesis "dissolve" into the background. It's almost a kind of a "magic-eye" sort of thing, IYSWIM. Good luck, hope you eventually "get it" Indentation is your friend. Actually, this is related to an aviation topic: CRM. Why do some pilots highlight their route on a chart? Because this makes it far easier for the human eye to locate the route when first looking (back at) the chart. Absent this, various forms of mental processing are required. This takes time and effort. In programming, we've the same opportunity to do things in a way that reduces the need to "think" over trivia. Indentation is one good example. Whether you're programming in a C derivative (in which case you must match braces), a LIST derivative (parens), a language with BEGINs and ENDs, or anything else, doing this "matching" involves work. Proper indentation makes this much easier, as a lexical block is made visually "obvious". It's the equivilent of highlighting the route. Most modern editors will indent automatically, and even using colors or graphical markers to further enhance the display of the code. Using one of these is like shifting to the use of a moving map GPS. - Andrew |
#15
|
|||
|
|||
|
#16
|
|||
|
|||
On Wed, 06 Aug 2003 22:05:32 -0400, L Smith
wrote: Roger Long wrote: Got it! Damn parentheses. What a difference a ( ) makes. I forget those every once in a while. :-)), at least in spreadsheets. For me, one of the biggest pains in programming, and the cause of more bugs and There is so much math required to become a programmer, I'd think that using parentheses would become second nature. Prefix, postfix, and infix. other problems than anything else, is trying to get my parentheses in the right places. You should try writing a compiler :-)) I've recently had the "opportunity" to work with the Scheme programming language. I've not heard of that, but I've been out of the business for over 5 years now. What's one of the key structural elements of its syntax? Parentheses! Parenthesis is pretty important in most programming languages and in virtually all math that is done within the programs. It sets the order in which operations are performed. True the operators such as +, -, /, *, and ^ have their own precedence, but in the end they all bow to the parenthesis. In school we had a few exercises where we had to perform the same math using prefix, postfix, and infix. Now that got *really* confusing. I don't think I could do all of them now. Actually that's not true. I know I couldn't do all of them now. :-)) Post fix is, I believe the same as RPN and I've never successfully managed to use a calculator that used RPN. Talk about a user-unfriendly language. Try straight C using pointers and dynamic memory allocation. They call it a write only language for a reason. :-)) Straight C lets you do virtually anything with almost no type checking. You can add an integer to an address, to a pointer, to a piece of text and it won't complain. More recent compilers let you turn on type checking, or more correctly they are set up for ANSI C and will allow you to turn the type checking off if you wish. Still...Write something in straight C without internal documentation and then go back six months later and try to follow what you wrote. It's a relatively elegant language that lets you write very compact code, unlike the visual counterparts which are very easy to use, but generate "bloat code". Roger Halstead (K8RI EN73 & ARRL Life Member) www.rogerhalstead.com N833R World's oldest Debonair? (S# CD-2) Rich Lemert |
#18
|
|||
|
|||
On Thu, 7 Aug 2003 08:03:45 -0400, Drew Hamilton wrote:
Paul Tomblin wrote: If you use a modern user friendly editor like "vi", you can just hit "%" and it will take you to the matching paren, so you can see if they match up correctly. Be careful, the only thing worse than the high wing-low wing debate is the vi-emacs debate. Not to me...I don't like either one of them.:-)) and haven't had to be concerned with them for over 5 years..er 6 years. I retired during Osh, at Osh in 97...Took my last week of work on vacation...and they still owed me for something like 90 days of vacation(give or take a couple) We weren't allowed to carry over more than 10 days from one year to the next, but they made exceptions for those of us who lived with the computers. I only had one day off in my first two years back after college. All those years after I went back to work I carried a pager even on vacation. They even had me paged over the PA system at Oshkosh one year. Roger Halstead (K8RI EN73 & ARRL Life Member) www.rogerhalstead.com N833R World's oldest Debonair? (S# CD-2) - awh (vi forever!) |
#19
|
|||
|
|||
On Thu, 07 Aug 2003 23:15:45 -0000,
(journeyman) wrote: On Thu, 07 Aug 2003 20:33:53 GMT, Roger Halstead wrote: other problems than anything else, is trying to get my parentheses in the right places. You should try writing a compiler :-)) I have. It's really not that complicated. Just a bunch of basic data structures. I've recently had the "opportunity" to work with the Scheme programming language. I've not heard of that, but I've been out of the business for over 5 years now. Lisp dialect. Lots of Irritating Spurious Parentheses. Been around much longer than 5 years. Post fix is, I believe the same as RPN and I've never successfully managed to use a calculator that used RPN. I remember doing planning for a solo cross-country, using my HP calculator to crunch the numbers for W&B. My instructor's eyes glazed over. Talk about a user-unfriendly language. Try straight C using pointers and dynamic memory allocation. They call it a write only language for a reason. :-)) Straight C lets you C is a friendly language. It's just picky about whom it calls its friends. It's Powerful, elegant, and relatively simple in its structure. It's relatively easy for one who has studied it to write some very powerful programs, but without thorough documentation I don't think I'd ever call it friendly. :-)) I've seen code that students turned in where it took more work to decipher than it did to write it. Course I saw a few students who could write Pascal that way too and it's almost a plain language when it comes to source code. Roger Halstead (K8RI EN73 & ARRL Life Member) www.rogerhalstead.com N833R World's oldest Debonair? (S# CD-2) Morris |
#20
|
|||
|
|||
Roger Halstead wrote:
I've seen code that students turned in where it took more work to decipher than it did to write it. Course I saw a few students who could write Pascal that way too and it's almost a plain language when it comes to source code. Please help. You've the perfect opportunity to teach that code is almost universally read more than it is written. More, the reader is typically unfamiliar with the code being read - even if it's the author, but a few days or weeks or months or years downstream. This should motivate the writing of code designed not to be written quickly, but read easily. Avoiding nested returns, keeping logic expressions simple, commenting, writing short functions... I taught in a "new hire" program for a number of years at a couple of investment banks in NYC a while back. Too may (most?) of the people hired regarded the concept of writing code to be written as foreign. - Andrew |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
AOPA Stall/Spin Study -- Stowell's Review (8,000 words) | Rich Stowell | Aerobatics | 28 | January 2nd 09 02:26 PM |
Want simple flight planning software | marc | Home Built | 13 | December 20th 04 04:36 AM |
Logging approaches | Ron Garrison | Instrument Flight Rules | 109 | March 2nd 04 05:54 PM |
us air force us air force academy us air force bases air force museum us us air force rank us air force reserve adfunk | Jehad Internet | Military Aviation | 0 | February 7th 04 04:24 AM |
"I Want To FLY!"-(Youth) My store to raise funds for flying lessons | Curtl33 | General Aviation | 7 | January 9th 04 11:35 PM |