> Le 9 janv. 2017 à 05:22, Kirk Brooks <[email protected]> a écrit : > > On Sun, Jan 8, 2017 at 5:16 PM, David Adams <[email protected]> wrote: > >>> Does anyone else do this? >> >> Hey Wayne, great question! I've always instinctively and passionately hated >> combined getter setters. > > Yeah - I agree. Combining getting and setting is way more complicated than > separating them by function. This is one of those places where the elegance > of fewer methods is not worth the increased complexity to make it work.
I have no "religion" about one method or setter+getter, it depends. My only personal hate about setters and getters is naming, more exactly the verb position. in 4D langage: OBJECT Get enabled or OBJECT enabled Get? LISTBOX DELETE COLUMN or LISTBOX COLUMN DELETE? in a component: Fs_pathGetParent or Fs_pathParentGet? Ob_setTime or Ob_timeGet? During code input, I always think this way: listbox.column.delete. Never the reverse. Kind of hierarchic notation, BTW. I'd like 4D commands to respect that logic. And since predictive input, definitely the verb at second position is a mess, try for example to input "listbox get+tab" and see the list of proposal: huge! Another thing about naming, is a method with or without $0? In 4D, commands are upper case, functions lower case. At glance, but all upper case sting my eyes. In my methods, I use the chapter prefix: Fs_pathParentGet --> function CSV_importAssistant --> command Just a matter of taste. -- Arnaud de Montard ********************************************************************** 4D Internet Users Group (4D iNUG) FAQ: http://lists.4d.com/faqnug.html Archive: http://lists.4d.com/archives.html Options: http://lists.4d.com/mailman/options/4d_tech Unsub: mailto:[email protected] **********************************************************************

