• (cs) in reply to OneMHz

    Ah, of course. Perhaps a table lookup would be the best way to do it?

    id   recursion_level

    1   1
    2   2
    3   BRILLANT
    4   FILENOTFOUND

    (I know there's a serious point in there somewhere, but I couldn't resist tweaking you a bit.)

  • Holger Friedrich (unregistered) in reply to Welcor
    <FONT style="BACKGROUND-COLOR: #d3d3d3">Welcor wrote the following post at 06-01-2006 3:50 AM: </FONT>

    <FONT style="BACKGROUND-COLOR: #d3d3d3">I had one instructor that I put a certain amount of fear into.  When I challenged him on deducting marks because I did not validate a name by checking that it was not numeric, he challenged me to come up with a case of a numeric name.  I came up with two.</FONT>

    <FONT style="BACKGROUND-COLOR: #d3d3d3">Which were ?</FONT>

    <FONT style="BACKGROUND-COLOR: #d3d3d3">I mean, I certainly can't come up with any.</FONT>

    FortyTwo

  • Teis Johansen (unregistered) in reply to Bill

    I have used that compiler too, and I was shocked when I found out about that restriction. If you think about it, though, it kind of makes sense: The PIC microcontrollers have precious little RAM and some of the really small ones have a hardcoded 3 element hardware stack.

  • Holger Friedrich (unregistered) in reply to Welcor
    Welcor wrote the following post at 06-01-2006 3:50 AM:

    I had one instructor that I put a certain amount of fear into.  When I challenged him on deducting marks because I did not validate a name by checking that it was not numeric, he challenged me to come up with a case of a numeric name.  I came up with two.

    Which were ?

    I mean, I certainly can't come up with any.

    FortyTwo

  • Looce (unregistered) in reply to Gene Wirchenko

    Gene Wirchenko:
    Anonymous:
    OMG - when will they start teaching recursion?


    In my diploma program, they deliberately omitted it.  Given the time constraints, I might well have done the same.  I have used recursion a couple of times, but have not found it that useful for what I do.  Obviously, YMMV.

    At least, they did not teach with that stupid factorial example.

    Sincerely,

    Gene Wirchenko

    I was taught recursion using the Fibonacci number sequence, factorials and tree traversal. But it is needless to say that I didn't learn anything out of that. I had prior experience in programming.

    Captcha = stfu :)

  • Looce (unregistered) in reply to steve

    I have the perfect definition of recursion.

    recursion, n.: see main entry recursion.

    Brillant!

  • Unklegwar (unregistered) in reply to steve
    Anonymous:

    OMG - when will they start teaching recursion?



    In my computer science curriculum, they taught it (with the caveat of BE CAREFUL).

    The problem is all these "get your certification in 6 months" courses. There's no instruction in the actual SCIENCE of things anymore. They push these know-nothings out the door with the absolute minimum knowledge to create "Hello, World".

    As a collegue of mine once mentioned after I finished explaining data structures for expedited data retrieval to other devs: "Keep the science in computer science!"

    The concept that this programmer used a hierarchy of objects like that, but couldn't manage them, is terrifying. Image what other code to handle that structure looks like, and what's going to happen when they hit 61 levels, then 62, then 63. Talk about job security.

    Heh. Captcha is "jiggles". That beats batman any day!



  • Unklegwar (unregistered)

    Now that I think about it, anyone with half a brain would get a bit into this and say to themselves "There HAS to be a better way", and then go ask questions or do research.

    I hope this person was let go soon after claiming this as their "Greatest work". Oh, the humanity!

  • grmcdorman (unregistered) in reply to Bellinghman

    Actually, there are (or were) some architectures with no stacks. I've worked on one; it started out as the UNIVAC 1100 mainframe series. Over time, the company morphed into what is now UNISYS, and the architecture added hardward-supported stacks.

    The languages available at the time were COBOL and FORTRAN, neither of which supported recursion. (As pointed out, though, the later dialects of FORTRAN do support recursion).

    Originally, the return address for functions were stored in, in effect, a static variable for the function. The assembler op code used for subroutine calls was SLJ, or store location and jump; it stored the return address at the target location, and transfered control to the target location plus one. So subroutines looked like this:
    ... main code:
        SLJ SUB
    ....

    SUB:   0
           ... body of subroutine ...
        J *SUB   ; jump to location stored at SUB

    Obviously, trying to recurse with this architecture didn't work at all. It also meant that all code segments had to be writable.

    When languages that could recurse showed up, indexing registers were pressed into service to implement stacks. Eventually, as I said, "real" stacks showed up, with a proper assembler call-subroutine instruction.

    CAPTCHA: clueless. How appropriate.

  • Kazan (unregistered) in reply to joe bruin
    Anonymous:
    jesuswaffle:
    Anonymous:
    OMG - when will they start teaching recursion?


    An iterative solution would work just fine here (you get C, because I don't know VB):


    Actually an interative solution is better because it won't cause a stack overflow when there are a million parent objects.  Those of you who thought of using recursion, consider yourself WTF-enabled.


    yay for irrational recursion hating

    i assume you've never done binary space partitioning or octrees for accelerated graphics rendering and collision detection

    i'll forgive you  

    CAPTCHA: stfu
  • Suffer (unregistered) in reply to Gunther VB
    Anonymous:

    Fuck, I didn't know you could get a degree in Counter Strike

    A lot of students graduate that don't know the most basic programming principles, but they do have a *lot* of creativity in solving programming problems in the most unimaginable ways. Some of them aren't even really interested in writing software (and they are the ones that get employed at a company, start writing their enterprisy application from crap, eh scratch, and afterwards we have the joy of maintaining it).

    Plus the whole load of elderly people that write their super duper software in Access and then try finding a professional to maintain and extend it (by sending us letters reading "Skills needed: MS Access, VB Script, blahblah more stuff that isn't relevant).

    Plus all the say.. 28+ year olds that don't even know OO exists, yet they try to mimic it vaguely by using an "ancestor" once in a while.

    I'm in hell.


    Okay, so you claim the recent graduates (say 21-22?) don't know basic programming principles, and also the old farts (28+ LOL) don't know OO exists.  Wow, you must be that PERFECT age of 23-27???  That brillant age group that singlehandedly invented OO, recursion, and The Interwebs??? LOL the WTF is YOU.  Get a clue, freak, I know people over 40 that were doing OO whilst you were busy soiling your diapers, and could still pwn you in that and CS.
  • (cs)

    Woah!

    That's all I gotta say...

    Yeah ummm...recursion...static variable counting instances instantiated...yeah...

  • awsefaewfafew (unregistered) in reply to Anonymous
    Anonymous:
    Anonymous:
    I used to sell my assignments to other CS students.  They'd come up to me, actually crying, because they couldn't understand programming at even the most fundamental level.
     
    Paid my tuition that way.


    Not that I believe you, but if this was the case then you would lose in the long haul because you have to compete with a bunch of retards that have the same qualifications as yourself, thus lowering your potential earnings and job security.
    Most of those people didn't actually pass the first year courses.  They'd fail the course finals in horrible fashion and that'd be that.
  • foonly (unregistered) in reply to YourName
    Anonymous:
    "And any compiler able to distinguish his ass from a hole in the ground"

    If you are using a compiler that has achieved self-awareness, you sir are using a much better compiler than I. 
    gcc with -O99 is self-aware
  • Foo (unregistered)
    <font face="Courier New">If objNode.NodeId = 3382 Then
    GetNestingLevel = 3
    Else
    GetNestingLevel = 4
    </font><font face="Courier New">End If</font>

    <font face="Arial">Because node number 3382 is MAGICAL... DUH!</font>
  • Marcelo (unregistered) in reply to John Hensley

        Having a Degree means nothing. At the most, it means that if you are and idiot, you are an gradutated idiot.

    I haven´t got a degree and I code circles around most gradutated devs around. Been doing this for the last 12 years too.

  • (cs) in reply to Marcelo
    Anonymous:
        Having a Degree means nothing. At the most, it means that if you are and idiot, you are an gradutated idiot.

    I haven´t got a degree and I code circles around most gradutated devs around. Been doing this for the last 12 years too.


    If you had a degree, you'd realize that your single example means nothing. I guess you skipped the 'stay-at-home stats' course to watch the People's Court instead.

    sincerely,
    Richard Nixon
  • Suffer (unregistered) in reply to Marcelo
    Anonymous:
        Having a Degree means nothing. At the most, it means that if you are and idiot, you are an gradutated idiot.

    I haven´t got a degree and I code circles around most gradutated devs around. Been doing this for the last 12 years too.

    Why are you using circles when you should be using iteration!?!?!
  • (cs) in reply to Gene Wirchenko
    Gene Wirchenko:
    Anonymous:
    OMG - when will they start teaching recursion?


    In my diploma program, they deliberately omitted it.  Given the time constraints, I might well have done the same.  I have used recursion a couple of times, but have not found it that useful for what I do.  Obviously, YMMV.

    At least, they did not teach with that stupid factorial example.

    Sincerely,

    Gene Wirchenko



    Useful for what you do? And that phrase is what separates those who understand what a college degree should be about from those who are just plodding along and getting in the way. A college degree is not job training. Just because you may not use recursion often, it is a core fundamental of Computer Science and should be taught.

    If you think your "diploma program" should have only covered the set of tools you'd need to function in a job, you were looking for a certificate from ITT Tech, not an honest-to-goodness college degree.

    It's scary how people are so disgusted with the idea of learning for the sake of learning.

    sincerely,
    Richard Nixon
  • Indeed (unregistered) in reply to John Hensley
    This is what happens when an employer advertises for "CS degree or equivalent". If someone doesn't have a CS degree, they better be able to show you an outstanding portfolio of past work.
    Oh, please...

    The best people I have worked with, have had no CS degree, and some of the crappiest have. And lots of people in between both.
  • Charles Bretana Jr. (unregistered) in reply to Marcelo

    The following recursive should work just fine, and allows for handling of any number of special case business rules, separated from th main routine.

    <FONT face="Courier New" size=2>public int function GetNestingLevel(Node objNode)
    {
           int nestLevel = 0; 
           if (CheckSpecialCases(objNode, ref nestLevel))
                 return nestLevel;

           while((objNode == objNode.parent) != null)
                nestLevel ++; 
           return nestLevel;
    }

    private bool function CheckSpecialCases(Node objNode, ref int nestLevel)
    {
          if (objNode.NodeID == 3382)  { nestLevel = 3; return true; }
          //else if (...         //handle all other special cases here    
          // ...
          else return false;
    }</FONT>

  • Waterloo fanboy (unregistered) in reply to xix
    Anonymous:
    More stupid recursion tricks.

    Friend and I went to the University of Waterloo, that's in Canada... the big thing tucked away up there.  Anyway, we were in an introduction to CS course (cs130 is what it was called back in the day).  During our written midterm, there was a question asking how to get this robot object (which exposed certain methods to make it move and do stuff) to do something in a pattern.

    Anyway, most people did it iteratively.  Friend of mine used recursion, and it would have worked fine too.  But the TA's gave him a 0 on it.  On appeal to the prof, still, 0.  Why?  "You aren't supposed to know about recursion yet"

    Though he did note in the next term's class, the question was changed to add this at the beginning, "Without using recursion, do the following..."


    captcha=craptastic

    Yay for the University of Waterloo. Except when I took my intro CS course it was CS 131 and we still used those stupid robots.

  • Felix (unregistered) in reply to Gnictigezoink
    Anonymous:
    OBviously, this would be better handled with a loop:

        Sub Main()
            Console.WriteLine("Public Function GetNestingLevel(objNode As Node)")
            Console.WriteLine("   If Not objNode.Parent Is Nothing Then")
            Console.WriteLine("      GetNestingLevel = 0")
            For i As Integer = 1 To 59
                Console.Write("   ElseIf ObjNode.parent")
                For j As Integer = 1 To i
                    Console.Write(".parent")
                Next
                Console.Write(" is nothing then " & vbNewLine)
                If i = 4 Then
                    Console.WriteLine("      If objNode.NodeId = 3382 Then")
                    Console.WriteLine("         GetNestingLevel = 3")
                    Console.WriteLine("      Else")
                    Console.WriteLine("         GetNestingLevel = 4")
                    Console.WriteLine("      End If")
                Else
                Console.WriteLine("      getNestingLevel = " & i)
                End If
            Next
            Console.WriteLine("Else")
            Console.WriteLine("   GetNestingLevel = 60")
            Console.WriteLine("End If")
        End Sub



    OMG how could you guys not comment on this.. i mod this +5 funny!

    //captcha = "enterpisey"
  • Niels (unregistered)
    Alex Papadimoulis:
      ElseIf objNode.Parent.Parent.Parent.Parent.Parent Is Nothing Then
        If objNode.NodeId = 3382 Then
          GetNestingLevel = 3
        Else
          GetNestingLevel = 4
        End If
      ElseIf objNode.Parent.Parent.Parent.Parent.Parent. _
    


    Am I the only one that's scared that this part reads objNode.NodeId = 3382 and not objNode.NodeType = 3382

    ;)

    Seriously though, as others have mentioned before: how the *beep* can you NOT think "there must be a better way..."?
    (CAPTCHA: shizzle indeed)
  • Felix (unregistered) in reply to Niels
    Anonymous:
    Alex Papadimoulis:
      ElseIf objNode.Parent.Parent.Parent.Parent.Parent Is Nothing Then
        If objNode.NodeId = 3382 Then
          GetNestingLevel = 3
        Else
          GetNestingLevel = 4
        End If
      ElseIf objNode.Parent.Parent.Parent.Parent.Parent. _
    


    Am I the only one that's scared that this part reads objNode.NodeId = 3382 and not objNode.NodeType = 3382

    ;)

    Seriously though, as others have mentioned before: how the *beep* can you NOT think "there must be a better way..."?
    (CAPTCHA: shizzle indeed)


    My guess would be that some people are one or more of the following:
    1) to proud to admit that their way is not the best.
    2) to damn lazy to go look for a better way.
    3) work for a manager that doesn't care and just wants it to work so they dont bother to change it

    //captcha = "photogenic"  heh, not this code
  • Suffer (unregistered) in reply to Richard Nixon
    Richard Nixon:
    Gene Wirchenko:
    Anonymous:
    OMG - when will they start teaching recursion?


    In my diploma program, they deliberately omitted it.  Given the time constraints, I might well have done the same.  I have used recursion a couple of times, but have not found it that useful for what I do.  Obviously, YMMV.

    At least, they did not teach with that stupid factorial example.

    Sincerely,

    Gene Wirchenko



    Useful for what you do? And that phrase is what separates those who understand what a college degree should be about from those who are just plodding along and getting in the way. A college degree is not job training. Just because you may not use recursion often, it is a core fundamental of Computer Science and should be taught.

    If you think your "diploma program" should have only covered the set of tools you'd need to function in a job, you were looking for a certificate from ITT Tech, not an honest-to-goodness college degree.

    It's scary how people are so disgusted with the idea of learning for the sake of learning.

    sincerely,
    Richard Nixon

    It is amazing how many people don't understand what a Computer Science degree is.  No real computer science program would omit teaching recursion.  Maybe these people are mistaking information systems degrees, vocational degrees in computer program, or whatever, for a real bachelors degree in computer science.  Or else the people who they think have real CS degrees are lying about it.  I really don't know.  Quite scary, really.

  • Mark H (unregistered) in reply to Niels
    Anonymous:

    Seriously though, as others have mentioned before: how the *beep* can you NOT think "there must be a better way..."?
    (CAPTCHA: shizzle indeed)


    Its either

    1) You think, "There must be a better way, but I don't know what it is."

    2) Your performance assessment is tied to the number of lines of code you write.
  • (cs) in reply to SLerman
    Anonymous:
    That won't work in all variants of BASIC. I'm not sure about any others, but GWBasic only stored a single return address, no matter how many GOSUB's you have. Basically, you had functions, but you couldn't call another function from within a function and still be able to get back to where you started. I'd say that qualifies for a WTF.


    It might not work in all versions of BASIC, but I do not know of one where it will not.  Caveat: Some BASICs have limited GOSUB depth.

    As to your remarks about GW-BASIC, I call bullshit.  I just ran the program under GW-BASIC.  The recursion most definitely happened.  (I traced it with TRON.)  GW-BASIC allows GOSUB nesting to fill available memory.  I have written recursive code in MBASIC (the parent of GW-BASIC).

    Sincerely,

    Gene Wirchenko


  • Marcelo (unregistered) in reply to Suffer

        The real WTF is the fact that the guy did not get fired for this.

  • (cs) in reply to csrster
    Anonymous:
    I'm not sure what _you_ call functions :-) but I seem to recall that Fortran 77 did
    not support recursive function calls. Fortran 90 and later does. From what I now know
    about computer science I actually wonder how they built a language which supports
    functions but _not_ recursion. It seems you would have to add extra logic to
    prevent adding an extra stack frame for the same function.


    It is much easier than that.  Set up the storage statically.  There are no stack frames.  Each routine has its local storage defined at compile-time at fixed addresses, and so there is only one copy.

    Sincerely,

    Gene Wirchenko

  • (cs) in reply to An apprentice
    Anonymous:
    Gene Wirchenko:
    Anonymous:
    OMG - when will they start teaching recursion?


    In my diploma program, they deliberately omitted it.  Given the time constraints, I might well have done the same. I have used recursion a couple of times, but have not found it that useful for what I do.  Obviously, YMMV.

    At least, they did not teach with that stupid factorial example.

    Sincerely,

    Gene Wirchenko

    Please tell us then what method did they use for tree traversal??? (Yes, I know it can be done iteratively - it just shouldn't).

    Captcha: paula :)

    Stacks and Queues work very well for tree traversal without recursion. Switching between depth-first and breadth-first just becomes a list implementation change. Trying to do breadth-first using recursion seems rather counterintuitive.

  • xix (unregistered) in reply to Waterloo fanboy
    Anonymous:
    Anonymous:
    More stupid recursion tricks.

    Friend and I went to the University of Waterloo, that's in Canada... the big thing tucked away up there.  Anyway, we were in an introduction to CS course (cs130 is what it was called back in the day).  During our written midterm, there was a question asking how to get this robot object (which exposed certain methods to make it move and do stuff) to do something in a pattern.

    Anyway, most people did it iteratively.  Friend of mine used recursion, and it would have worked fine too.  But the TA's gave him a 0 on it.  On appeal to the prof, still, 0.  Why?  "You aren't supposed to know about recursion yet"

    Though he did note in the next term's class, the question was changed to add this at the beginning, "Without using recursion, do the following..."


    captcha=craptastic

    Yay for the University of Waterloo. Except when I took my intro CS course it was CS 131 and we still used those stupid robots.




    Yeah, stupid Karel robot class, robot.move(), robot.pickBeeper(), robot.explodeHorriblyAndViolently()

    As I recall, the exam question had you pick up some beepers, and then build a staircase or something out of them, until you ran out of beepers.  Iterative works, recursive works (though it doesn't make the problem easier), but in any case there was no worry about running out of stack space since it was known that the number of beepers was like 10 or something, can Java handle 10 recursive calls?

    But CS at waterloo did teach us recursion, eventually, when we were permitted to know what it was. It was still scary how some poeple managed to actually advance though, as when I was in Graphics (one of the big three) in my last year, I'd still see people wrestling with problems like comparing two floating point numbers for equality, and "what does that little star symbol do?"

    captcha=truthiness (is it like a fortune teller?)

  • IRRePRESSible (unregistered) in reply to steve
    Anonymous:

    OMG - when will they start teaching recursion?

    OMG thank god someone beat me to saying what. I wonder what they would do if maybe there is a change in levels. I had modified the code to interpret the programmers thought at time.

    Public Function GetNestingLevel(objNode As Node)
      'This seems simple
      If Not objNode.Parent Is Nothing Then
        GetNestingLevel = 0
      ElseIf objNode.Parent.Parent Is Nothing Then
        GetNestingLevel = 1
      ElseIf objNode.Parent.Parent.Parent Is Nothing Then
        GetNestingLevel = 2
      ElseIf objNode.Parent.Parent.Parent.Parent Is Nothing Then
        GetNestingLevel = 3
      ElseIf objNode.Parent.Parent.Parent.Parent.Parent Is Nothing Then
        If objNode.NodeId = 3382 Then
          GetNestingLevel = 3
        Else
          GetNestingLevel = 4
        End If
      ElseIf objNode.Parent.Parent.Parent.Parent.Parent. _
                     Parent Is Nothing Then
        GetNestingLevel = 5
      ElseIf objNode.Parent.Parent.Parent.Parent.Parent. _
                     Parent.Parent Is Nothing Then
        GetNestingLevel = 6
      ' -- snip -- '
       'Goddamn it i should have paid attention to recursion
        'i've been programming for 12 hours
      ElseIf objNode.Parent.Parent.Parent.Parent.Parent.Parent. _
                     Parent.Parent.Parent.Parent.Parent.Parent.Parent. _
                     Parent.Parent.Parent.Parent.Parent.Parent.Parent. _
                     Parent.Parent.Parent.Parent.Parent.Parent.Parent. _
                     Parent.Parent.Parent.Parent.Parent.Parent.Parent. _
                     Parent.Parent.Parent.Parent.Parent.Parent.Parent. _
                     Parent.Parent.Parent.Parent.Parent.Parent.Parent. _
                     Parent.Parent.Parent.Parent.Parent.Parent.Parent. _
                     Parent.Parent.Parent.Parent.Parent.Parent.Parent. _
                     Parent.Parent.Parent.Parent.Parent.Parent.Parent Is Nothing Then
        GetNestingLevel = 59
      ELSE
          'I should have learned recursion   
          return    
      End If
    

    End Function

  • (cs) in reply to Welcor

    Quoting restored

    Anonymous:
    Gene Wirchenko:
    I had one instructor that I put a certain amount of fear into.  When I challenged him on deducting marks because I did not validate a name by checking that it was not numeric, he challenged me to come up with a case of a numeric name.  I came up with two.

    Which were ?

    I mean, I certainly can't come up with any.

    A numbered corporation (e.g. "123456 B.C. Ltd.") could easily be referred to as "123456".  (If you do not believe that the abbreviation to the main part of the name would be used, when was the last time you used the term "Microsoft Corporation"?)

    Ordering pizza.  Your phone number is effectively your name.  (Yes, this is a bit of a stretch, but concepts get stretched all the time.)

    Is this a good time to head off to the 7-11?  (Or any of the variants also with two numbers?)

    Sincerely,

    Gene Wirchenko

  • (cs) in reply to Welcor
    Anonymous:

    I had one instructor that I put a certain amount of fear into.  When I challenged him on deducting marks because I did not validate a name by checking that it was not numeric, he challenged me to come up with a case of a numeric name.  I came up with two.

    Which were ?

    I mean, I certainly can't come up with any.



    In Germany, there is "4711", a famous eau-de-cologne.
    In Austria, there is a mobile network operator named "3".
  • (cs) in reply to Richard Nixon
    Richard Nixon:
    Gene Wirchenko:
    Anonymous:
    OMG - when will they start teaching recursion?


    In my diploma program, they deliberately omitted it.  Given the time constraints, I might well have done the same.  I have used recursion a couple of times, but have not found it that useful for what I do.  Obviously, YMMV.

    At least, they did not teach with that stupid factorial example.


    Useful for what you do? And that phrase is what separates those who understand what a college degree should be about from those who are just plodding along and getting in the way. A college degree is not job training. Just because you may not use recursion often, it is a core fundamental of Computer Science and should be taught.


    I know that it is important and used in some areas.  It is not used much in what I do.  I try to use appropriate tools.  If recursion were it, I would use it, but it usually is not.

    If you think your "diploma program" should have only covered the set of tools you'd need to function in a job, you were looking for a certificate from ITT Tech, not an honest-to-goodness college degree.


    Maybe, you do not understand the distinction of "diploma" and "degree" as used at least in my neck of the woods.  A diploma is a two-year program; a degree is four.  Yes, some things did get left out.  I can see why recursion was left out.  The program was rather full.

    It's scary how people are so disgusted with the idea of learning for the sake of learning.


    Even more so how many think that all learning is of equal value.  If you are designing a cirriculum, you have to make choices.

    The program laddered into a baccalaureate program.  Recursion was dealt with there.

    Sincerely,

    Gene Wirchenko

  • (cs) in reply to Gene Wirchenko

    Gene Wirchenko:
    Quoting restored
    ...
    Is this a good time to head off to the 7-11? 
    ...

    When my compiler needs a quart of milk, it says it's off to the Negative Four.

    --Rank

  • (cs) in reply to Gene Wirchenko
    Gene Wirchenko:
    Richard Nixon:
    Gene Wirchenko:
    Anonymous:
    OMG - when will they start teaching recursion?


    In my diploma program, they deliberately omitted it.  Given the time constraints, I might well have done the same.  I have used recursion a couple of times, but have not found it that useful for what I do.  Obviously, YMMV.

    At least, they did not teach with that stupid factorial example.


    Useful for what you do? And that phrase is what separates those who understand what a college degree should be about from those who are just plodding along and getting in the way. A college degree is not job training. Just because you may not use recursion often, it is a core fundamental of Computer Science and should be taught.


    I know that it is important and used in some areas.  It is not used much in what I do.  I try to use appropriate tools.  If recursion were it, I would use it, but it usually is not.

    If you think your "diploma program" should have only covered the set of tools you'd need to function in a job, you were looking for a certificate from ITT Tech, not an honest-to-goodness college degree.


    Maybe, you do not understand the distinction of "diploma" and "degree" as used at least in my neck of the woods.  A diploma is a two-year program; a degree is four.  Yes, some things did get left out.  I can see why recursion was left out.  The program was rather full.

    It's scary how people are so disgusted with the idea of learning for the sake of learning.


    Even more so how many think that all learning is of equal value.  If you are designing a cirriculum, you have to make choices.

    The program laddered into a baccalaureate program.  Recursion was dealt with there.

    Sincerely,

    Gene Wirchenko



    I never said all "learning" was of equal value. In fact, I specifically said that recursion was a fundamental aspect of COMPUTER SCIENCE. I would discuss this further but you'd just end up deleting my post without a second thought.

    Go ahead Gene, enjoy your power trip.

    sincerely,
    Richard Nixon
  • (cs) in reply to Marcelo

    Anonymous:
        Having a Degree means nothing. At the most, it means that if you are and idiot, you are an gradutated idiot.

    I haven´t got a degree and I code circles around most gradutated devs around. Been doing this for the last 12 years too.

    Haven't you learned anything in this thread?  Don't code in circles, use recursion.

  • (cs) in reply to foonly

    Anonymous:
    gcc with -O99 is self-aware

    Number 5 is alive!

  • Mister R (unregistered) in reply to joe bruin

    Perhaps those who think of recursion are smart enough to avoid language-implementations without proper tail recursion?

    At least don't call it a wtf on the programmers, when its a wtf on the implementation of the programming language. Proper tail recursion is always possible and should therefor always be implemented. If I have to think of a stack and a bunch of registers, i'll go and program in assembly, thank you :-)

  • Whatever (unregistered) in reply to Mister R

    The bigger moron is the manager who clearly is not cut-out for a management position. If your subordinates are writing this type of code, then you need to train them, mentor them or even fire them if they can't get better.

    But what you don't do is post their code to a popular site where they will certainly come across it and see what an ass-hat their manager is. Sounds like he is an insecure twit that was promoted because he was a good programmer. Shame his subordinates are going to have to endure the fact he is a lousy manager.

     

     

  • (cs) in reply to Richard Nixon
    Richard Nixon:
    I never said all "learning" was of equal value. In fact, I specifically said that recursion was a fundamental aspect of COMPUTER SCIENCE. I would discuss this further but you'd just end up deleting my post without a second thought.

    Go ahead Gene, enjoy your power trip.


    It is fundamental?  That would mean that many things are based on it.  Oddly, I rarely need these alleged derivative.  That is true for many other people as well.  That makes recursion not fundamental.  It may be very useful in some areas, but it is not useful in all of them.  A thing need not be fundamental to be useful.

    As to your ad hom, complain to Alex.  He made me a moderator.  I did not ask for it.  If he thinks that I am abusing my moderator privileges, he can easily remove them.

    Sincerely,

    Gene Wirchenko

  • David Walker (unregistered) in reply to GoatCheez

    GoatCheez:

    Better question would be what DOESN'T support recursion. Recursion isn't a language feature, it's a programming method. If a language has what we all call functions, then you can recurse.

    You're wrong; really old Fortan didn't allow a function to call itself.  It gave a "recursion error", meaning that Fortran detected that a function called itself, or that a function called another function that was already in the stack.

    I don't know if current Fortran allows recursion or not.

    David

  • (cs) in reply to JoeBloggs
    Anonymous:
    Anonymous:

    OMG - when will they start teaching recursion?

    Does Visual Basic even support recursion?

    Sure. Every time I see VB code I curse. Curse, curse again, recurse...

  • (cs) in reply to Gene Wirchenko
    Gene Wirchenko:
    Richard Nixon:
    I never said all "learning" was of equal value. In fact, I specifically said that recursion was a fundamental aspect of COMPUTER SCIENCE. I would discuss this further but you'd just end up deleting my post without a second thought.

    Go ahead Gene, enjoy your power trip.


    It is fundamental?  That would mean that many things are based on it.  Oddly, I rarely need these alleged derivative.  That is true for many other people as well.  That makes recursion not fundamental.  It may be very useful in some areas, but it is not useful in all of them.  A thing need not be fundamental to be useful.

    As to your ad hom, complain to Alex.  He made me a moderator.  I did not ask for it.  If he thinks that I am abusing my moderator privileges, he can easily remove them.

    Sincerely,

    Gene Wirchenko



    Ha Ha. What a poor argument you've made Gene. The only thing you've demonstrated is your own ignorance of the grand picture.

    You said, "That would mean that many things are based on it.  Oddly, I rarely need these alleged derivative."; which is laughably foolish. Who made the allegation? I said that recursion is fundamental. I never said anything about what can be directly traced to recursion. You, having a rather poor understanding of Computer Science, assume you know what is related to recursion but obviously do not - because otherwise you'd know that most of the concepts you rely on daily can be traced to the philosophical idea that recursion represents. Instead of asking me to expand on my thoughts, you immediately assumed that you had all the answers and decided to insult me.

    I have complained about the fact that you are a moderator. I think it is a very bad decision based on the petty way you carry yourself. You should realize that you are not up to the task and voluntarily give up your moderator status.

    sincerely,
    Richard Nixon
  • Looce (unregistered) in reply to sammybaby
    sammybaby:

    Ah, of course. Perhaps a table lookup would be the best way to do it?

    id   recursion_level

    1   1
    2   2
    3   BRILLANT
    4   FILENOTFOUND

    (I know there's a serious point in there somewhere, but I couldn't resist tweaking you a bit.)

    Did Paula also write that FILENOTFOUND code? If so, can someone refresh my memory as to which forum thread contains that snippet? :)

  • (cs) in reply to Gnictigezoink

    <font face="Arial" size="6">Generator in JavaScript!</font>

    var code =
    'Public Function GetNestingLevel(objNode As Node)\n' +
    '\n' +
    ' If Not objNode.Parent Is Nothing Then\n' +
    ' GetNestingLevel = 0\n';

    var maxLevel = 60;

    for(var i = 1; i < maxLevel; i++)
    {
    code += ' ElseIf objNode';

    for(var j = 0; j < i+1; j++)
    {
    code += '.Parent';
    }

    code += ' Is Nothing Then\n';

    if(i == 4)
    {
    code +=
    ' If objNode.NodeId = 3382 Then\n' +
    ' GetNestingLevel = 3\n' +
    ' Else\n' +
    ' GetNestingLevel = 4\n' +
    ' End If\n';
    }
    else
    {
    code += ' GetNestingLevel = ' + i + '\n';
    }
    }

    code +=
    ' Else\n' +
    ' GetNestingLevel = ' + maxLevel + '\n' +
    ' End If\n' +
    '\n' +
    'End Function';

    The solution is to change maxLevel to something higher, like 100 million. Duh. It's so obvious.

  • (cs) in reply to David Walker
    Anonymous:

    GoatCheez:

    Better question would be what DOESN'T support recursion. Recursion isn't a language feature, it's a programming method. If a language has what we all call functions, then you can recurse.

    You're wrong; really old Fortan didn't allow a function to call itself.  It gave a "recursion error", meaning that Fortran detected that a function called itself, or that a function called another function that was already in the stack.

    I don't know if current Fortran allows recursion or not.

    David



    Ok, thank you for pointing out what a billion other people have already stated... I tend to generalize when trying to make a point.... Sure, 20 years ago not everything supported recursion, but it's 2006... I shoulda stuck the qualifier "modern" in before "language" in that last sentence...

    It is a very valid point though.
  • snow (unregistered) in reply to Gene Wirchenko
    Gene Wirchenko:
    Quoting restored

    Anonymous:
    Gene Wirchenko:
    I had one instructor that I put a certain amount of fear into.  When I challenged him on deducting marks because I did not validate a name by checking that it was not numeric, he challenged me to come up with a case of a numeric name.  I came up with two.

    Which were ?

    I mean, I certainly can't come up with any.

    A numbered corporation (e.g. "123456 B.C. Ltd.") could easily be referred to as "123456".  (If you do not believe that the abbreviation to the main part of the name would be used, when was the last time you used the term "Microsoft Corporation"?)

    Ordering pizza.  Your phone number is effectively your name.  (Yes, this is a bit of a stretch, but concepts get stretched all the time.)

    Is this a good time to head off to the 7-11?  (Or any of the variants also with two numbers?)

    Sincerely,

    Gene Wirchenko

     

    My first thoughts were '007' and '7 of 9'.  (James Bond and Star Trek: Voyageur, respectively)

     

     

Leave a comment on “Living With Parents”

Log In or post as a guest

Replying to comment #:

« Return to Article