[Interest] QLineEdit upper case
Till Oliver Knoll
till.oliver.knoll at gmail.com
Sat Aug 9 18:25:25 CEST 2014
Am 08.08.2014 um 23:38 schrieb pmqt71 <pmqt71 at gmail.com>:
> thanks Oliver,
> I know about is-a and has-a but in this case I just want do what I can do in 2 seconds with MFC just setting a property.
<evil rant topic="mfc">
Ah... ! MFC! That's where the wind blows from ;)
Probably everything in the MFC framework has been decided within that exact 2 second lifespan.
Like the decision to have a "built-in property" to CAPITALISE the text of every text input widget.
The discussion among the architects - including the folks from sales probably - went maybe like this back then:
Architect 1: "We need a way to make sure that entered text is always UPPER case..."
Architect 2: "That's easy! We define an abstract validation interface and concrete objects..."
Boss: "Objects? You mean as in "OO-objects" (*draws quote signs with his fingers into the air, his eyes roll backwards*)?! Are you freakin' kidding me?! We don't need those objects! Too slow! And we need a solution fast, like, in two seconds!"
Salesman: "... and I have heard of another complaint: users seem to get confused when in Windows 95 they enter a file path c\:Like\This.doc in the Save As dialog, but in the underlying "file system" (*Hey! I'm a sales person! What do I know about file systems!") they get a path C:\LIKE\THIS.DOC. That confuses people!"
Architect 2: "Yeah, y'know, you sales people insisted back then that Windows 95 still be called "95" and hence be released in 1995. That led to this other 2 second design decision to simply wrap a GUI around a DOS kernel..."
Boss: "Shut up! Windows 95 is a modern multi-tasking system, and we are proud of still being able to execute 16bit programs from 1985! Well, sort of... but the "Hello World" program written by Bill himself in 1981 (*raises his voice in a heroic manner*) still runs perfectly on Windows 95! Compatibility, y'know!"
Architect 1: "So what we do now? We re-write the DOS file system?"
Boss: "Shut up!"
Architect: "We create a clean interface which is implemented by objects which..."
Boss: "Fuck you and fuck your objects! Our compiler team is having a hard time with getting C support right, so don't you come with your C++ shit! We need a 2 seconds decision! We don't want to delay Windows 98 any further!"
Salesman: "We need UPPERCAS~1 file names everywhere..."
Boss: "Exactly! So I'm taking a boss decision here: we simply add an UPPER case property to our text input widgets! End of discussion."
4 months later.
Architect 1: "Boss. That Internet thing /is/ becoming bigger and bigger (unlike you predicted)! Developers are even asking to validate IP adresses..."
Boss: "IP what?! They want to question our Intellectual Property?! We do have patents for a reason, for fuck's sake!"
Architect 2: "No, we meant IP as in Intern..."
Boss: "Talking about properties, that reminds me: did you already file a patent claim for that UPPER case validation property of all our text input widgets?"
Architect 2: "Uh... no... the patent department said it was too trivial. Besides, we already have patents on other "validation properties"..."
Boss: "Bummer! That was a genuine invention by me. Anyway, what was that with this Intarnet you said?"
Architect 2: "We need to validate IP addresses. You know, it looks like a number, but it has dots in between."
Boss: "And that's it?! You're bothering me with that Intarrnet Thing? Just add another validation property to all our input widgets!"
Architect 1: "We already anticipated your decision and added a 'Validate as IP' property... like all the other previous validations..."
Architect 2: "... and we're soon running out of bits in those 8 bits that we've reserved for "all possible validations in the future"..."
Architect 1: "... and external developers start complaining that certain validation combinations simply don't make any sense! E.g. setting the "number" validation property together with the "IP" validation... they say they always get "Invalid State", no matter what the input is. We tried to update the API documentation, but it is becoming overly complicated and unreadable."
Boss: "We're still writing documentation? I thought we had already outsourced that to India..."
Architect 2: "... just like the actual implementation, yes! But even our Indian colleagues complain constantly that the implementation of all possible validation permutations is a nightmare, like a combinatorial explosion..."
Salesman: "I don't understand, a combinational what? Is this math?! Is there a USP (Unique Selling Point) in there somewhere?"
Boss: "I completely agree with our marketing department here, this discussion is becoming way too complicated! We need a quick solution - as in "2 seconds" quick solution!"
Architects: "But it was the last "2 seconds" design decision that got us here in the first place!"
Boss: "Don't try to escape! It is your lack of leadership and commitment to the company and bla bla bla... industrialisation... Blablupp... cost targets... bla bli bla blupp... sales in the end that matter - but you understand none of that!"
Salesman: "And we sold 2 gadzillion copies of Windows 95 (projected sales until 2025 anyway)!"
Boss: "See what I mean? /That's/ what I call commitment for the product! So don't come with your whimsical "combinatorial explosion of validations" that no one wants to hear about! There's a reason I said that "8 bits" are enough, so there can be like... uh... only be 8 or 10... there needs to be another Boss Decision here!"
Salesman: "We will already sell that as a new feature in our marketing communication material, you know, just that we are ahead of the IT department. By the way we hired a new design company for our leaflets this year, too!"
Boss: "So here's my 2 seconds decision: we simply create a new API and call it "WidgetExt"! And I hear that 32bit is all the rage now..."
Salesman: "Yes yes! We've already created new "32bit" stickers this year, too!"
Boss: "... so we add like a 32bit field for all possible future validation wishes for all the input widgets! That should also solve your so-called "combinatorial explosion" problem!"
More information about the Interest