Tagged Questions
2
votes
6answers
317 views
Naming functions that retrieve a value
I have this personal rule to start all function/method names with a verb. My verb of choice for functions or methods that get a value based on some data structure or object is get. I'm wondering if ...
12
votes
2answers
618 views
Boolean Method Naming Affirmative vs Negative
Should boolean methods always take the affirmative form, even when they will only ever be used in the negative form?
Say I wanted to check whether an entity exists before creating one, my argument is ...
13
votes
1answer
592 views
Why does the C library use macros and functions with same name?
I am reading 'The Standard C Library' by PJ Plauger which is really interesting. The book explains not only how to USE the library but also how it is implemented.
I have finished reading the ctype.h ...
6
votes
4answers
1k views
What is the name for a NON-self-calling function?
I have a collection of normal functions and self-calling functions within a javascript file. In my comments i want to say something along the lines of "This script can contain both self-calling and ...
10
votes
5answers
1k views
Why are PHP function signatures so inconsistent?
I was going through some PHP functions and I could not help notice the following:
<?php
function foo(&$var) { }
foo($a); // $a is "created" and assigned to null
$b = array();
foo($b['b']);
...
3
votes
18answers
946 views
What do you name functions/variables/etc when you can't think of a good name?
When you are defining a function/variable/etc and are not sure what to name it, what do you name it? How do you come up with a name?
If you use a temporary name as a place-card until you give it it's ...