New Framework Dissappointment

Initially I was excited about the new framework - hoping it was going to fix many of the fundamental problems with the language but I’ve been really disappointed that it continues to ignore some of the most annoying and glaring framework issues.

Introspection still can’t tell you the string value of an Enum. You can’t get the full list of an enum’s values to say fill a popupmenu or convert between the two without building a bunch of helper methods. My understanding is that Xojo doesn’t build this info into the runtime code. Well why the heck not? I know saying, “Pretty much every other language does this” is not a good reason. Xojo likes to be ‘different’ but that shouldn’t mean limiting it in regards to fundamental features. The new introspection framework can’t currently get info about a class without an instance. This makes serialization classes a nightmare. Norm also informed me back in the day that deserializing multi-dimensional arrays was pretty much impossible with the current framework - then why did the new framework not address this?

I understand to keep the project small they don’t include unused items. But this is also very dumb. I should be able to iterate through every project item through code.

For each item as Object in Project.ProjectItems //OR at least For each style as Styles in Project.WebStyles
Someone could build these helper methods themselves, but like the Enum missing methods - creating and maintaining these methods is a nightmare! If Xojo still wants to allow people to keep projects smaller by excluding unused items then maybe have an app setting for this. It by far makes more sense for people to be able to access this in code. You could then also do things like GetClassByName(“ClassName”).

I understand Xojo wanting to move to the design of throwing more Exceptions earlier on. But Auto is an annoying replacement for the convenient Variant type. A better solution would have been to create Object Wrapper Classes for all of the primitives as well as their Nullable variants. Not having the Nullable variants makes sharing code and libraries with other people a mess. This is something so fundamental that it really should be included in the framework. I do think the Auto type is salvageable but it needs a lot more helper methods for converting it to other types. Theses methods need both a way that can throws an exception and a way that defaults to a value on exception. Once again having to build these helper (safe) methods is feasible, but it really makes sharing code a nightmare. Also on the topic of exceptions, I was also hoping they would revamp the exceptions to include additional details in the Inner Exception etc…

=========
I know that Auto-Layout is coming to the Web Version and that WebStyles etc… will be getting an overhaul. But with Xojo not giving us any roadmap details or allowing us feedback WHILE these systems are being developed, I’m legitimately concerned that these issues will not meet the expectations and needs of us as a community. (AutoLayout cannot rely on a server-side trip, it needs to be seamless on the client-side. Styles either need to be editable in code or we need to be able to apply multiple styles to controls…)

There’s plenty of other things I’ve missed and new things I would love to see in the framework (Built in array extension methods that can use lambda expressions i.e. inline functions etc… )

Does anyone else have any annoyances/issues with the new framework? Sorry if this seems overly "rant"ish, I don’t intend it to. With XDC coming up next week, its a good time to bring up these topics and get a feel for what’s realistic to fix and what Xojo is willing to do.

I hope to see you all next week!

I don’t know if there is anything particularly new about the Xojo framework. It’s just a necessary evil to make the code cross-device with iOS being so different. Under the hood on Desktop it probably looks a bit like GlueKit where they are essentially using the same code as before. Just re-indexing to 0’s instead of 1’s, using exceptions instead of return codes, etc.

The benefits will be more long term but even then we will get into territory of things that only really work on iOS vs Desktop. The write once run anywhere future still isn’t here and hard to say if it ever will be. Ultimately the new framework is nice in terms of giving you more control over how you handle errors. It’s also nice in the sense that things are a bit more organized and less PHP’ish. This also comes with the burden of being more difficult for casual and novice users who will not understand the pseudo namespaces and hierarchy.

All in all the new framework is not nearly as big of a deal as it sounds. Use it if you need cross-device and don’t if you don’t. It’s probably a strategic error not to use it but you don’t gain much by specifically using it either. It’s a wash. A huge engineering effort that frankly does very little for us.

If it turns out 64-bit still supports the entirety of the old framework then I question the new framework at all. However if it only supports the new framework then there will be a TON of unhappy customers. Rock and a hard place.

be sure to fill feedback cases and write down what problems you have.

e.g . see this cases:
31748 - Please create function to get array with all styles
35052 - introspection class list

[quote=181933:@Brock Nash]Norm also informed me back in the day that deserializing multi-dimensional arrays was pretty much impossible with the current framework - then why did the new framework not address this?
[/quote]
What I did say was writing a single generic class / module that serializes everything wasn’t going to be a plausible design pattern because there are design choices that you can’t make correctly in such a class / module.
You can’t handle certain aspects of pickling / unpickling 2D arrays quite correctly.
And you can’t decide in a single generic class / module whether to do deep vs shallow pickling.

But, thats not to say its impossible to DO serialization.
That would be patently false. It’s obviously possible as the IDE does it. Anyone who writes code that saves & opens documents does it. We do have a set of classes & modules that, in the IDE, are helpers for the overall serialization process.
But each item in a project is more or less an implementor of a serializable interface and we can merrily serialize your project.

Class By Name is also another area where this is possible but it’s not built in.
http://c2.com/cgi/wiki?RegistryPattern
We make use of a pattern like this in the IDE when we unpickle the serialized data.

Its not the C# / Java style - but from a language design perspective Xojo is more C++ than C#
Its spartan and there is stuff that is not built in.

EDIT : here’s aaron notes about serialize / deserialize
https://web.archive.org/web/20080807173352/http://ramblings.aaronballman.com/2008/04/neat_ideas_with_introspection.html