Welcome Guest, Not a member yet? Register   Sign In
CodeIgniter 3.0 Proposed Change: NULL v FALSE
#11

[eluser]Tom Schlick[/eluser]
+1 make it happen
#12

[eluser]bhumes[/eluser]
+1 for me.
#13

[eluser]Adrian Walls[/eluser]
+1 for returning NULL when no value exists.

While it should be minor in the grand scheme of things it is a much more sensible approach. Sometimes things have to be done for the betterment of the framework even if it does compromise the ideals of backwards compatibly.
#14

[eluser]sideshowbob[/eluser]
+1 for me. Seems like a well thought out change with solid reasoning.
#15

[eluser]Joseph Wynn[/eluser]
I'm all for returning NULL instead of FALSE - this is the behaviour I'd expect.

Just keep in mind that there *will* be code out there that is doing strict checks against this return value. If you start returning NULL, you'd better make it damn clear to the community that this change will break existing code.
#16

[eluser]ericrjones1[/eluser]
[quote author="Joseph Wynn" date="1335273110"]I'm all for returning NULL instead of FALSE - this is the behaviour I'd expect.

Just keep in mind that there *will* be code out there that is doing strict checks against this return value. If you start returning NULL, you'd better make it damn clear to the community that this change will break existing code.[/quote]

I am performing strict checks against FALSE, so this will cause some code changes for me. But I think returning NULL is the "better" option.

Thanks for making CodeIgniter "better".
#17

[eluser]Unknown[/eluser]
Maybe it'd be possible to store the default value in a config file? This way, people who need backwards compatibility can have it.

Code:
$config['default_null'] = NULL; //change to FALSE for backwards compat
#18

[eluser]Phil Sturgeon[/eluser]
[quote author="Rob Sanchez" date="1335273507"]Maybe it'd be possible to store the default value in a config file? This way, people who need backwards compatibility can have it.

Code:
$config['default_null'] = NULL; //change to FALSE for backwards compat
[/quote]

I'd considered this but this has already been suggested and it has problems of its own:

Adding a config item breaks backwards compatibility, as people need to get this new item into their config file.

That involves us putting a note in the change log, and upgrade guide, as we would be doing with the original proposal anyway.

Anyone ignoring the user guide will find their application broken either way.

If people choose to settle for the backwards compatible option then we have to maintain that for a few versions then drop it, meaning they will continue to develop their applications incorrectly and have a harder time upgrading in the future.

I'm always for making a change backwards compatible when possible, but this specific approach is no better than the original proposal.
#19

[eluser]Ben Edmunds[/eluser]
+1
#20

[eluser]solepixel[/eluser]
I wish it could work more like PHP $_GET and $_POST. So foo is set in $_GET, then return NULL if the value is empty, but if it is not set, return false. If we have to options, why not utilize them both?




Theme © iAndrew 2016 - Forum software by © MyBB