Pages: 1
  Print  
Author Topic: We need our own flag for ignoring return values  (Read 1124 times)
Offline (Male) Josh @ Dreamland
Posted on: April 18, 2013, 03:00:51 pm

Prince of all Goldfish
Developer
Location: Pittsburgh, PA, USA
Joined: Feb 2008
Posts: 2949

View Profile Email
With some functions, it's less obvious you really need to use the return value. Like string_replace_all(). When I was young, I spent ten minutes figuring out why string_replace_all wasn't doing anything. I was livid. It's a good case of RTFM, yes, but it's also a great case where we can save users a lot of frustration by using flags like need_result, or something.

This is basically a note for me to add the function into JDI, possibly with more compiler hints. If you have ideas for more compiler hints, post them here, so I can best think up a system for handling them.
Logged
"That is the single most cryptic piece of code I have ever seen." -Master PobbleWobble
"I disapprove of what you say, but I will defend to the death your right to say it." -Evelyn Beatrice Hall, Friends of Voltaire
Offline (Male) Goombert
Reply #1 Posted on: April 18, 2013, 07:15:18 pm

Developer
Location: Cappuccino, CA
Joined: Jan 2013
Posts: 2993

View Profile
I was always confused at a young age because I thought the functions actually replaced the value instead of returning the new string.
Logged
I think it was Leonardo da Vinci who once said something along the lines of "If you build the robots, they will make games." or something to that effect.

Pages: 1
  Print