Continuing the discussion from API1, API2 & Xojo.Core Question:
I didn’t really want to derail that topic, and I didn’t really want to start another one either where the same things would be re-hashed. But I have and so here goes:
Being very new to Xojo, I’m still trying to get my head around the different syntax, coding format/style/IDE, and now obviously the whole API 1 v 2 situation.
Is this at all equatable to the change of paradigm that Python experienced between version 2 and 3 where statements became functions, return types went from being lists to iterables and iterables became “the norm”? I resisted Python3 for quite a while and I don’t think I could go back to 2 now.
Python, v3 was used to clean out the hacks of previously cobbled together code that had been adapted to work with old paradigms a decade or more old, and give it a clean slate to work with.
I have grown quite accustomed to how even strings are iterable, and the cleanliness of the for...loops
(where EVERYTHING is iterable). I’m hoping that API2 is somewhat doing the same sort of housekeeping. Making Xojo more resilient for the future. Is that what API2 is about?
From what I am seeing, the more annoying thing at the moment (as pointed out by norm) is the fact that examples around the web are (or will be) broken, and things like event name changes… I would like to understand the philosophy behind why click
had to become action
and Opened
to Open
et al (or whichever way they went).
I realise there’s going to be a lot of resistance for broken backwards compatibility, but is this a necessary evil? and is this evil being used to its best advantage?
What have been the real driving forces behind API2 and should the community be on board with them more? At any rate, is there any point to resist something that’s not open source and community driven?
In a year or five, will anyone long for the days of API1?
I’m just curious and really open to hear what people love about either API.
I hope there’s more of a complaint with API2 than it’s just breaking backwards compatibility. For example, the simple change of a method name (IMO) isn’t the be-all-and-end-all, it doesn’t break it so much so that a regex couldn’t fix it, but I am against the renaming if in the same process it’s going to reduce readability, which in some cases, it certainly has.
The only thing I can think of here is the .Action
. To me, Click(ed)
, Open(ed),
Press(ed)etc are much clearer than
Action`, what is the “Action”? What value is returned, etc. I discussed elsewhere that an action on one object returned a boolean as opposed to a string elsewhere and there’s probably examples of it returning something else somewhere else. In my opinion, that’s bad and lacks readability, but I also do think that’s relatively minor.
Anyway, over to you guys, what do you love about API1 or API2? (and I really would much prefer to hear what people like as opposed to not like)