IWETHEY v. 0.3.0 | TODO
1,095 registered users | 0 active users | 0 LpH | Statistics
Login | Create New User
IWETHEY Banner

Welcome to IWETHEY!

New Readable code is your friend.
So is reading the requirements:

"""
Requirements:

1. I've got Sarah writing "I will not forget my homework"
in her notebook.

2. I think I'll let her stop after 10 pages (note the word "after").

3. Ahh, page 5 -- I switched it to "I will not forget my science homework".
I think I'll change it to health on page 10.
"""

homework_type = u""\nfor page in range(1, 11):\n    print u"Page: %d" % page\n    if page == 5:\n        homework_type = u"science "\n    elif page == 10:\n        homework_type = u"health "\n    for line in range(60):\n        print u"I will not forget my %shomework." % homework_type\n
I was one of the original authors of VB, and *I* wouldn't use VB for a text
processing program. :-)
Michael Geary, on comp.lang.python
New Re: Readable code is your friend.
program homework;\r\n\r\nconst\r\n   subj1 = 'science';\r\n   subj2 = 'health';\r\n\r\nvar\r\n   pagenum : integer;\r\n   pagecnt : integer;\r\n   linecnt : integer;\r\n   i\t   : integer;\r\n   \r\nbegin\r\n   pagecnt := 11;\r\n   linecnt := 60;\r\n   for pagenum := 1 to pagecnt do\r\n   begin\r\n      for i := 1 to linecnt do\r\n      begin\r\n\t if pagenum < 5 then\r\n\t    writeln('I will not forget my homework');\r\n\t if (pagenum > 5) AND (pagenum < 10) then\r\n\t begin\r\n\t    write('I will not forget my ',subj1);\r\n\t    writeln(' homework');\r\n\t end;\r\n\t if pagenum > 10 then\r\n\t begin\r\n\t    write('I will not forget my ',subj2);\r\n\t    writeln(' homework');\r\n\t end;\r\n      end;\r\n   end;\r\nend.
\r\nI agree. Sometimes, the least l33t solution can be the best.


Peter
[link|http://www.debian.org|Shill For Hire]
[link|http://www.kuro5hin.org|There is no K5 Cabal]
[link|http://guildenstern.dyndns.org|Home Page - Now with added Zing!]
New Ugh!
Not only is it Pascal, it's Pascal with three-space indenting!
-YendorMike

[link|http://www.hope-ride.org/|http://www.hope-ride.org/]
New I knew I'd seen that syntax somewhere before
Ah..Pascal.. brings back high-school memories.

/evil grin directed at CRC
New Bad - pagecnt and linecnt should be constants, too. HTH! :-)
New Re: Bad - pagecnt and linecnt should be constants, too. HTH!
I thought about that.

However, if you define them as constants and then later alter the program to read those values in from a file or the user, you'd end up altering more program than if they're declared as variables.

Always plan for the future, and think very hard before declaring something to be constant.


Peter
[link|http://www.debian.org|Shill For Hire]
[link|http://www.kuro5hin.org|There is no K5 Cabal]
[link|http://guildenstern.dyndns.org|Home Page - Now with added Zing!]
Expand Edited by pwhysall Feb. 11, 2004, 03:54:37 PM EST
New Or, "all constants are variables!" :)
Alex

The mind is not a vessel to be filled but a fire to be kindled. -- Plutarch
New Not very "XP" of you - "Always do the least you need to do".
Or, if you want to be REALLY evil, declare them as "assignable typed constants" -- Borland's oldancient concept of "constants" that weren't really constant at all, apparently as a hack(*) at introducing initialized variables to Pascal. (Yes, it's deprecated like all Hell, of course; but the option IS still there, even in Delphi 7.)

But, really, all this [link|http://martinfowler.com/articles/newMethodology.html|"agile methods"] blither is looking more and more convincing to me... Certainly you are agile enough to CHANGE the constants into variables, should the need ever arise? Especially since the change wouldn't be all that big in the first place; the mechanics of file opening and reading and so on would positively dwarf it anyway.




(*): Misguided and best forgotten -- nay, best chopped into microscopic slivers, then burned to cinders and the ashes incinerated AGAIN, then buried under a mile-thick shield of depleted uranium at the bottom of the Marianas trench, and THEN forgotten! -- but, alas, undead like some fucking mummy in a cheesy horror flick.


   [link|mailto:MyUserId@MyISP.CountryCode|Christian R. Conrad]
(I live in Finland, and my e-mail in-box is at the Saunalahti company.)
You know you're doing good work when you get flamed by an idiot. -- [link|http://www.theregister.co.uk/content/35/34218.html|Andrew Wittbrodt]
New I'm not very XP, no.
And I compiled that code with fpc, which is available at:

[link|http://www.freepascal.org/|http://www.freepascal.org/]

I dunno what your strange Windows-things do; because they're not free or Free, so I can't obtain them.


Peter
[link|http://www.debian.org|Shill For Hire]
[link|http://www.kuro5hin.org|There is no K5 Cabal]
[link|http://guildenstern.dyndns.org|Home Page - Now with added Zing!]
New Bullshit, and you (ought to) know it.
PeeWee obstines:
I dunno what your strange Windows-things do; because they're not free or Free, so I can't obtain them.
Thought I'd mentioned [link|http://bdn.borland.com/museum/|this] often enough.


   [link|mailto:MyUserId@MyISP.CountryCode|Christian R. Conrad]
(I live in Finland, and my e-mail in-box is at the Saunalahti company.)
You know you're doing good work when you get flamed by an idiot. -- [link|http://www.theregister.co.uk/content/35/34218.html|Andrew Wittbrodt]
New That's nifty.
Ta, I'll have a rummage.


Peter
[link|http://www.debian.org|Shill For Hire]
[link|http://www.kuro5hin.org|There is no K5 Cabal]
[link|http://guildenstern.dyndns.org|Home Page - Now with added Zing!]
New That is great!
A museum that insists on touching! Danke!
-drl
New Sigh
10,000 lines per minute!

Look at the compile times vs. MSC 5.0 - how the hell did we let them win??

[image|http://bdn.borland.com/article/images/20297/turboc.jpg||||]
-drl
New Heh, look at the magazine quote...
...by Peter Feldman, PC Week; in later days, Peter Coffee at PC Week -- now renamed e-Week -- has been very much gushing about Delphi.

Unless it's the same guy who changed his name, Borland has been very lucky with the Peters at that rag.


   [link|mailto:MyUserId@MyISP.CountryCode|Christian R. Conrad]
(I live in Finland, and my e-mail in-box is at the Saunalahti company.)
You know you're doing good work when you get flamed by an idiot. -- [link|http://www.theregister.co.uk/content/35/34218.html|Andrew Wittbrodt]
New It was all about Windows
Borland completely bungled that move.
--

"...and pronounce all four E's in the word 'shit'"
New Not bungled...
they were fucked by the Vole.

Go back into your history and read up on Shulman's Undocumented Windows. That will completely explain why Borland faltered.
jb4
shrub\ufffdbish (Am., from shrub + rubbish, after the derisive name for America's 43 president; 2003) n. 1. a form of nonsensical political doubletalk wherein the speaker attempts to defend the indefensible by lying, obfuscation, or otherwise misstating that facts; GIBBERISH. 2. any of a collection of utterances from America's putative 43rd president. cf. BULLSHIT
New Including the use of Buck Forland in the credits.
Alex

The mind is not a vessel to be filled but a fire to be kindled. -- Plutarch
New Obstines..HeeHee____Guess you obstreps, eh?
New YYEWWW!
-drl
     I've just turned into my mother - (broomberg) - (55)
         Ahh, page 5 - (broomberg)
         Went through that a while ago with Duncan - (admin)
         Re: I've just turned into my mother - (deSitter) - (52)
             "... you smart college guys -" - (Ashton)
             You can't strcat into a constant -NT - (broomberg) - (49)
                 no sense of humor :) -NT - (deSitter) - (48)
                     There is no humor in buggy code - (broomberg) - (47)
                         What didn't trust yourself? :) -NT - (deSitter)
                         What compiler was that? - (Arkadiy) - (45)
                             IT WAS A JOKE FER CRIMINY - (deSitter) - (35)
                                 Looks to me like they got you good, Ross. -NT - (jake123) - (1)
                                     SHAADAAPP! WHACK! -NT - (deSitter)
                                 Next time, use Perl for string processing jokes :) -NT - (Arkadiy) - (1)
                                     I don't think I remember how! -NT - (deSitter)
                                 Shoulda wrote it in Smalltalk - (tuberculosis) - (11)
                                     Re: Shoulda wrote it in Smalltalk - (deSitter)
                                     That's nice. - (pwhysall) - (9)
                                         I don't visit scripting - (tuberculosis) - (8)
                                             Bitch. -NT - (Yendor)
                                             Re: I don't visit scripting - (deSitter) - (6)
                                                 But you missed the most important part! - (pwhysall)
                                                 Better late than never - (ChrisR) - (4)
                                                     Outfreakin-standing! -NT - (deSitter)
                                                     You win, I wot. -NT - (pwhysall)
                                                     Re: Better late than never - (Yendor) - (1)
                                                         - style points - (ben_tilly)
                                 Readable code is your friend. - (FuManChu) - (18)
                                     Re: Readable code is your friend. - (pwhysall) - (17)
                                         Ugh! - (Yendor) - (1)
                                             I knew I'd seen that syntax somewhere before - (FuManChu)
                                         Bad - pagecnt and linecnt should be constants, too. HTH! :-) -NT - (CRConrad) - (13)
                                             Re: Bad - pagecnt and linecnt should be constants, too. HTH! - (pwhysall) - (12)
                                                 Or, "all constants are variables!" :) -NT - (a6l6e6x)
                                                 Not very "XP" of you - "Always do the least you need to do". - (CRConrad) - (10)
                                                     I'm not very XP, no. - (pwhysall) - (9)
                                                         Bullshit, and you (ought to) know it. - (CRConrad) - (8)
                                                             That's nifty. - (pwhysall)
                                                             That is great! - (deSitter)
                                                             Sigh - (deSitter) - (4)
                                                                 Heh, look at the magazine quote... - (CRConrad)
                                                                 It was all about Windows - (Arkadiy) - (2)
                                                                     Not bungled... - (jb4) - (1)
                                                                         Including the use of Buck Forland in the credits. -NT - (a6l6e6x)
                                                             Obstines..HeeHee____Guess you obstreps, eh? -NT - (Ashton)
                                         YYEWWW! -NT - (deSitter)
                             Re: What compiler was that? - (broomberg) - (7)
                                 (remind me to dunk Barry and then hold him down) -NT - (deSitter) - (5)
                                     Re: (remind me to dunk Barry and then hold him down) - (Ashton) - (1)
                                         Sounds like a good gag gift - (ben_tilly)
                                     remind me to drunk barry and ho him down :-) -NT - (boxley) - (2)
                                         Only if I get to choose the source of the 2nd part -NT - (broomberg) - (1)
                                             beep's nextdoor neighbor's party -NT - (boxley)
                                 Joys of ANSI C, I guess - (Arkadiy)
                             Musta been a Micros~1 compiler - (jb4)
             Friend's kid got out of an oral presentation - (tuberculosis)

Hey, it's a hard day's work in the pits of Minas Morgul, orking cows all day...
171 ms