- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
Kinda off topic but i really dont like the extra click from my rss aggregator (www.blorq.com) to get to the comments.
Admin
Ooooh ... I hope you never ever have to work at a financial institution. You'd have to learn COBOL ... they don't want to break code as any screw-up would translate into millions in loss.
So, they take the painful decision... they make their developers learn the "antique" language.
(I'd rather program in FORTRAN than COBOL ... but then, I'd go for C at the least.)
Admin
The REAL problem here is that the developers doing the port were too unskilled to translate the code properly. If you know how to write reliable C++ code, and you properly translate any speed/reliability details from the original, then there's no reason the C++ version should be slower or less reliable. So the real WTF is hiring crappy programmers and then assuming they knew what they're doing.
You're assuming that someone spent the time/money teaching their C++ programmers how to program in FORTRAN. Maybe a manager thought "they don't have to really know FORTRAN - just enough to translate it". And there you have a WTF, and likely a large part of the reason for the instability. Converting from Fortran to C is trivial (it can be automated), but converting it to C++ (real C++, not just FORTRAN as C compiled as C++) would be non-trivial I believe.
Not to mention all the changes they made to make it prettier which I can guarantee would interfere with the program if done by people who didn't understand it...
Admin
I once worked for a service bureau. We convinced a customer of a different service bureau to switch to us instead, so I had to take a Fortran program and make it run on the IBM 370. It was easy. There was only one problem. It was an accounting package that used floating-point for money and the other computer had 36-bit words. The 370 has 32-bit words. We had to convince the customer that $123,321.06 plus $123,321.06 really equalled $246,642.13.
Admin
Yeah. I've seen people use C++ to make incredibly poor-performing apps. Especially when they're new to OO and decide that the first thing they need is a giant class hierarchy for everything.
Admin
Why is everyone's kneejerk reaction to release it as OSS? What does the prof get for releases it as OSS instead of releasing it not OSS?
Admin
Yanks eh?
And why did the other guy have trouble going from .net 1.0 to .net 2.0 ?? RTFM dude.
Admin
Back in the day? Hell, I do that now. Writing embedded code is.... fun and interesting on some days. Like when you find out that one of your system libraries is trying to poke IO lines to locate one piece of hardware, and you're trying to use that IO line for a rather different purpose.
Although writing java to be executed by an 8051 processor running at 30MHz, where it's a fully interpreted JVM (no HotSpot compile-to-native-bytes here...)... That's pretty much a WTF in and of itself.
http://www.maxim-ic.com/products/microcontrollers/tini/
captcha: perfection (!!)
Admin
This wouldn't have been a certain large webmail ASP?
Admin
Admin
lol... nope, not hotmail (or any kind of webmail), and I never worked for MS.
Version 2.0 never saw the light of day. The company imploded when it ran out of money.
Admin
GoBots != Transformers (those were Autobots). The GoBots were a different show entirely.
(I watched both as a kid)
Admin
All that extra "crap" isn't there for a substitute of proper training and knowledge about the line of work. All of that extra "crap" is there to make the program easy to use, and so you don't need to take a class on how to use the program. If the program is well design, an expert in the field should find it fairly easy to use.
Admin
My father had a story: A man went to a tailor to get a suit made. When he tried it on, the fit was miserable. "One leg is shorter than the other!" "So stand a little tilted--it'll look fine!" "The shoulders aren't even either!" "So bend one shoulder down--you'll look great!"
The man hobbled out of the shop as the tailor had directed.
On the street, another man started talking to him: "Where did you get that wonderful suit?" "At the shop over there. But I don't think it's so wonderful." "Whaddya mean? That tailor must be a genius to fit such a nice suit on a cripple like you!"
So sure. Subtract one from all the pointers. Why does the program keep crashing in 'delete'?
Admin
Admin
Admin
That's a bit dense of you -- GoBots were clearly a shitty ripoff of Transformers, which is why the author made the reference in the first place.
I took an 8051-based class at MIT, and there were rumors that some kid had implemented a stripped down JVM for the 2-week final project a couple years back. I'm sure he would have tried to make it fully featured if he'd had enough ROM.Admin
good point. I clearly missed that that might have been a joke.
Hmmm. It wouldn't surprise me to find out that was the source... It appears to take about 400K to pull it off (this is an 8051 core with 24-bit addressing capabilities). It works, it's just slow. VERRRRY slow. But writing java can be far less painful than C/C++. But there's a significant trading of ease of use vs. performance. I get about 100-1000x the performance when I drop into assembly for optimizing routines (array-based math stuff and hardware IO operations pretty much need to be done in assembly or they're laughably slow).
Admin
Oh my god! I think I used to get constant junk mail from the makers of this application (if it was indeed a CAD program for the Mac). I'm not an architect, and have no use for CAD, but I used to get color glossy flyers for this application (ArchiCAD, I think it was?). And it sold for like $57. Isn't AutoCAD something like $10,000 per seat? That was enough to make me realize that this program had to suck hard.
Admin
Admin
Nobody has noticed this?
"They were blown away by The Processor's application..."
Shouldn't it be "The Professor's"?
Admin
Admin
I saw this too, but passed it off as a `bad pun that I didn't get'.
Admin
Admin
ArchiCAD came with the restriction that you had to stand hence the $57 price. AutoCAD is more because it allows you to sit while using it.
Admin
The lesson here isn't about the code, the programmers or the Company - it's about the unhired lawyer.
If you are entering in a business deal, whether it's selling software or buying a house, the $500 (or maybe even more) you spend on a lawyer will be worth it. If you "can't afford" the lawyer, you can't afford the deal.
Admin
Welcome to the land of UNDEFINED BEHAVIOUR.
Admin
Oh, apart from Indy Jones, the warehouse remembers me of the X-Files. Some things better be kept away from the public :D
Admin
Indeed. I have developers all over my workplace right now calling for everything under the sun to be rewritten in Ruby. When asked why, one of them said that programming languages only last about 10 years. I find it amusing that nearly every major application that he uses has been written in a language more than 10 years old.
Admin
Yes. And yes.
Admin
What you really meant was:
Rat is two. The two is fat. The two is hungry. Fat rat put foot. Foot stay put. Put in what? Put in concrete. Hungry rat produce. Produce everything want. Want what? Least better. Better is more food. Fat rat notice. The notice not better. No better no concrete. Fat angry. Fat rat rattle with you. You stop. Hungry notice stop. Stop is not better. The Hungry rat ask. Ask who? Ask you produce. You produce faster things. Someting progress on you. The something disgusting. No quack!
Captcha = creative. Well kinda.
Admin
The first time, when I saw a financial application using floats for its calculations, I thought it was just a stupid mistake. But now that I read "The Daily WTF" regularly I fell this might be much more common.
Where I learned programming I was tought to never ever use floats for financal calculations and to go with integers instead.
Admin
Ah, reminds me of http://www.warehouse23.com/basement/box/
Admin
Job security through obfuscation?
Admin
you kids are so lucky!
these days you have those fancy OSCILLOSCOPES. back in my days, we had to sense the electricity with our fingers. thats one major reason the industry switched from 4000 volt to 210...
Admin
This is assuming he's using new and delete (or malloc and free etc), and not static arrays.
But anyway, to avoid the "delete" problem just add one again before you use delete, or store the altered pointer separately. All languages with a 1-based array either internally keep a pointer to one element before the start of the array, and offset from that, or they subtract 1 from the index you ask for on every array access, so just emulate one of these. Alternatively you could just make the arrays 1 larger and ignore the 0 element, which will also work flawlessly. Or for yet another solution, just redefine the array versions of new and delete to return and expect a pointer to the element before the start of the array. Would save a lot of hunting down all the arrays to alter them (of course only works on dynamically allocated arrays).
Admin
@hexatron
"My father had a story: A man went to a tailor to get a suit made..."
Famous old joke. I believe it was originally told about "demob suits", the civilian clothes issued to British soldiers after WW2.
Admin
I have once been nearly in the professors situation.
I evolved a 50k LOC C/Yacc/Lex program over a period of about 6 years. It could do various tricks involving partitioning designs across FPGAs, translating hardware description languages and printed circuit board netlists.
Some of the tricks were pretty unique and could only be found in tools that cost in the $100k region. The particular integration of features was unique or bizarre.
It was looked at by an in-house software team to see if it could be integrated into the design flow, and they recoiled in horror at the code.
I showed it running to a CAD company and they offered me 3 months overseas with them integrating it into their product. I felt it would take more like a year, as I had forgotten how some of it worked :-), and so I declined.
The last surviving copy is now kept securely in captivity in my pocket on a flash card in my Zaurus 5500 PDA , where I rebuild it from time to time as a stress test of the native compiler tools.
Admin
I'm thinking of Blender here. Blender 1.x had a bit cryptic UI: The first time I sat in front of it I was pretty much like "WTF?", and after I did some exercises from the Book, I was like "okay, this is actually a good program."
In contrast to >2.3x series, which actually has things like menus, tooltips, and the bajillion keyboard shortcuts are actually explained within the program itself somehow. Even if I now know a little bit about the application from 1.x days, it's still a refreshing change that helps me understand the application further.
If the application is good at the core, that's good, that's important. People seem to think that "every idiot can use it" is somehow bad, while they ignore a simple fact: If idiots can find the program easy enough, what about the actually competent people - wouldn't they think a little bit easier UI would benefit them too?
Admin
It's just like the story of the grasshopper and the octopus...
Admin
Admin
It was FORTRAN, and they turned it into C++.
That, and everything else about this story, is amusingly backwards compared to the regular inherited-FORTRAN-beast stories that get posted here.
I can't remember any post about a program that started out good and was hacked into oblivion... was there?
Admin
Upgrading a project in rev? Sorry, that's not the same mistake...
Admin
My grandfather told the joke this way: A man went to a tailor to get a suit made. When he tried it on, the fit was miserable. "One leg is shorter than the other!" "So stand a little tilted--it'll look fine!" "The shoulders aren't even either!" "So bend one shoulder down--you'll look great!"
The man hobbled out of the shop as the tailor had directed.
Two women on the street saw the man hobbling along. One said to the other: "Look at that poor crippled man." "Oh my yes. But his suit fits great."
Admin
Should have got me in - from the start. I'd have done a good job.
Too many idiots about with C++ on their CVs who are clueless as to how to write C++ properly.
Any decent C++ programmer knows that the big key to C++ is RAII. And that inheritance is used to implement polymorphism.
vector is a fundamental template class in C++, yet so many times it's not being used, and raw arrays are being used instead.
Admin
It's from a company that advocates language changes like that as "small changes". All their good developers either stopped trying or left.
Admin
That precludes the idea that people who know how to use it aren't going to be elitist about the fact that they know how to use it. "Back in my day, we used CLI versions of CAD! We had to map it out in our heads and then use xyz coordinates to tell the program where the point was! It didn't even display it, but WE LIKED IT!"
Admin
You were both taught wrong. If you're writing a financial app where accuracy is the key quality parameter, by all means use floating-point!
It's only if you're writing an accounting application, where predictability and reproducability takes precedence over accuracy, that you have to use something fixed-point.
Admin
In particular, pointer aliasing in C (and in C-like C++) is a big problem for optimizing code that does a lot of operations through indirection in the inner loop. That's why C99 introduced the "restrict" sc-specifier, which indicates a pointer type that the programmer guarantees will not be aliased.
Unfortunately, C99 has not proven popular, and even those implementations that accept the "restrict" keyword rarely do anything with it. I don't recall whether C++ has incorporated "restrict" into the latest standard, but I imagine the situation's similar there. In any case, it wouldn't have been available when this particular misbegotten conversion was happening.
Fortran explicitly disallows aliasing, so its pointer operations are more amenable to optimization.
-- Michael Wojcik
(The swell new TDW implementation appears to have dropped my session silently - I just noticed that it now thinks I'm an anonymous user. God, how I hate "web forums".)
Admin
Also, multi-dimensional Fortran arrays are in column-major order, while C and C++ arrays are in row-major order. That could cause problems if any of the code tried to convert from orthogonal to linear addressing, for example.
-- Michael Wojcik