Minal Silimkar
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
Why would you use other logic when you can write recursive a function?
The significant problems we face cannot be solved by the same level of thinking which created them – Einstein
SCJP 1.5, SCWCD, SCBCD in the making
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
"Why would you use other logic when you can write recursive a function?"
Mani (SCEA 1.4)<br /><a href="http://excusemeworld.com/technical/is-scjp-useful-worth-helps-job/" target="_blank" rel="nofollow"> Is SCJP Useful? Worth? Helps job?</a>
1. Recursion will be bad for code readability - not every programmer can understand it.
Originally posted by mani vannan:
3. Recursion can not be inlined by compilers - if i am not wrong.
The Sun Certified Java Developer Exam with J2SE 5: paper version from Amazon, PDF from Apress, Online reference: Books 24x7 Personal blog
Is there any reason to write recursive code?
mani vannan wrote:
1. Recursion will be bad for code readability - not every programmer can understand it.
mani vannan wrote:
2. Recursion is a repeated method call stack - the more you use recursion the more memory stack created
mani vannan wrote:
3. Recursion can not be inlined by compilers - if i am not wrong.
Ulf Dittmer wrote:
The overhead becomes sizeable when the problem is tree-recursive (i.e., involves more than one recursive call per step) and goes to great depths.