{"comment":{"url":"https://api.github.com/repos/openframeworks/openFrameworks/comments/12722765","html_url":"https://github.com/openframeworks/openFrameworks/commit/732d55231329d2a8ebe9656ab337df271cf69897#commitcomment-12722765","id":12722765,"user":{"login":"arturoc","id":48240,"avatar_url":"https://avatars.githubusercontent.com/u/48240?v=3","gravatar_id":"","url":"https://api.github.com/users/arturoc","html_url":"https://github.com/arturoc","followers_url":"https://api.github.com/users/arturoc/followers","following_url":"https://api.github.com/users/arturoc/following{/other_user}","gists_url":"https://api.github.com/users/arturoc/gists{/gist_id}","starred_url":"https://api.github.com/users/arturoc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arturoc/subscriptions","organizations_url":"https://api.github.com/users/arturoc/orgs","repos_url":"https://api.github.com/users/arturoc/repos","events_url":"https://api.github.com/users/arturoc/events{/privacy}","received_events_url":"https://api.github.com/users/arturoc/received_events","type":"User","site_admin":false},"position":5,"line":57,"path":"addons/ofxOsc/src/ofxOscReceiver.h","commit_id":"732d55231329d2a8ebe9656ab337df271cf69897","created_at":"2015-08-15T08:43:28Z","updated_at":"2015-08-15T08:43:28Z","body":"@armadillu the bool parameters where introduced after 0.8.4 so they haven't been in any public release.\r\n\r\n@ofTheo the problem is that most times this would be used like:\r\n\r\n```\r\nrx.setup(9000,false)\r\ntx.setup(9001,true);\r\n```\r\n\r\nwhich makes no sense at all when read, if you don't remeber very well if it's the client or the server where broadcast or reuse have to be specified it's even more confusing.. i have on idea what that bool flag means but even if i do i have no idea if it's reuse and no broadcast or broadcast and no reuse. instead:\r\n\r\n```\r\nrx.setupWithSocketReuse(9000);\r\ntx.setup(9001);\r\n```\r\n\r\nis much more explicit and easy to understand just from reading the code. \r\n\r\nwe have this pattern, passing a boolean flag, in several places like\r\n\r\n```\r\nfbo.begin(false);\r\n```\r\n\r\nwhich is really bad practice, it's impossible to understand unless you go to the header. i've been trying to avoid introducing this pattern in even more places, that's why i changed this when fixing something else in ofxOsc some days ago.\r\n\r\nI didn't realize though that the default was true. in that case i would change it to:\r\n\r\n```\r\nsetupWithNoReuse\r\nsetupWithNoBroadcast\r\n```\r\n\r\nor even:\r\n\r\n```\r\ndisableSocketReuse\r\ndisableBroadcast\r\n```\r\n\r\nwhich ideally should be called before setup but if called after setup just recreate the socket."}}