2

Ok, I'm not trying to start a discussion on Camelcase vs Underscore here, it doesn't matter what you pick, just stick to your choice.

Rather, what I would like peoples opinion on, is how strict and committed you should be in your choice when importing third party libraries.

Especially in PHP there is a HUGE variety of coding styles, to the point where it's just damn near impossible to maintain one specific style throughout your codebase when you use third party libraries.

So what do you guys do? Modify those libraries to suit your conventions, write some sort of interpreting layer so that when you use those libraries the usage of them still follows your conventions? Do you just say "to hell with it" and mix it all together? Or is there some other ingenious solution that I haven't thought of (apart from simply not using libraries that don't follow your convention)?

In essence what I'm asking is; how do you manage to maintain a clean and consistent coding style when using third party libraries? Can it be done?

Kate Gregory
  • 18,808
  • 8
  • 56
  • 85
Naatan
  • 3,424
  • 4
  • 32
  • 51

1 Answers1

1

I say "to hell with it" and mix it all together. It can be somewhat annoying to have the mixed styles, but I don't think it's worth it to do a bunch of work to avoid this.

BenH
  • 2,100
  • 2
  • 22
  • 33
  • +1. Especially since changing the identifiers in a library can reduce the value of the library's documentation (and/or its Googleability). – ruakh Oct 31 '11 at 13:25
  • Yeah that's definitely the main concern I would have with modifying a library and would sooner opt for making an interpreter for it, but that would cause overhead and make the code more vulnerable to bugs. Maybe I'm just too OCD about mixing up different conventions. – Naatan Oct 31 '11 at 13:34