Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

... and coded the functionality "manually"?

As a rather metaphorical example, you'd hardly need a library for solving quadratic equations, although such libraries do exist and someone takes them seriously.

As a more questionable case, depending on the circumstances I may ditch jQuery (for example when I don't need to support some stone age browsers): it does simplify some things but it adds another layer of complexity and unreliability to DOM. And overusing jQuery leads to absurd problems, such as one seen recently on SO: how do I assign an empty href to an a tag with jQuery? Turned out it was a HTML question, not even JavaScript.

Another absurd case and yet non-obvious for many is using some templating engine/language built on top of another templating system: PHP. Third level of templating anyone?

And another one: sometimes just spitting out XML with (figurally) printf is far easier than doing it with some monstrous XML engine.

Any other cases from your experience?

share|improve this question

closed as not constructive by gnat, Glenn Nelson, Jimmy Hoffa, Walter, Giorgio Jan 4 '13 at 19:17

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.If this question can be reworded to fit the rules in the help center, please edit the question.

4  
Like any other tool, you use jQuery where it is appropriate. You don't use a hammer and chisel to open your front door if you've got a key. –  Robert Harvey Nov 5 '10 at 21:07
1  
@Robert Harvey: of course but in software engineering we are often having trouble recognizing keys and hammers. That's what the post is about. –  mojuba Nov 5 '10 at 21:17
    
Bear in mind that no matter how complex a popular library is, it is orders of magnitude easier to understand for others than your custom "simple" library, because they're used to it. –  Baboon Jan 4 '13 at 17:21
    
@RobertHarvey your door must be in much better shape than mine. –  Jimmy Hoffa Jan 4 '13 at 19:08

14 Answers 14

up vote 14 down vote accepted

Much of MS enterprise library and most 3rd party controls for .net have left me with this feeling after a bit of use.

Your mileage may vary

share|improve this answer
2  
Agreed - most of the Enterprise library is confusing or non-intuitive, with a parade of third party libraries which do a better job. But of course, if you slap a Microsoft on the title it must be a "best practice" –  Watson Nov 5 '10 at 21:26
    
in the early days entlib did some stuff that was sort of hard to do or figure out with the early frameworks... these days it seems to mostly be backwards compatibility to the early days or partially baked solutions you see in future releases in a much better form. –  Bill Nov 5 '10 at 22:06

Windows Communication Foundation

The fact that it's got a picture of a Swiss Army knife on the homepage kind of sums it all up for me. Imagine the XML configuration is about four times as long as the actual code that you write, and it's still very difficult to write SOAP services that are interoperable between C#, Java, PHP, Python and all those other languages that it was "supposed to" be interoperable with...

In all future projects, I'm just going to stick with REST.

share|improve this answer
1  
WCF 4.0 requires no XML configuration file at all. I don't have any experience with interoperability with other technologies (apart from using WCF as a client, which works well), but I can say I found it both easy and intuitive. Even though I started using it without reading any books or having any training (and with deadlines to meet), I was able to hit the ground running. –  Allon Guralnek Nov 6 '10 at 13:22
4  
I've renamed "WCF" to "WTF". –  MetalMikester Nov 8 '10 at 0:27
1  
@Allon: I'll admit I haven't tried WCF 4.0, it's quite possible that they made significant improvements in that area... –  Dean Harding Nov 8 '10 at 0:54

One of the problems I've experienced with people "rolling their own" is that -- while their approach is often faster and simpler -- it is also more likely to be brittle, have bugs, be incomplete, and/or contain security flaws.

Simple example: it might be 10 times easier to use printf to emit XML than to use a library:

printf("<xml>%s</xml>", str);

but did you remember to escape special characters in str? For example '<' and '&'? Some people might say "no I didn't" and proceed to write this:

printf("<xml><![CDATA[%s]]></xml>", str);

But it'll still emit broken XML if str contains the substring "]]>" anywhere in it. Edge case -- sure. But still a valid scenario which could lead to unexpected problems with serious consequences.

There are many times and places where "rolling your own" may be appropriate, but it sometimes takes a lot of experience and knowledge to identify when it is appropriate. That is why I often encourage programmers to prefer using established libraries (where available) instead of self-implemented routines.

share|improve this answer

Log4Net

The library is good, but the documentation is horrendous. It was overkill for what I wanted to do.

I used Trace instead.

share|improve this answer
1  
Robert, you beat me too it you scoundrel! I just look at log4net and think "wow, these listeners are cool. Now how do I use it..?" and then I think by the time I have it figured out I could have written my own. –  JohnL Nov 5 '10 at 21:13
5  
Really -- I would have to respectfully disagree -- it doesn't get any simpler than log.error(). –  Watson Nov 5 '10 at 21:24
3  
@Watson: If it's really that simple, why would you need a framework? –  Robert Harvey Nov 6 '10 at 5:18
    
I use The Object Guy's alternative that takes minutes to configure, having be put off by Log4Net's unnecessary complexity. –  cjmUK Nov 8 '10 at 12:25

SharePoint

Don't get me wrong, SharePoint is awesome if you need most of the things it comes with (and it comes with a lot!), but if you don't know what you're doing or only need it for one or two things, it is MASSIVELY not worth the effort and configuration.

share|improve this answer

ASP.NET WebForms - Although as .NET web developer it's been my bread and butter for a long time, since I started using the MVC framework (and coming from a PHP / Smarty Template environment) -- you realize that sometimes there are just better ways to do web development and the abstraction that it uses is overkill and leaky.

share|improve this answer
    
I think you mean ASP.NET WebForms, as distinct from ASP.NET MVC. Correct? –  Eric King Nov 7 '10 at 3:52
    
@Eric -- yes correct, I should fix that! –  Watson Nov 8 '10 at 0:21

In almost every case I've done this, I've ended up regretting it:

  • Using the PHP oci_* functions instead of a wrapper library turned out to be a bad move because of code maintainability. Porting all the code to Zend_Db made developing maintaining the database code much easier.
  • Rolling my own ajax grid component, which took up too much time to develop further, given how fast some of the other grid components evolve. I'm currently porting it all to Ext JS grids because with those there's a huge mass of third-party functionality available.
  • Avoiding libraries like prototype and jquery led to repeated occurrences of cross-browser issues, often hard to track down. The Ext JS port has solved my cross-browser woes. It is magic, even if it is a vast framework that took me weeks to understand.

I've come to the conclusion that it's much better to pick a few reliable third party frameworks, and use them as the foundation for everything you do. Those frameworks are developed and debugged by someone else, which is an incredible time-saver once you've standardized on them and understand them well.

share|improve this answer
    
+1. And it helps if those libraries are open source. Go ahead and download the source code to all the libraries you are using, if you haven't already. Reading the library's source code is a great way to diagnose and fix problems, as well as an opportunity to learn from other programmers' (presumably fairly high quality) code. –  Mike Clark Nov 6 '10 at 22:13

System.Text.RegularExpressions

Regex is so complex and so slow. I'll very rarely use Regex and usually write my own text parsing and matching.

Occasionally I'll find Regex useful for really complex matching.

share|improve this answer
    
Do you compile regexp properly [or maybe System.Text.RegularExpressions is slower then Perl & co. implementation]? –  Maciej Piechotka Nov 5 '10 at 23:45
3  
Regex may be relatively slow compared to manual string parsing, but it's faster than many people think, and usually more than fast enough for most practical applications. –  Mike Clark Nov 6 '10 at 21:56
2  
I don't think this is actually a complaint about the .NET implementation in particular, since there's nothing particularly complex or slow about it (in fact, I've found it to be one of the faster implementations available). At least, that's been my experience. Of course, regular expressions in general easily become complex, and there's certainly the tendency for people to use them in totally inappropriate places. –  Dean Harding Nov 8 '10 at 1:08

Not that Delphi4PHP needs any bad press, but I tried it (version 2.0) and it was extremely hard to bend it to my will. I wanted to use it to make a youtube style web app for clients to view training videos, but it was too cumbersome and when I tried it to combine PHP frameworks (VCL4PHP, Zend, Smarty and Recess) I ran into the inevitable, gotta rename everything because there's no namespaces in PHP 5 problem.

That being said, I didn't roll my own in the end. I used just learned from my mistakes and decided to keep it very simple and use CodeIgniter and FlowPlayer (with JQuery).

I've got a hankering that whatever frameworks make it out of PHP 5 alive, PHP 6 is going to have some awesome frameworks which might actually play nice together.

share|improve this answer

Weka

I do a lot of machine learning work, and if I ever just need something simple like Naive Bayes or logistic regression, I love ditching Weka. It has good implementations of some fairly complicated machine learning algorithms, but the API is a crufty overengineered excessively object-oriented old-school (pre-generics) Java API. Things that annoy me about it:

  1. It rolls its own resizeable array that nothing else uses, guaranteeing busywork converting back and forth.

  2. Lots of sequential coupling where methods have to be called in a specific order and unless you really RTFM carefully, you won't realize it.

  3. Every instance has to be an Instance object, and I have to declare explicitly with an Attribute object whether it's nominal or numeric. This leads to lots of busywork converting data to the form Weka wants. This is especially annoying since the Weka API throws so many exceptions that code compiling does not mean it's likely to work anyhow. If I were designing the API, I'd be liberal in what I accepted (maybe just take an array of Object) and just introspect the data to figure out what I got and what the right thing to do with it is.

share|improve this answer

Spitting out HTML on a debug port on an app. I needed some simple way to get some current data (with automatic refreshing). Pulling in a library to format it would have been good, but it was easier to just printf it.

I've also rejected on library for another: We use a large, complex XML library in most of our stuff. After spending 4 hours one day trying to get it working in a new app, I just said 'bag it', and pulled in TinyXML. It's no where near as powerful, but it takes a LOT less effort to make it do simple stuff.

share|improve this answer

Recently I've been working on a scripting language compiler that I can use within my applications. I've used others, but none do exactly what I need them to do. So I figured why not try to write my own? It may be a year or two before its really suitable for general use, but thats ok. Plus, its a great learning experience.

Another 'roll my own' solution is the pieces used to translate my applications. There's existing libraries, but I didnt like any of them. So I made my own.

And Delphi's database components. I hate'em. Always have. So I made my own database interface that works the way I want one to work (and exactly as the one I made for PHP works, making coding across languages easier).

Basically, when given an option, I typically end up making my own library.

share|improve this answer
    
I know what you mean. I can show you a whole arsenal of home-brewed STL, DB abstraction, whole languages with their compilers or interpreters, and what not. It's generally not welcomed by your colleagues and management, but what programmer who never wrote a compiler even if nobody cared about it? –  mojuba Nov 5 '10 at 21:57

On a particular project I ditched EJB3. It gave me dependency injection and container managed transaction handling. But it introduces huge dependencies (e.g. JBoss) and made the system difficult to write automated tests for. Now I've stripped it down to JPA + constructor dependency injection.

share|improve this answer

Ohhh, so many. I've worked on quite a few agile projects using open source apis. Great when they work, but often we have suffered developers with a fetish for bringing in all sorts of 3rd party apis, some obscure, some not, just because they want to use one or two classes in them. The end result being a mish-mash of code and hacked together systems. They hand it over claiming it's the best code ever, leave and the poor slobs who pick it up find an unintelligible, undocumented mess full of dependency issues and hacks.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.