Rate My Programming: "Advance" Sorting

This is a discussion on Rate My Programming: "Advance" Sorting within the C++ Programming forums, part of the General Programming Boards category; No compiling errors, no runtime errors(not any that I know of). I'm trying to better myself as a computer programmer ...

  1. #1
    Registered User
    Join Date
    Sep 2003
    Posts
    71

    Rate My Programming: "Advance" Sorting

    No compiling errors, no runtime errors(not any that I know of). I'm trying to better myself as a computer programmer and I just wanted some of you guys to look at my source code and from that, construct your own judgment on how well it is coded. From a scale of 1 - 10.

    - Thanx!!
    Attached Files Attached Files
    Name: Eric Lesnar
    Learning: C/C++, SDL, WinAPI, OpenGL, and Python
    Compiler: Dev-C++ 4.9.0
    Current Game Project: Acoznict

  2. #2
    Guest Sebastiani's Avatar
    Join Date
    Aug 2001
    Location
    Waterloo, Texas
    Posts
    5,705
    3
    Code:
    #include <cmath>
    #include <complex>
    bool flip(bool value)
    {
           return std::pow
        (
            std::complex<float>(std::exp(1.0)), 
            std::complex<float>(0, 1) * std::complex<float>(std::atan(1.0)*(1 << (value + 2)))
        ).real() < 0;
    }

  3. #3
    Registered User
    Join Date
    Sep 2003
    Posts
    71
    ouch

    Are you serious? If so, why?
    Name: Eric Lesnar
    Learning: C/C++, SDL, WinAPI, OpenGL, and Python
    Compiler: Dev-C++ 4.9.0
    Current Game Project: Acoznict

  4. #4
    Registered User major_small's Avatar
    Join Date
    May 2003
    Posts
    2,787
    first, use local filenames... i don't like having to put it where you want me to...

    i would give it about a 2/3...

    1) local filenames
    2) each class gets it's own .h
    3) scrap name.h (seperate into two .h classes, as per #2)
    4) name.cpp should only contain the main function and any other global functions...
    5) make it more readable... why include iostream in one place and "using namespace std;" somewhere else?
    6) COMMENT!!! there's 7 lines of comment in your ENTIRE program!
    Last edited by major_small; 09-21-2003 at 07:32 PM.
    Join is in our Unofficial Cprog IRC channel
    Server: irc.phoenixradio.org
    Channel: #Tech


    Team Cprog Folding@Home: Team #43476
    Download it Here
    Detailed Stats Here
    More Detailed Stats
    52 Members so far, are YOU a member?
    Current team score: 1223226 (ranked 374 of 45152)

    The CBoard team is doing better than 99.16% of the other teams
    Top 5 Members: Xterria(518175), pianorain(118517), Bennet(64957), JaWiB(55610), alphaoide(44374)

    Last Updated on: Wed, 30 Aug, 2006 @ 2:30 PM EDT

  5. #5
    Registered User
    Join Date
    Sep 2003
    Posts
    71
    I'll revise it tomorrow then.
    Name: Eric Lesnar
    Learning: C/C++, SDL, WinAPI, OpenGL, and Python
    Compiler: Dev-C++ 4.9.0
    Current Game Project: Acoznict

  6. #6
    Guest Sebastiani's Avatar
    Join Date
    Aug 2001
    Location
    Waterloo, Texas
    Posts
    5,705
    I wasn't really trying to be critical. But to be fair, you should probably devote more time to developing *real* programming skills before launching these 'Rate My Programming' threads. My impression of the code was perfectly summed up in line 62 of FileStream.cpp:

    "What is the deal?!?!??!"
    Code:
    #include <cmath>
    #include <complex>
    bool flip(bool value)
    {
           return std::pow
        (
            std::complex<float>(std::exp(1.0)), 
            std::complex<float>(0, 1) * std::complex<float>(std::atan(1.0)*(1 << (value + 2)))
        ).real() < 0;
    }

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Need help with linked list sorting function
    By Jaggid1x in forum C Programming
    Replies: 6
    Last Post: 06-02-2009, 02:14 AM
  2. Producing a "beeep!" as simply as possible
    By mutandis in forum C Programming
    Replies: 10
    Last Post: 12-13-2008, 12:30 AM
  3. Question About My Homework Pls Help Me İmmediately
    By jennyyyy in forum C Programming
    Replies: 27
    Last Post: 03-13-2008, 11:40 AM
  4. the effects of textures on my frame rate
    By DavidP in forum Game Programming
    Replies: 37
    Last Post: 10-03-2003, 11:24 AM
  5. Still Needing Help : selection sorting
    By Unregistered in forum C Programming
    Replies: 6
    Last Post: 10-14-2001, 08:41 PM

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