Today I was asked, why was I still using API 1.0. I rattled off a bunch of reasons. At the end of it, I asked myself why would I use API 2.0?
So what I’d like to know, and from people who’re proficient in API 1.0, what do you like about API 2.0?
If you don’t have any positive advantages to API 2.0, then please don’t post 'em here. Maybe start a “What are the features and benefits of API 1.0” thread instead.
should all the indexs start from 0 now with API 2 ?
better for me than all the 1-based and 0-based mixture of API 1
The fact that you need to ask says volumes.
(ps- I don’t know for certain either, I believe so - but the fact that this has changed at all immediately makes me want to avoid migrating an API1 project to API2… how many obscure bugs will that introduce into a legacy app…?)
Obviously, starting a brand new project is a different matter.
Except for String.NthField which always confuses me.
Don’t confuse API 2 with Web 2. New controls and responsive feature is part of Web 2.
No idea whether new APIs are faster.
it’s only because I don’t use api 2 so I read that, and think it’s a benefice
- Consistent 0-based indexes. Makes porting code from other languages easier
That’s it as far as I can tell.
Same, but with a little more readability.
Good one, consistency (currently not complete)… for example in Web 2.0 we have WebControl.Style… (this is a class for styling).
But on WebToolbarButton we also have a .Style but this is an enumeration for WebToolbarButton.ButtonStyles… Which seems inconsistent…
But I can finally make Windows and Mac show the same date(time) strings in a table. Before, the results did not always match fully, at least not for a localized system.
So you are asking yourself why you’d use it but only want to here positive reasons… might as well just go and use it then…
Thanks Christian. I overlooked just now while answering in haste.
I think the gol was trying to enhance the consistency and modernizing the language, We should do whatever.method() instead of function(whatever), so we could write modern and readable chains like
Var myval = mydata.Trim().Left(10).Upper()
Instead of the reverse notation
Dim mystr As String = Upper(Left(Trim(mydata), 10)
Zero based consistency should be another plus.
Don’t know if we reached proper zero based consistency and we still don’t have all sets of what we need for proper chaining, e.g. we don’t have (literal or expression).method(), so today we still need to write mixed content as
Var mastercode As String = MyCode("My key String").Upper()
Var mastercode As String = "My key String".Encoded().Upper()
Var mastercode As String = ("My key String"+saltVar).Encoded().Upper()
I have no intention to move my big applications to API 2.00. If it ain’t broke, don’t fix it.
However, for new projects, API 2.00 can be fun to use.