[Next entry: "New Glasses"]
Home » Archives » June 2008 » Boneheaded Adobe Flex
[Previous entry: "Installing JBoss Application Server 4.2.2 on Ubuntu 8.04"]
Home » Archives » June 2008 » Boneheaded Adobe Flex
[Previous entry: "Installing JBoss Application Server 4.2.2 on Ubuntu 8.04"]
Boneheaded Adobe Flex
26 June 2008 @ 01:32 PM MST
26 June 2008 @ 01:32 PM MST
Current Music: Assorted
Current Mood: Just working
Current Mood: Just working
The more I learn about Flex the more I'm kind of annoyed with its existence. At the core all of your frontend application is actually just ActionScript which is compiled into a Flash file. Which is fine, except then Adobe created this MXML syntax to allow you a completely different, second way of doing lots of the stuff. The MXML is then automagically converted into ActionScript when you compile, which is then compiled into the Flash file. This would actually be pretty nice if Adobe had kept the MXML separated as a UI syntax only. Meaning you can use it to nicely layout all the User Interface components and then move over to the ActionScript to do the real work. However, instead they mangled a lot of the ActionScript into the MXML syntax as well, so you can do things via the MXML that make more sense if viewed strictly as ActionScript (at least from a strict CS language design Model-View-Controller paradigm).
So it really bugs me that they allow you to kludge so much into the MXML syntax, when your code would end being much more easily maintained and understood if they forced a solid separation between UI and Code.
That's the main thing. Luckily the company I'm working with was smart enough to enforce an MVC policy on the system architecture (or so I've been told, I hope it's true) so the code I work with should be nicely separated to keep me from going crazy.
---
As I've been working through some examples one things I've discovered that for some inexplicable reason, when defining dates, the months are 0-base indexed and dates are 1-base indexed. No one, No one, No one thinks of Months or Days on a 0-base index. Regardless of how much as Computer Scientists we love our 0-base indexing (and I do like it) it is completely inappropriate for Date datatypes (in modern programming languages). But then, using 0-base indexing for Months and 1-base indexing for days, so Flex isn't even consistent within its own data structure! Insane!
If you have no idea what I'm talking about here's an example. 0-base indexing means that you start at 0. So in this case if you want to define something in January you'd use date_object.setMonth(0). to set something to January 16th, example, you can do date_object.setMonth(0,16). Yup, the setMonth method allows you to set the Month and the Date for some reason.
The number of unintentional bugs introduced by this Adobe screwup are going to be incredible. Easy to fix, yes, but completely avoidable by 1-base indexing the Months. Quick you need a date object for September 18, 2008, how is it defined: new Date(2008,9,18)? WRONG! it's this: new Date(2008,8,18). [shakes head slowly]. What moron coded this, and why did it ever get approved into a released product? Really, they indexed the Date field properly, what prevented them from doing the Month field properly as well?
And that's my gripe about Adobe Flex at the moment.
[This Entry]
So it really bugs me that they allow you to kludge so much into the MXML syntax, when your code would end being much more easily maintained and understood if they forced a solid separation between UI and Code.
That's the main thing. Luckily the company I'm working with was smart enough to enforce an MVC policy on the system architecture (or so I've been told, I hope it's true) so the code I work with should be nicely separated to keep me from going crazy.
---
As I've been working through some examples one things I've discovered that for some inexplicable reason, when defining dates, the months are 0-base indexed and dates are 1-base indexed. No one, No one, No one thinks of Months or Days on a 0-base index. Regardless of how much as Computer Scientists we love our 0-base indexing (and I do like it) it is completely inappropriate for Date datatypes (in modern programming languages). But then, using 0-base indexing for Months and 1-base indexing for days, so Flex isn't even consistent within its own data structure! Insane!
If you have no idea what I'm talking about here's an example. 0-base indexing means that you start at 0. So in this case if you want to define something in January you'd use date_object.setMonth(0). to set something to January 16th, example, you can do date_object.setMonth(0,16). Yup, the setMonth method allows you to set the Month and the Date for some reason.
The number of unintentional bugs introduced by this Adobe screwup are going to be incredible. Easy to fix, yes, but completely avoidable by 1-base indexing the Months. Quick you need a date object for September 18, 2008, how is it defined: new Date(2008,9,18)? WRONG! it's this: new Date(2008,8,18). [shakes head slowly]. What moron coded this, and why did it ever get approved into a released product? Really, they indexed the Date field properly, what prevented them from doing the Month field properly as well?
And that's my gripe about Adobe Flex at the moment.
[This Entry]
Replies: 1 Comment
On Thursday, June 26th @ 05:27, Mom said:
Kyle,
I may have to stop reading your blog because it is incomprehensible to me. You wouldn't want that to happen, would you?
Mom
I may have to stop reading your blog because it is incomprehensible to me. You wouldn't want that to happen, would you?
Mom