code hinting in a prefixless world
Now that the Fx component prefix is on its way out (here’s a more nuanced explanation), good code hinting gets a little trickier. Most of the common Spark components will have same-named Halo cousins that skin differently (for instance, spark.components.Button and mx.controls.Button), and simply hinting both of them is bound to cause confusion.
Here are some aspects we’ve considered while discussing this:
- New Flex developers (and really, even a lot of seasoned vets) won’t know what “Halo” and “Spark” mean. So while it’s helpful to include Spark/Halo in the hint (via the package name, one of the things that got improved in the big rename), that only helps if you understand the implication of those terms or package names.
- For most new SDK4 projects, the expectation is that Spark components will 100% supercede their Halo cousins. So hopefully, for a fresh project you won’t need mx:Button.
- The ActionScript editor should probably hint every possible class, but select Spark classes as the default when there are overlaps; for MXML, a “preferred components only” hint list is preferable.
- Hey, what should the Components panel show?
I think we have pretty good ideas that address the above list and still provide preferences for devs whose needs are different.
I’m curious though — for those of you who have been using Gumbo beta SDKs, do your expectations match the above? For new projects, how much do you expect to use Halo components that have Spark equivalents? Are you planning to port your legacy apps to include Spark namespaces and components, and if so what classes/components would you want to show up in code hints?
2 comments2 Comments so far
Leave a reply
I like it.
For new projects, I don’t see any reason I would use Halo components that have Spark counterparts unless they lacked some key feature. But even then the new architecture should make it much easier to add that in, right? ;)
I definitely can see myself porting some older projects, especially ongoing open source stuff.
I like the idea of the “preferred components only” setting assuming it is turned off by default on old projects and turned on by default on new ones.
When I type “Button”, I only want to see one choice. To override that, make me specifically type mx:Button or s:Button. In actionscript the hints should be dictated by the import statements. If they don’t exist yet, set the default based on whether “preferred components only” is set.
Not really on topic but it would be nice to have a Flex Builder feature to analyze old projects and somehow highlight or comment next too the components that have Spark counterparts.
I intend to use only Spark components for future projects. Migration of older projects would depend on project scope but I am sure it will happen for some.
I agree with Ryan’s comment “In actionscript the hints should be dictated by the import statements. If they don’t exist yet, set the default based on whether “preferred components only” is set.”