The Weird and The Wonderful

The Weird and The Wonderful forum is a place to post Coding Horrors,
Worst Practices, and the occasional flash of brilliance.

We all come across code that simply boggles the mind. Lazy kludges, embarrasing mistakes, horrid
workarounds and developers just not quite getting it. And then somedays we come across - or write -
the truly sublime.

Post your Best, your worst, and your most interesting. But please - no
programming questions . This forum is purely for amusement and discussions on code snippets. All
actual programming questions will be removed.

I am with you totally. I see complaints like the ones which have already followed your post all the time. Fact is most people have such large egos that it is easier for them to write something than to learn to use code someone else wrote - because they are already "experts" and no longer students.

We use boost all the time for as much of what it can do as we can possibly use. We use Google code (kml libs), we use zlib, we pretty much use anything open source that fits our needs.

If a half decent C++ dev can't wrap a library to give us a stylistically appropriate interface in less time than it would take to write the entire library, then that C++ dev is no use to us.

Most of the arguments against are straw men (presuming open source here). Will a 3rd party library be maintained going forward? Dunno - but sure as heck our own home grown solution won't be maintained by anyone else either. Is it any good? There are a large number of excellent libraries out there for many, many common programming needs. They have had thousands of eyeballs and hundreds of consumers testing them and fixing them. Sure beats the size of our QA team. Code Project itself is an excellent resource for working code that has been peer reviewed the heck out of.

I think there's a bit of a knee-jerk reaction among most developers when facing a need like that: hell I'm a programmer, this is what I do, I'll write it myself and get exactly what I want.

But that isn't always the right way to go. I used to work at a software company where just about all of the tools were built in-house, from source control to back-end processing frameworks to load balancing. This was a fairly small shop where there weren't really enough programmers for the workload and projects were always behind. It amazed me that so much time was spent building and maintaining software that could be pulled off a shelf, when the programming that really had to get done was behind.

Worse, due to time constraints the in-house software was frighteningly buggy and unreliable, and no one wanted to fix or maintain any of it (especially the guys who wrote it). It got so bad that in one meeting the CEO blew up on the guy who was the main push for in-house solutions, pretty much saying that it had been a mistake. From his point of view, he was paying programmers to write code that was already written and didn't make money, instead of getting cracking on the code that actually did make money. When you're a software company, you don't want your programming resources tied up in creating software you can't sell.

Of course, the main argument for the in-house solutions was that the off-the-shelf solutions didn't fully meet the needs, and that was somewhat true although those things could have been worked around. I guess the moral of the story is, if you want to go the in-house route, make sure that you have the resources to do it right and maintain it. And make sure that management knows that it will require extra time and resources (a.k.a money), and that it will be hard to go back once the in-house software is entrenched.

I'm not dismissing the use of libraries, I just haven't had good experiences with them so far.

We once ran into a bug with a communications library (back in the days of dial-up) and after we identified it, we called the vendor. They said it was a known issue and would be fixed in the next release. We said, "Great, when's the next release?" They said, "In six months." We had a 6 week delivery date. So we had to trash it and write our own, which ended up being smaller and faster.

Libraries add bloat. The library does 10 things, you're only interested in 2 of them.

Management decided to get involved because they didn't like our delivery estimate and so they went out and purchased a library that they had seen a demo of and then gave it to us expecting that all we had to do was integrate it into our existing system. That's simple, right? No excuses for bugs since it was a purchased product the only cause for errors would be from our staff. As you can imagine, it didn't go well and caused much animosity with management that didn't need to be there.

Psychosis at 10
Film at 11

Those who do not remember the past, are doomed to repeat it.
Those who do not remember the past, cannot build upon it.

Third party drawbacks:
1. Have to learn their api. sometimes its mind bending sometimes simple.
2. Depend on their support/consceintiousness for bug fixes and upgrades.
3. Can't fix a bug if you have a special case. even if you get the source code.
4. Don't always know you cant solve a problem until you have wasted a week on the componenet.
5. Don't own it cant enhance it.

Pluses:
1. debugged already
2. learn from other peoples problems - may get features you hadn't even considered.

It is supposed third party tools are the salvation to those activities one is not the best at. But, how many hours are spend before buying? How many hours are dedicated to understand other's logics? What if the documentation lacks of good examples to understand how to get the best of tool?

How many hours are dedicated to understand other's logics? What if the documentation lacks of good examples to understand how to get the best of tool?

Actually, that can be much worse with an in-house solution, especially once the guy who wrote it is gone. It's all fun and games until there's no one around who knows how it works anymore. At least with a third-party solution, there is likely to be a community of other people who use it and who can answer questions, even if the company that made it no longer maintains it. And...documentation? At least the third-party solution is likely to have some

I use third party libraries (and tools) whenever I consider that the effort of writing my own solution will outweigth the effort of making the third party solution work, usually I evaluate different solutions and pick the best/easy to use/better reviewed/open one; the only times I avoid a third party library is when their license is incompatible with closed source (I work with closed source systems) which invariably means when they use GPL.

Presumably because this reflects a real business need versus a 'really cool' development idea.

jim lahey wrote:

and we've got a component that can do a hell of a lot more to boot

Which isn't a recommendation. After all Oracle can do a lot more than store a configuration value but one certainly shouldn't choose to use Oracle only to store a configuration value.

jim lahey wrote:

What objections do you have to using third party stuff?

Some Reasons
- Often the complexity greatly exceeds the needed use.
- The intended use is much more suited to a far simpler solution. This is similar to but not the same as the prior reason. It comes about because the developer finds a library they want to use and then invents a problem to solve with it or rationalizes much more needed functionality for an existing problem.
- The license is not compatible with the needs of the business. This often is because some licenses can require that the Application code must be available as source. Another common problem is that that there is no license which means one must have explicit use license from the author to use it.
- It isn't available as source and the author(s) support is erratic.

One must of course have a policy in place to keep and track license(s). And one should keep an actual copy of the license not just a link. One must also be prepared for the possibility that at some time the license might change.

Initially I didn't get it (because of the asterisks). Such aliases should not surprize anyone. If we step aside from the programming for a moment, one can remember that Japanese car makers are that awesome, that they can name cars "Pajero" (which is not a very good word in Spanish slang) and sell them officially in Spain. With that said, why can't a female developer use genitalia as an alias in that SQL query?

“Education is not the piling on of learning, information, data, facts, skills, or abilities - that's training or instruction - but is rather making visible what is hidden as a seed”“One of the greatest problems of our time is that many are schooled but few are educated”

ERROR_EAS_DIDNT_FIT (wait, what?)
ERROR_TOO_MANY_POSTS (and most of them are OT, which makes it even worse)
ERROR_PIPE_BUSY (let's just move along)
ERROR_MAX_THRDS_REACHED (hopefully isn't related to the above)
ERROR_SAME_DRIVE (well, at least)
ERROR_DUPLICATE_PRIVILEGES (sh*t happens)
ERROR_MR_MID_NOT_FOUND (Mr Mid is not at home now)
ERROR_MAX_SESSIONS_REACHED (sooner or later...)