[haiku-commits] Re: r41412 - haiku/trunk/src/preferences/network

  • From: John Scipione <jscipione@xxxxxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Wed, 11 May 2011 12:26:47 -0400

>
> Besides the fact that it's a coding style violation, the reason we put it
> there is that boolean logic is much simpler to follow than convert-to-int
> logic, and also less error prone.
>
> > Also, why call the _ShowConfiguration method only to just return right
> away? Better to fail early.
>
> No, it's always better to think modular and program defensive: in this
> case, _ShowConfiguration() may be called at more than one location -- do you
> think it's better to check the value each time it's called, or make sure
> that _ShowConfiguration() deals gracefully with invalid parameters. It's an
> API, and as such, it should be as forgiving as possible.
>
> > As I understand it the Network Prefs dialog is going to be replaced soon
> anyway. This is a bandaid
> > on a limb slated for amputation.
>
> Which will make its way into the next release, so it should work properly.
> And while it's going to be replaced at some point, there is no replacement
> ready yet, and it's already in place since years :-)
>

I added a new patch to

https://dev.haiku-os.org/ticket/7038

called Network_Preferences_bad_interface_no_crash_2.diff that puts the check
if settings is NULL in _ShowConfiguration() explicitly. I tested it and the
patch behaves identically. Axel, does this patch look better to you?

John Scipione

Other related posts: