Reinventing the Wheel

This is a discussion on Reinventing the Wheel within the A Brief History of Cprogramming.com forums, part of the Community Boards category; Originally Posted by samGwilliam I didn't read a single line of that (and I'm not going to), but it's entertaining ...

  1. #31
    semi-colon generator ChaosEngine's Avatar
    Join Date
    Sep 2005
    Location
    Chch, NZ
    Posts
    597
    Quote Originally Posted by samGwilliam View Post
    I didn't read a single line of that (and I'm not going to), but it's entertaining to see just how much I've gotten under your skin!!
    your loss, bro. You haven't "gotten under my skin", I was trying to help you. It's highly unlikely I'll ever have to deal with your code, so feel free to immerse yourself in all the misery of tracking down memory leaks and stack corruptions.
    "I saw a sign that said 'Drink Canada Dry', so I started"
    -- Brendan Behan

    Free Compiler: Visual C++ 2005 Express
    If you program in C++, you need Boost. You should also know how to use the Standard Library (STL). Want to make games? After reading this, I don't like WxWidgets anymore. Want to add some scripting to your App?

  2. #32
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    20,955
    I'd just use a bog-standard array, obviously.
    hmm... I am starting to suspect that you think that vectors are not standard. Although we often speak of the STL as if it were like the ATL, the truth is that the "Standard Template Library" really is standard, since it is incorporated into the C++ standard library. In fact, I understand that C++ strings were not from the STL to begin with. Therefore, you could just use a "bog-standard" std::string.

    But if a flexible, dynamic method of storage was really that important then I'd use a linked list.

    What of it?
    What if you need random access? What if you want a container of key/value pairs with faster than linear time search? I think that it is better to be flexible in your choice of container, hence choosing one that best fits your solution. An array (including vectors) is often a reasonable "default" choice.

    I didn't read a single line of that (and I'm not going to), but it's entertaining to see just how much I've gotten under your skin!!
    You can stop trolling now. If you have made up your mind and refuse to listen to reason, then say so. It is not necessary to scorn the effort taken by someone else to explain things to you. If you continue with such an attitude, then you can expect no help from the users of this message board.
    C + C++ Compiler: MinGW port of GCC
    Version Control System: Bazaar

    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  3. #33
    CSharpener vart's Avatar
    Join Date
    Oct 2006
    Location
    Rishon LeZion, Israel
    Posts
    6,424
    I just don't like relying too much on other people's code.
    LOL... Be real - and stop joking...

    You do not mean - that in your everyday work you only use your own hand made OS with hand-made compiler? To be sure that your exe relies only on your own hand-made code?

    Please, please - leave your fantasies and come back to the real world.
    The first 90% of a project takes 90% of the time,
    the last 10% takes the other 90% of the time.

  4. #34
    (?<!re)tired Mario F.'s Avatar
    Join Date
    May 2006
    Location
    Portugal
    Posts
    7,383
    The attitude of the fella isn't new. You see that everywhere and not just in C or C++ circles. Some people "say" (and say is the operative word) they don't use external libraries, standard libraries, other people's code, etc...

    It is always quiet entertaining to see these people complete lack of judgment and good reasoning. It is particularly entertaining to imagine these people having to face certain coding challenges like... oh... I don't know... having to handle complex mathematical operations without a math library, or coding their own lossless compression algorithm, or a regular expression parser... all just because they don't use other people's code.

    As you say, vart. It's a joke.
    The programmer’s wife tells him: “Run to the store and pick up a loaf of bread. If they have eggs, get a dozen.”
    The programmer comes home with 12 loaves of bread.


    Originally Posted by brewbuck:
    Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.

  5. #35
    Deathray Engineer MacGyver's Avatar
    Join Date
    Mar 2007
    Posts
    3,211
    Quote Originally Posted by samGwilliam View Post
    I didn't read a single line of that (and I'm not going to), but it's entertaining to see just how much I've gotten under your skin!!
    This post is amazing.

    I don't like using libraries myself. I've always been fine using standard libraries, but I just didn't like learning the ins and outs of 3rd party libraries that always seemed much larger and more complex than what I was aiming at accomplishing.

    As time has gone on and I've been working on different projects, I've come to better appreciate libraries written for multiple platforms that tackle a good portion of what I want to do. Perhaps one reason is that I'm working on more and more larger projects than I have been in the past, although that's not saying much since I haven't really done much.

    If you can't take the opportunity to read other people's posts, or to realize the benefit of using other tried and tested code, then as ChaosEngine said, it is your loss. I'm not sure why you would take pleasure in throwing someone's explanation back in their face when, by all appearances that I can see, their intent was to help you.

  6. #36
    Massively Single Player AverageSoftware's Avatar
    Join Date
    May 2007
    Location
    Buffalo, NY
    Posts
    141
    Quote Originally Posted by samGwilliam View Post
    Not of chars. Clearly I wasn't reading the posts properly. I'd just use a bog-standard array, obviously.

    But if a flexible, dynamic method of storage was really that important then I'd use a linked list.

    What of it?
    If you need a concrete example, I work on a C++ program that was originally written circa 1995, and it's full of C strings.

    This week I converted a few text-intensive functions from character arrays to C++ strings. Removing all of the C string manipulation crap and over allocated buffers trimmed around 500 lines from the program, and has reclaimed several thousand bytes of stack space.

    I used to scorn C++ strings and containers too, but experiences like this were a hell of a wake-up call.
    There is no greater sign that a computing technology is worthless than the association of the word "solution" with it.

  7. #37
    Registered User whiteflags's Avatar
    Join Date
    Apr 2006
    Location
    United States
    Posts
    7,522
    The line of thought that you two are discussing is "No one could possibly code this better than me!" It's arrogance more than anything else, and people realize that. As far as I can see there is no reason to drive home the point of someone else if it will fall upon deaf ears in the first place. Let Mr. William be crushed by a wall of code he so enjoys to retype, and retype, and type yet again. This discussion has been over since Chaos Engine stopped responding.

  8. #38
    (?<!re)tired Mario F.'s Avatar
    Join Date
    May 2006
    Location
    Portugal
    Posts
    7,383
    You are right Citizen. To each his own (sp?)

    Going back on topic...

    Only now, after one year of first starting dabbling in C++, did I start to become interested on the inner workings of the STL. Not so much because I felt a need to understand it, but because of curiosity.

    Naturally, because my knowledge of C++ is still so limited, I'm only scratching the surface of what really means "understanding the inner workings of the STL". Nevertheless, the STL is proving to be an excellent learning tool in its own right and "reinventing the wheel" has been on my case a pure learning exercise. In fact, I dislike the term when applied here.

    I don't honestly think using arrays is reinventing the wheel. I would rather prefer to think in creating new laws that govern how the wheel turns. Because that's the only use I can think for them when we see what the STL already offers.

    What I'm feeling while I'm pretending to be a C++ programmer developing my own game is that arrays are far more common that what one is lead to believe by the literature warnings and advises on that matter. And this goes for other elements of the STL too like std::string. I feel the need to create new laws is very common.

    However, my knowledge is flawed by both the fact I still smell like milk when it comes to programming in C++ and because I'm led by several book authors to develop a non-healthy attitude towards not believing in their advise.

    When I'm told not to use exceptions when I can avoid it because of the tradeoff in speed and code size and leaves it at that, I have to ask "But what then when speed and size is not a problem, which is the case in most of the applications developed around the world?" The same applies to the STL in the sense that examples like the ones provided by Chaos are much more enlightening than simply advocating "don't do it because of [insert reasons here]" without also debating "When should you do what I'm telling you not to do"

    These reasons, my friends are obvious to you. You know your C++ well. But we don't. We still smell like milk. And being youngsters on the matter whe are particularly prone to a) make mistakes in the choices we do, b) only listen to bad advise and c) be religious about our believes.
    The programmer’s wife tells him: “Run to the store and pick up a loaf of bread. If they have eggs, get a dozen.”
    The programmer comes home with 12 loaves of bread.


    Originally Posted by brewbuck:
    Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.

Page 3 of 3 FirstFirst 123
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Reiventing the wheel (again)
    By Elysia in forum C++ Programming
    Replies: 5
    Last Post: 12-02-2007, 02:26 AM
  2. my mouse wheel
    By DavidP in forum Tech Board
    Replies: 0
    Last Post: 11-06-2006, 08:58 AM
  3. Problems with mouse wheel...
    By xkrja in forum Windows Programming
    Replies: 1
    Last Post: 09-12-2006, 02:22 PM
  4. Logitech MOMO wheel broke, fixed manually
    By Xei in forum Tech Board
    Replies: 2
    Last Post: 07-25-2003, 02:29 AM
  5. Mouse Wheel In Console
    By GaPe in forum C Programming
    Replies: 0
    Last Post: 09-07-2002, 02:05 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21