Nobody shares knowledge better than this



  •  @spenk said:

    (I deliberately haven't made it a link to prevent accidental viewing

    Firefox extension Tab Kit has a feature that recognizes links in selected text and can open them as if they were.



  • @dhromed said:

     @spenk said:

    (I deliberately haven't made it a link to prevent accidental viewing

    Firefox extension Tab Kit has a feature that recognizes links in selected text and can open them as if they were.

    Never come across that extension before, it is excellent. It almost makes the time I have spent on this thread worthwhile.

    I still feel however it it just isn't user friendly enough and is really just another way for technical folk to lord it over the typical user. Ideally I should copy the page, save it as a text file, use SSRR's gf command to add it to my index and then delete the original because having more than one file is slow. I could then probably search for it some how and when (if?) I find it I can then open a new browser window and then type it into the address bar myself. See - that would be far easier than your technical solution.



  • @Scarlet Manuka said:

    I have read this entire thread over the last two days; I'm not sure why my head has not exploded yet.
    What were your favorite parts?



  • @spenk said:

    Never come across that extension before, it is excellent. It almost makes the time I have spent on this thread worthwhile.
     

    You'll notice that it is not compatible with firefox 3.6.3.

    However, it is easily upgraded by editing its install.rdf, and changing 3.5.* to 3.6.*



  • @Xyro said:

    What were your favorite parts?
     

    MY PARTS

     

    HAHAHAHA---

     

    oh, ok, right, yes, sorry about that.



  • @dhromed said:

    You'll notice that it is not compatible with firefox 3.6.3.
    Running 3.7a4 anyway :) just forced the install and it works fine.



  • @spenk said:

    Running 3.7a4 anyway
     

    yo dawg, I herd 3.7 was somethin' else.

    Are there Super Features I might like?



  • @dhromed said:

    yo dawg, I herd 3.7 was somethin' else.

    Are there Super Features I might like?

    Runs flash out of process, stops crappy flash things killing the entire browser session - only reason I tried it out.


  • @spenk said:

    Runs flash out of process
     

    Good!



  • @dhromed said:

    @spenk said:

    Running 3.7a4 anyway
     

    yo dawg, I herd 3.7 was somethin' else.

    Are there Super Features I might like?

    Just one: the version number?  It's bigger now.


  • @bstorer said:

    Just one: the version number?  It's bigger now.
     

    This should be good for compatibility.



  • TDWTF Forums:  It's like a rambly IRC except slower and accessible from work.  I love it.



  • /quit error

    Edit: It's not working! It prints error!



  • @spenk said:

    You aren't going to thank me for this but it is still available at
    http://www.telusplanet.net/public/stonedan/source.txt

    Odd; I'd seen what looked like the same link a few times in the thread and gotten a 404. Can't be arsed going back and comparing, though; I guess it was slightly different.

    And I do thank you; I haven't read much of the source code yet but what I have read is hilarious. It's like a lucky dip; scroll to any random area of the code and you get a special WTF.

    [code]' For EE = 1 To 10000000

    ' DoEvents

    ' Next EE 'give it some time[/code]

    @Xyro said:

    What were your favorite parts?

    There's so much to choose from! I think my absolute favourite was the whole "SSDS can do mp3 tag editing too, as soon as someone adds a module to write the updated information back into the mp3 file. Someone do that and send me the code, okay?" bit (here translated from swamp-speak to English for your reading comprehension pleasure).

    I'm almost half-tempted to grab a VB compiler of some description and see if I can work out what it's doing. But there are far easier ways to slack off while at work, after all. Though we do have DR testing this weekend and I may have several hours with nothing particular to do...



  • Another classic snippet. This is to get the previous day's date as a string.

    [code]'06 December 2004 testing previous day.

    '--------------------------------------------------

    'date is as 12/6/2004 for December 06 2004 returned with time also

    'this will not do a previous month ie if sitting on 01 good enought for now.

    If SSS = "DX" Then

    SSS = Format(Now, "ddddd ttttt") 'display today

    temp1 = InStr(2, SSS, " ")

    temptemp = Trim(Left(SSS, temp1))

    II = InStr(temptemp, "/")

    III = InStr(II + 1, temptemp, "/")

    temptemp = Mid(temptemp, II + 1, III - II + 1)

    temp1 = Val(temptemp) - 1 'the day is reduced by 1 here

    If temp1 = 0 Then temp1 = 1 'do not worry about last month for now

    temptemp = CStr(temp1)

    temptemp = Left(SSS, II) + CStr(Val(temptemp)) + Right(SSS, Len(SSS) - III + 1)

    SSS = temptemp

    temp1 = InStr(2, SSS, " ") 'case it changes from 10 to 9 etc

    ' frmproj2.Caption = " 06 Dec 2004 testing=" + temptemp + "=" '06 December 2004

    ' new_delay_sec = 2 '06 December 2004 testing

    ' GoSub line_30300 '06 December 2004 testing

    ' SSS = " " + sep + " " + sep + Left(SSS, temp1 - 1)

    '09 june 2002 SSS = "M" + sep + ":" + sep + Left(SSS, temp1 - 1) 'january 05 2001

    SSS = "M" + sep + "M" + sep + "M" + sep + "M" + sep + ":" + sep + Left(SSS, temp1 - 1) 'january 05 2001

    End If[/code]



    Let's see, how many WTFs?

    • Using ddddd, which is the system defined short date setting. If your short dates aren't in the default format (such as mine which are in dd/mm/yyyy) it'll give you some different date instead (at best). If you're not using / as your separator then you're really stuffed.
    • Using ttttt to get the timestamp portion, and then on the next couple of lines stripping out the timestamp portion because you only want the date.
    • Obviously, the whole "first day of the month is too hard to handle, so let's just leave it not working" thing.
    • Variables named "temp1" and "temptemp". Probably "temp2" is a critically important global variable so he can't use it. Also "II" and "III".
    • Setting [code]temptemp = CStr(temp1)[/code], and then on the next line using [code]CStr(Val(temptemp))[/code].
    • The entire snippet could be replaced by

      [code] If SSS = "DX" Then

      SSS = "M" + sep + "M" + sep + "M" + sep + "M" + sep + ":" + sep + Format(Now - 1, "m/d/yyyy")

      End If[/code]

      and wouldn't be system-settings dependent either. And it would work on the first day of the month.



      Also, the whole "Let's take the variable that stores the user input, and alter it to have the required processing codes for the next stage" approach. Because adding another global variable for that would obviously be way over the top.


  • @Scarlet Manuka said:

    It's like a lucky dip; scroll to any random area of the code and you get a special WTF.
    Assuming you scroll past the 400-ish lines of global variable declarations that is...

    Such gems as

    'Private vs As String * 30            '06 February 2004
    Private vs As String * 255            '19 March 2004  Having this the wrong size was a bug of major proportions...
     

    are contained amongst these declares however. (In case anyone cares vs actually seems to only ever be used for the lpReturnString parameter when calling mciSendString. 



  • Here's a couple lucky dips I just took.  The comments are bolded so help readers figure out what's going on.

     

     Line 364:
     '   Dim SSS1 As String     what the hey why commented out????? ***vip*** it is strange too

     

    Line  703, more evidence that he suffers from a bicameral mind:
    program_info = "Spectate Swamp Desktop Search"   '21 december 2002 (maybe Spectate Swamp)

     

    Line 1032, more SpectateSwapeDateLogic:
    line_30:
            If date_check <> "YES" Then
                GoTo File_40    'no date check if disabled
            End If        'october 27 2000
            If ddemo = "YES" Then
                GoTo File_40    'no date check on demo version
            End If              'as it is restricted enough
    'date check should be good till end of march 2001
            SSS = Format(Now, "ddddd ttttt")    'display today
            temp2 = InStr(SSS, "/")
            temp1 = InStr(temp2 + 1, SSS, "/00")
    '        Print "invalid date="; SSS; "="
    '        tt1 = InputBox("year not /00", , , 4400, 4500)  'TESTING ONLY

            If temp1 = 0 Then
                temp1 = InStr(temp2 + 1, SSS, "/2000")
            End If
            If temp1 = 0 Then
                temp1 = InStr(temp2 + 1, SSS, "/01")
            End If
            If temp1 = 0 Then
                temp1 = InStr(temp2 + 1, SSS, "/2001")
            End If
    'to activate for windows 2000 need a proper date check here as with ME above
            If temp1 = 0 Then
            Print "invalid date="; SSS; "="
            tt1 = InputBox("year not /00 or /01", , , xx1 - offset1, yy1 - offset2) 'TESTING ONLY
                GoTo End_32000
            End If              'year must be 2000
    line_35:
            If Left(SSS, 1) = " " Then
               SSS = Right(SSS, Len(SSS) - 1)
                GoTo line_35
            End If
            If Left(SSS, 3) <> "10/" And Left(SSS, 3) <> "11/" _
                And Left(SSS, 3) <> "12/" And Left(SSS, 2) <> "1/" _
                And Left(SSS, 2) <> "2/" And Left(SSS, 2) <> "3/" Then
    '             Then
            Print "software expired="; SSS; "="
            tt1 = InputBox("e-mail stonedan@telusplanet.net", , , xx1 - offset1, yy1 - offset2) 'TESTING ONLY
                GoTo End_32000
            End If              'must be march also
        screen_capture = "NO"           'march 15 2001

    File_40:

    [...]

    Ok, I need to stop now.



  • @Xyro said:

    'to activate for windows 2000 need a proper date check here as with ME above
    'year must be 2000
     

    ULTIMATE WINNAR



  • @spenk said:

    @Scarlet Manuka said:

    It's like a lucky dip; scroll to any random area of the code and you get a special WTF.
    Assuming you scroll past the 400-ish lines of global variable declarations that is...


    As you point out, the global declarations are full of WTFs too. My favourite part was the lovely naming schemes (note: there are some elisions in the below text; the actual declarations of these similar elements are a little farther apart)...


    [code] Private hhour As String

    Private mminute As String

    Private ssecond As String

    Private hhhour As Long

    Private mmminute As Long

    Private sssecond As Long

    Private chhour As Long

    Private cmminute As Long

    Private cssecond As Long
    [/code]

    I can't imagine that having variables named hhour and hhhour, or ssecond and sssecond, would ever cause any problems....



  • You all have failed me.  This is the third Swampy thread to make it to (almost) 1000 posts. 



  • @belgariontheking said:

    You all have failed me.  This is the third Swampy thread to make it to (almost) 1000 posts. 
    If only you had the power to stop it...



  • @bstorer said:

    @belgariontheking said:
    You all have failed me.  This is the third Swampy thread to make it to (almost) 1000 posts. 
    If only you had the power to stop it...
    If only...



  • @belgariontheking said:

    You all have failed me.  This is the third Swampy thread to make it to (almost) 1000 posts. 

    When the main article doesn't really have a proper WTF in it, it's nice to come here and laugh at Swampy instead.



  • Best app from the 80's is still around

    I had to post this at a couple sites before I found one that didn't immediately delete it.

    You have all heard this before so I won't bore you.

    Few of the current techies were even around back then, so they really can't make any valid comments. But I'm sure that won't stop you.



  • Best App From The 80's. Is Still Around.

    Spectate, this is one sentence. You wrote it as two sentences. That is incorrect. You should have written it as one sentence.



  • @dhromed said:

    Best App From The 80's. Is Still Around.

    Spectate.  This Is One Sentence.

    FTFY


  • @SpectateSwamp said:

    It would be nice if it worked as a net search and not just a personal search.

    Yeah, pretty much the same. Should be no effort to add.

    @SpectateSwamp said:

    When doing the re-write one might just as well do a Mac and Linux version at the same time.
    [...]
    The main function needed is the MciSendString or equivalent for playing video and audio.

    There's no such thing on Mac and Linux. If you really want to make a version for those platforms, try using MPlayer instead of WMP.

    @SpectateSwamp said:

    My first objective would be to break the existing app into 3 smaller segments.

    Er... well, what can I say, that [i]is[/i] a first step in the right direction.

    @SpectateSwamp said:

    The build, the directory related stuff and the Search.

    What? Okay, note. You should divide it in more parts. I.E. make the video display stuff a separate component, the text file search another one, then the indexing part (probably what you call "directory related stuff", then the picture display part, random large scrolling font part, and then a separate part for the user interface. Build these parts as their own components, not combining them with one another at first. Only when they're finished, write a framework that uses all of the parts.

    That's how I would do it.

    @SpectateSwamp said:

    It doesn't index.

    Still not true. What you mean is "It doesn't index automatically".

    @SpectateSwamp said:

    What languages would you suggest. For this final final multiple re-write. Macintosh Windows Linux & Net versions.

    Depends. You could use a more classic approach with C/C++, and use GCC to build. Advantage: probably more frameworks (i.e. MPlayer) you can take advantage from. Downside: it's not Basic. Or you could use a more modern approach, e.g. VisualBasic.net. Upside: You would be using a basic advantage. Hint: to be sure it's cross platform, work with Mono from the start. Disadvantage might be that it's a newer technology, therefore maybe more new things to learn, less mature systems to build upon (though I'm not an expert there).

    Remember: If you want to go multi-platform, you can't use mcisendstring.



  • @SpectateSwamp said:

    What languages would you suggest. For this final final multiple re-write. Macintosh Windows Linux & Net versions.
    I think C or C++ would not be a good choice.  This is a high-level application with an author that has a thing for jamming.  I would recommend a loosey goosey scripting language like Perl or Python.  (I'm more of a Perl fan, myself.)  I can tell you that 100% of the major features in SSDS exist in the standard or community libraries (CPAN or Python equivalent) and can be simply jammed together.  MPlayer or VLC support may not be as tight as MCI integration, but I know they exist and work well because I've used them from CPAN.

    It's completely multiplatform, doesn't even require a compilation stage, and such scripting languages could lend themselves well to your style.

    Or, you know, you could always just use grep. It allows me to find all occurrences of a given element among hundreds of files. At the same time I can output the results to another file or printer via redirection. GNU's grep allowed for setting a window for the match; e.g., 3 lines before and 3 lines after via the context options. It also does highlighting with its color options. Unlike Mac and Linux, Windows doesn't come with its own grep, but there are many many freely downloadable replacements to fill this gap.



  • @Xyro said:

    Perl or Python.

    No! Don't let Swampy ruin the reputation of scripting languages!



  • @derula said:

    @Xyro said:
    Perl or Python.

    No! Don't let Swampy ruin the reputation of scripting languages!

    Yeah, like Perl needs any help...



  • @bstorer said:

    @derula said:
    @Xyro said:
    Perl or Python.

    No! Don't let Swampy ruin the reputation of scripting languages!

    Yeah, like Perl needs any help...

    I don't care about Perl too much.

    Come to think of it, Spectate wouldn't be able to use Python or Ruby anyway.



  • @derula said:

    Come to think of it, Spectate wouldn't be able to use Python or Ruby anyway.

    Filed under: They're lacking goto.

     

    That can be fixed.



  • @derula said:

    Come to think of it, Spectate wouldn't be able to use Python or Ruby anyway.
    @derula said:
    Filed under: They're lacking goto.<input name="ctl00$ctl00$bcr$bcr$ctl00$PostList$ctl32$ctl23$ctl01" id="ctl00_ctl00_bcr_bcr_ctl00_PostList_ctl32_ctl23_ctl01_State" value="value:Filed%20under%3A%20%3Ca%20href%3D%22%2Ftags%2FThey_2700_re%2Blacking%2Bgoto_2E00_%2Fdefault.aspx%22%20rel%3D%22tag%22%3EThey're%20lacking%20goto.%3C%2Fa%3E" type="hidden">

    How about Java, then?  It's cross-platform, Swing meets his criteria of ugliness in a UI, and it has goto.



  • @b_redeker said:

    That can be fixed.

    Except that the second link and the gz download link on the first page 404. Also, you should have used quotation marks around the word "fixed".



  • @bstorer said:

    How about Java, then?  It's cross-platform, Swing meets his criteria of ugliness in a UI, and it has goto.

    It's still quite a leap from Basic, no? Remember, Swampy has been working with Basic pretty much since it was first introduced.

    Huh, I'm pondering...

    Could someone maybe write some macros that allow Spectate to write Basic code in ... whatever language there is that supports macros? He doesn't need much, just goto, if, and ... well, that's pretty much it. Maybe an mcisendstring macro that uses MPlayer behind the scenes?



  • @derula said:

    @bstorer said:
    How about Java, then?  It's cross-platform, Swing meets his criteria of ugliness in a UI, and it has goto.

    It's still quite a leap from Basic, no? Remember, Swampy has been working with Basic pretty much since it was first introduced.

    Huh, I'm pondering...

    Could someone maybe write some macros that allow Spectate to write Basic code in ... whatever language there is that supports macros? He doesn't need much, just goto, if, and ... well, that's pretty much it. Maybe an mcisendstring macro that uses MPlayer behind the scenes?

    Let's just send him backwards: QBASIC.



  • @derula said:

    @b_redeker said:
    That can be fixed.

    Except that the second link and the gz download link on the first page 404. Also, you should have used quotation marks around the word "fixed".

    Seems the server croaks on an extra space: http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/72922 vs http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/72922 

    And http://raa.ruby-lang.org/cache/ruby-goto, so you can still see it in it's full horror. 



  • @b_redeker said:

    And http://raa.ruby-lang.org/cache/ruby-goto, so you can still see it in it's full horror. 

    Great.

    @goto-ruby said:

    def goto(label)

      raise Goto.new(label)

    end

    Nothing more to say.



  • Badge of blah blah blah - a thousand

    @derula said:

    Nothing more to say.
    I think you said more than enough. Nearly 1000 posts YappySwamp Derula



  • GoTo Programmer or NOT

    @derula said:

    @bstorer said:
    How about Java, then?  It's cross-platform, Swing meets his criteria of ugliness in a UI, and it has goto.
    It's still quite a leap from Basic, no? Remember, Swampy has been working with Basic pretty much since it was first introduced.

    Huh, I'm pondering...

    Could someone maybe write some macros that allow Spectate to write Basic code in ... whatever language there is that supports macros? He doesn't need much, just goto, if, and ... well, that's pretty much it. Maybe an mcisendstring macro that uses MPlayer behind the scenes?

     

     

    Maybe try Cobol or Fortran versions. There are probably more Cobol apps running businesses than Basic. They at least have GOTO's. How can you do any jamming it, without a simple GOTO to skip around some untested logic or past a display that you want to disable or view only when running in "test mode"  Those overly nested systems have code looking like a bird flying across the screen. GoTo's clean that up.  Local error trapping makes the code even more useless. I do most error checking using an "on_error routine" to simplify things and for testing. Good Example: Mid 80's. I had FlowCharted the billing, workorder and monthend ... logic for the CableSystem I was working at. Doing a 2 or 3 page chart for each. Not displaying the unimportant checks. Just those that were significant. After returning from a 2 month off-site conversion. I found that most of my charts were thrown out and the rest were in the process of being replaced with 10 to 12 pages for each function. I should have made copies. I should have made copies. It was easier to go directly to the program than look at those next to useless line for line flowcharts. That's the main reason for having all or most of the error checking moved down to an exception handling area for this Search. Far more understandable Far more easy to jam and test. This Search wasn't created by a Genius. So It doesn't need a bigger Genius to maintain or upgrade it. Much easier to test out 1 simple program that's Centrally trapped, Than a 100 or more adjunct parts that make it next to impossible to extend or upgrade. Better quit yapping and put in The jerky jerk backwards option. At the same time allow for a fast forward video playback. Watch out for those Systems that were written by a Genius. What are you going to do when your programmer gets old and sick. Or dies in a fiery crash. What are you going to do.

     

    Yup if that language can't support this style of programming it ain't worth squat

    We need a society to protect Cobol Fortran and Basic. No perfect perfects allowed.



  • @SpectateSwamp said:

    I found that most of my charts were thrown out and the rest were in the process of being replaced
     

    Yes, you wonder why.



  • Locking good threads isn't sharing knowledge

    @b_redeker said:

    @SpectateSwamp said:

    I found that most of my charts were thrown out and the rest were in the process of being replaced
     

    Yes, you wonder why.

    Yes and I wonder why a good thread like "forum Moderator WTF" got locked. I think bad forum Moderators (and there are lots of them) should be baited and outed. MasterPlanSoftware and Morbiuswilters would do a good job.

    Example: the trapper and hunter forums. Most of these guys are not pro hunter or trapper. They are pro Registration.  They say things like "some of my best friends are Fish Cops" Just like Tax auditors and accountants are friends. Or Seat belt violators and the police are friends. Real people laugh and laugh at the idea. These Mods don't represent what the newbies would expect.

    Yup I'd like to sic MPS and MobiusSwamp on a couple forum mods that I came across. The sneaky ones at channel9 and some of the video forum mods. Bait them and post the results back here as a new thread.

    I should post the disagreement I had with HighTimes. They were not a pro pot mag. They thought that hemp was fine. Duh It ruins outdoor crops. Duh they don't allow PotHeads at their events. At the 94 Amsterdam HT convention they booked us on Singapore airlines. (they execute potheads there) and their talks were full of people pushing hemp rags and saying "I don't thing people should smoke pot' Get them off the stage and don't let these pro-registration forums mislead people into thinking they are leading the charge. Marc Emery is leading the charge for pot by going to jail.

    Most most forums are just about the registrations and not the causes they expound.



  • @SpectateSwamp said:

    How can you do any jamming it, without a simple GOTO to skip around some untested logic or past a display that you want to disable or view only when running in "test mode" 
    Goto has it's uses however there are far better ways to organise code that don't require jumping all over the place though. Putting code into subs and functions for starters, use an "if" block to decide if code should be run or not - far easier and cleaner than your mess of jumps and labels.

    @SpectateSwamp said:

    GoTo's clean that up.  
    Nope, functions and subs can provide far cleaner and more organised code, goto often cause the kind of mess you seem to love (then can no longer maintain).

    @SpectateSwamp said:

     Local error trapping makes the code even more useless. I do most error checking using an "on_error routine" to simplify things and for testing.
    Trapping errors close to where they occur can make code far more maintainable and readable, one massive routine with a single massive error handler is a recipie for disaster really.

    @SpectateSwamp said:

    I found that most of my charts were thrown out and the rest were in the process of being replaced with 10 to 12 pages for each function.
    That speaks volumes about the quality of your charts and the resulting code (does this mean you actually used more than one function however?)

    @SpectateSwamp said:

    This Search wasn't created by a Genius.
    No shit.@SpectateSwamp said:
    So It doesn't need a bigger Genius to maintain or upgrade it.
    It obviously needs somebody other than you as you are always asking others to make changes, never making them yourself any more.

    @SpectateSwamp said:

    Watch out for those Systems that were written by a Genius. What are you going to do when your programmer gets old and sick. Or dies in a fiery crash. What are you going to do.
    If the code is organised into well names routines and classes with well named variables and sane commenting then I would be potentially sad on the programmer's death but the code would still be maintainable, code like SSRR is totally unmaintainable because of the approach you advocate.

    @SpectateSwamp said:

    Yup if that language can't support this style of programming it ain't worth squat
    Abusing "goto" isn't technically a style of programming, it is simply a lack of understanding of the better methods available.



  • @SpectateSwamp said:

    There are probably more Cobol apps running businesses than Basic.

    I agree.

    @SpectateSwamp said:

    How can you do any jamming it, without a simple GOTO to skip around some untested logic or past a display that you want to disable or view only when running in "test mode"

    You can comment out the part you want to skip. Besides, serious people don't jam it, they have unit tests. And that's not just PPs, it's pretty much everyone who does serious programming.

    @SpectateSwamp said:

    Those overly nested systems have code looking like a bird flying across the screen. GoTo's clean that up.

    Gotos don't clean everything up. That's just wrong. Well they may be a nice way to jump somewhere if you have never heard about loops or sub-routines. Tell me, Swampy, why is this (warning pseudocode, I'm not as good at Basic as you are):

    dim name as string; line_23: print name; 'Print the name, 16/05/2010 goto line_24;

    if name != "SpectateSwamp" then 'What the hey why does this happen??
    goto line_23;
    end if;
    line_24:


    any better than that:

    function print_name(string name) print name; end function;

    if name != "SpecteteSwamp" then
    print_name(name);
    end if;

    , or why is this:

    line_340: if i < 50 then i = i + 1; goto line_340; end if;

    any better than that:

    while i < 50 i = i + 1; end while;

    ? Just why is goto better? I - as many here - don't understand it.

    @SpectateSwamp said:

    Local error trapping makes the code even more useless. I do most error checking using an "on_error routine" to simplify things and for testing.

    Okay, so tell me, what if the same error can occur in completely different situations, once mission critical, once unimportant? let me give you an example:

    sub make_ornament_lamps_blink switch_lamp_off(current_lamp); current_lamp = round(mod(current_lamp + switch_speed, number_lamps)); switch_lamp_on(current_lamp); switch_speed = 1 / abs((number_lamps-1)/2 - current_lamp); end sub;

    sub control_airplane
    speed = meters / time;
    'snip some trivial stuff
    end sub;

    'snip more trivial stuff

    function on_error(error)
    if error = DivisionByZero then
    'Happens with the ornament lamp code for some reason, ignore it
    else
    'snip some error handling
    end if;
    end function;

    'more trivial stuff

    Now imagine the plane's time meter returns 0. Nothing will be done. The complete control_airplane function will be skipped without any error handling. Great? Fuck!

    @SpectateSwamp said:

    I should have made copies. I should have made copies.

    Fuck, they changed the matrix.

    @SpectateSwamp said:

    This Search wasn't created by a Genius.

    QFT.

    @SpectateSwamp said:

    So It doesn't need a bigger Genius to maintain or upgrade it.

    Quoted for basic understanding of maintainability fail.

    @SpectateSwamp said:

    Much easier to test out 1 simple program that's Centrally trapped, Than a 100 or more adjunct parts that make it next to impossible to extend or upgrade.

    If you insist in having a central error handling, you can have that with multi-procedural code, too. Example:

    sub initialize print "HI"; end sub; sub do_some_stuff print "HO"; end sub; sub do_other_stuff raise Exception; end sub; sub finalize print "HUH?" end sub;

    initialize;
    do_some_stuff;
    do_other_stuff;
    finalize;

    on error do
    print "An error happened in a subroutine."
    end;

    There, the exception that is raised in do_other_stuff is propagated to the upper block and caught by the global error handler. Much like you like it, just more modular. And without gotos.

    @SpectateSwamp said:

    Watch out for those Systems that were written by a Genius. What are you going to do when your programmer gets old and sick. Or dies in a fiery crash. What are you going to do.

    Again, I agree. Overly clever code is nonsense. That's a call for maintainability. Again, your code is not maintainable.



  • @derula said:

    Okay, so tell me, what if the same
    error can occur in completely different situations, once mission critical, once
    unimportant? let me give you an example:

    sub make_ornament_lamps_blink switch_lamp_off(current_lamp); current_lamp = round(mod(current_lamp + switch_speed, number_lamps)); switch_lamp_on(current_lamp); switch_speed = 1 / abs((number_lamps-1)/2 - current_lamp); end sub;

    sub control_airplane
    speed = meters / time;
    'snip some trivial stuff
    end sub;

    'snip more trivial stuff

    function on_error(error)
    if error = DivisionByZero then
    'Happens with the ornament lamp code for some reason, ignore it
    else
    'snip some error handling
    end if;
    end function;

    'more trivial stuff

    Now imagine the plane's time meter
    returns 0. Nothing will be done. The complete control_airplane function will be
    skipped without any error handling. Great? Fuck!

    To be fair, there is a standard procedure for getting around this; you have a locator variable which you set to indicate which part of the code you're running, and examine its value in the error handling routine. Not used much in most modern programming languages, of course, due to the superior maintainability of localised exception handling. But it's still a recommended technique in PL/SQL, for instance.



  • @Scarlet Manuka said:

    To be fair, there is a standard procedure for getting around this; you have a locator variable which you set to indicate which part of the code you're running, and examine its value in the error handling routine.

    Don't fucking ever do that; it's unreliable because it can get broken by code optimization. At least for implicit exceptions like division by zero. (That's what my Compiler construction prof told me, I've never tried it.)



  • @derula said:

    @Scarlet Manuka said:
    To be fair, there is a standard procedure for getting around this; you have a locator variable which you set to indicate which part of the code you're running, and examine its value in the error handling routine.
    Don't fucking ever do that; it's unreliable because it can get broken by code optimization. At least for implicit exceptions like division by zero. (That's what my Compiler construction prof told me, I've never tried it.)
    Also, it's fucking awful and anyone who does it should be shot.



  • @dhromed said:

    Best App From The 80's. Is Still Around.
    Spectate, this is one sentence. You wrote it as two sentences. That is incorrect. You should have written it as one sentence.
    SS, your ass just got schooled by a Dutchman who likes dicks.  How does that make you feel?



  • @belgariontheking said:

    @dhromed said:

    Best App From The 80's. Is Still Around.
    Spectate, this is one sentence. You wrote it as two sentences. That is incorrect. You should have written it as one sentence.
    SS, your ass just got schooled by a Dutchman who likes dicks.  How does that make you feel?

    I'm gonna laugh when SS shows up at Dhromed's home... and ask for english lessons.


  •  I will offer him milk and cookies.

     

    BTK, however, will get the better milk and more tasty cookies. I will also provide the lube.


Log in to reply