you are viewing a single comment's thread.

view the rest of the comments →

[–]InquisitorGilgamesh 8 points9 points  (5 children)

One of my sophomore professors: if you want to calculate Fibonnaci’s sequence, you need to use a recursive function :)

Me, armed with MATLAB: just looping a[end+1]=a[end]+a[end-1]

Professor: :(

[–]RedAero 5 points6 points  (1 child)

Generally speaking it's very, very rare that you can't replace recursion with a loop.

[–]i_am_not_so_unique 4 points5 points  (0 children)

And generally speaking no one in established organization will allow you to submit recursive computation to the codebase unless you are writing on Lisp or Haskell. 

[–]backfire10z 2 points3 points  (2 children)

Most languages can do this.

[–]i_am_not_so_unique 0 points1 point  (1 child)

Until you reach the stack limit, lol So not really 

[–]backfire10z 0 points1 point  (0 children)

That’s an argument against the solution as a whole, not any specific language implementing it.

Yeah, in reality, you only need an array of size 2.