Thread: Is it a bad programming habit to...

  1. #1
    Registered User
    Join Date
    Feb 2002
    Posts
    3

    Is it a bad programming habit to...

    rely on templates? Meaning, do professionals in the world of programming (I am used to server side, i am curious to the methodolgy pros use in windows based apps, something I am new to) use templates and learn to work around them?

    Such as those that come from my compiler that spit out windows

    or is the idea to learn how to build apps without relying on them?

    I figure it is still a skill to learn how to work around them and build from them, but maybe I should learn to build even those templates myself before I tackle the windows api or open gl or whever template model I have seen used that can lead to powerful apps?

    Just curious how it works among the pros in this field. In php/asp it's acceptable to use templates if it's for connecting to db's and form validation, but we need to know what to do with it and add to it/depreciate it on the fly.

    Oh, and do my homework

  2. #2
    Unregistered
    Guest
    I'm no expert but I dont imagine it to be a bad thing to rely on other peoples work, especially templates. They will probably be thoroughly tested and widely used and provided that the template suits your needs thye could be your best option.

    Of course, this is always true and you may want to write your own template classes/functions for more specific needs.

    IMO

  3. #3
    It's full of stars adrianxw's Avatar
    Join Date
    Aug 2001
    Posts
    4,829
    Before the STL was incorporated into the C++ standard, just about everybody had their own bunch of list/queue/vector/etc. routines, all different, all with different features, all with a few small bugs.

    Of course, everyone thought their's was the best, and whenever a bunch of engineers was assembled to build a new project, there was either a lot of infighting as to which they should use, (followed by months of triumphant strutting by the chosen winner and months of fervent bug searching by the losers), or the alternative was that each engineer used his/her own and the code was, as a result, huge.

    All the professionals I work with use the STL. When working in teams, unless you have a REALLY good reason to use something odd, you use what everyone is familiar with.

    >>> will probably be thoroughly tested

    Also very valid.

    The whole thing with code today is re-use.
    Wave upon wave of demented avengers march cheerfully out of obscurity unto the dream.

  4. #4
    Registered User
    Join Date
    Feb 2002
    Posts
    3
    So even in the corporate world, for example, using a template like my compiler comes with that makes a window by default is acceptable

    That is interesting, thanks, I was just curious. It does make sense I just had no idea...

    I appreciate your feedback, guys

  5. #5
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,793
    Are you refering to somthing like MFC......

    If so, then yeah lots of apps use it......I have noticed lots of "off the shelf" software has the MFC runtime dlls on the disk

  6. #6
    Registered User
    Join Date
    Feb 2002
    Posts
    3
    THanks

    I'm just referring to the types of default windows templates my dev c++ compilers provides that create the window, but it is up to the user to work with it and create something more robust

    This is good to know, thank you

  7. #7
    Registered User
    Join Date
    Nov 2001
    Posts
    202
    The only thing is that you must know what to template is and how it works. There's no point in retyping it as long as you understand it.
    "Christ died for our sins. Dare we make his martyrdom meaningless by not committing them?"

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Can you still view the bios screen with a bad CPU?
    By HyperCreep in forum Tech Board
    Replies: 4
    Last Post: 12-31-2006, 06:57 PM
  2. Bad coding habits
    By Magos in forum A Brief History of Cprogramming.com
    Replies: 14
    Last Post: 09-12-2005, 05:44 PM
  3. data loss bad bad bad
    By RoD in forum Tech Board
    Replies: 4
    Last Post: 05-01-2003, 12:06 PM
  4. Shocking(kind of)
    By Shadow in forum A Brief History of Cprogramming.com
    Replies: 25
    Last Post: 12-10-2002, 08:52 PM
  5. UNICODE and GET_STATE
    By Registered in forum C++ Programming
    Replies: 1
    Last Post: 07-15-2002, 03:23 PM