implicit return? [🇷 for BE/BA]
Hi Hotzi,
I even go a step further, perhaps only because I am rather dumb.
My functions almost always look like this:
I do that to make sure that whatever happens with pairs of curly braces I know that my function return is captured at the end. When finding errors and bugs I just need to look at
In C you can also exit with curly braces in the middle of a function. Debugging that sh!t is impossible for me.
I even go a step further, perhaps only because I am rather dumb.
My functions almost always look like this:
Foo=function(bar)
{
##blah blah, conditions and functionality and loops and loads of curly braces here.
##whatever happens in loops and conditions it sets a variable called e.g. rslt
return(rslt) ##I always have a line at the end that looks like this!
}
I do that to make sure that whatever happens with pairs of curly braces I know that my function return is captured at the end. When finding errors and bugs I just need to look at
rslt
and work backwards. print(rslt)
immediately before the return
statement is often a very good beginning to that. Not sure if this is smarter (in terms of error finding) but it is my solution to a lot of trouble. Possibly just owing to my own lack of skills.In C you can also exit with curly braces in the middle of a function. Debugging that sh!t is impossible for me.
—
Pass or fail!
ElMaestro
Pass or fail!
ElMaestro
Complete thread:
- R Inferno Helmut 2019-04-26 16:03 [🇷 for BE/BA]
- full conditions! mittyri 2019-04-26 16:20
- full conditions! Helmut 2019-04-26 16:41
- full conditions! d_labes 2019-04-27 14:29
- magik of R implicit return mittyri 2019-04-27 22:23
- magik of R implicit return ElMaestro 2019-04-27 22:34
- implicit return? d_labes 2019-04-28 19:36
- implicit return? ElMaestro 2019-04-28 20:36
- implicit return? Helmut 2019-04-28 20:50
- implicit return?ElMaestro 2019-04-28 21:16
- implicit return? Helmut 2019-04-28 23:38
- implicit return? ElMaestro 2019-04-29 09:40
- implicit return? Helmut 2019-04-29 10:41
- implicit return? ElMaestro 2019-04-29 12:55
- built-in ifelse mittyri 2019-04-30 13:05
- implicit return? ElMaestro 2019-04-29 12:55
- implicit return? Helmut 2019-04-29 10:41
- implicit return? ElMaestro 2019-04-29 09:40
- implicit return? Helmut 2019-04-28 23:38
- implicit return?ElMaestro 2019-04-28 21:16
- implicit return? d_labes 2019-04-28 19:36
- magik of R implicit return ElMaestro 2019-04-27 22:34
- magik of R implicit return mittyri 2019-04-27 22:23
- full conditions! mittyri 2019-04-26 16:20