0

I'm trying to name a method in a programming language and can't figure out what it should be called.

I'm looking for a single word or phrase that means "If you give me an object I will place it on its placeholder, if you give me nothing, I will remove its placeholder and any object that was on its placeholder"

What I have tried so far but doesn't really make the sense I need it too is "set or remove" so the method reads like

setOrRemove:object;
4
  • For Programming in general, a more descriptive name is better than a easier one, especially since you have IDE's that let you auto fill in the names.
    – Rivasa
    Commented Oct 30, 2014 at 2:29
  • @Link that's why I am asking for a word or phrase, and I'm writing Objective-C, which is known to be very verbose. Still have the problem though :D
    – JuJoDi
    Commented Oct 30, 2014 at 2:30
  • Your terminology suggests that you do not have a very good grasp on the mechanics of Objective-C.
    – Hot Licks
    Commented Oct 22, 2015 at 12:51
  • "Dismiss" probably already has other meanings in your field so I'll just suggest it as a comment, but a dismissed employee is sometimes replaced and sometimes not.
    – Papa Poule
    Commented Oct 22, 2015 at 13:35

2 Answers 2

2

Toggle is a standard term for switching back and forth between opposite conditions, from toggle switch.

1
  • The issue with toggle is that it generally means to switch between true and false and depends on the current state. In my method, you can change the value, or you can pass nothing to remove the previously set value from existence.
    – JuJoDi
    Commented Oct 30, 2014 at 2:33
1

just replace ? if you give me nothing, i will replace the placeholder with nothing. if you give me an object, I will replace the placeholder with the object. Perhaps replacePlaceholder.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.