Thread: is my programming flawless? i need to reach that level of skill

  1. #46
    Registered User
    Join Date
    Apr 2013
    Posts
    103
    @cat & phantomotap... let me show a code which is 100 % perfect
    Code:
    #include<iostream>
    int main()
    {
          std::cout<<"Hello World!!!";
    }
    when there exists a small code which is 100% perfect then why are you making 100% perfection an imaginary situation???

    @jim
    that's my school computer you are expecting.....
    my pc has modern C++ compiler and editor

  2. #47
    Internet Superhero
    Join Date
    Sep 2006
    Location
    Denmark
    Posts
    964
    Next move is to add more vertical-whitespace (imo), remove all the surplus comments that don't really add anything, stop using getch() when there are portable standard alternatives in this case.

    Also if you want it to be really flawless you should probably work on your variable names and stop using C-style arrays. And then there's all the other issues that has been mentioned in this thread that you conveniently overlooked.
    How I need a drink, alcoholic in nature, after the heavy lectures involving quantum mechanics.

  3. #48
    Registered User
    Join Date
    Apr 2013
    Posts
    103
    @manasij7479
    with what should i replace getch(),and system("cls")?

  4. #49
    [](){}(); manasij7479's Avatar
    Join Date
    Feb 2011
    Location
    *nullptr
    Posts
    2,657
    Quote Originally Posted by Mukul Kumar View Post
    @cat & phantomotap... let me show a code which is 100 % perfect
    Code:
    #include<iostream>
    int main()
    {
          std::cout<<"Hello World!!!";
    }
    when there exists a small code which is 100% perfect then why are you making 100% perfection an imaginary situation???
    Is it?
    What if a person says three exclamation marks are bad and another says that you must have three exclamation marks?

  5. #50
    Registered User
    Join Date
    Apr 2013
    Posts
    103
    @neo1
    please explain which variable name should i work upon

  6. #51
    [](){}(); manasij7479's Avatar
    Join Date
    Feb 2011
    Location
    *nullptr
    Posts
    2,657
    Quote Originally Posted by Mukul Kumar View Post
    @manasij7479
    with what should i replace getch(),and system("cls")?
    Nothing.
    A console program is generally not supposed to clear the screen.
    Just remove them and you'll see that the output of your program is much more readable.

  7. #52
    Registered User
    Join Date
    Apr 2013
    Posts
    103
    @manasij7479
    1)well that took me into deep thinking
    and i think if i write the file-name as "Hello World!!!"
    then the one who needs exclamation will use it and the other one will not
    2)please execute my code once!

  8. #53
    [](){}(); manasij7479's Avatar
    Join Date
    Feb 2011
    Location
    *nullptr
    Posts
    2,657
    Quote Originally Posted by Mukul Kumar View Post
    2)please execute my code once!
    Did.
    My point still stands.

  9. #54
    Master Apprentice phantomotap's Avatar
    Join Date
    Jan 2008
    Posts
    5,108
    @cat & phantomotap... let me show a code which is 100 % perfect
    O_o

    You don't have enough vertical space.
    You have no spacing between operators and operands.
    You are falling out of `main' without an explicit return.
    You are using the reduced form of parameters to `main'.
    You have no comma between "Hello" and "World".
    You've used three exclamation marks.
    You didn't output a newline which some terminal emulators expect.
    You've used six spaces for indentation.

    When you have fixed these, I could come back and complain again, and again, and again because as others have said "perfect" is a matter of opinion, and you will never, ever reach it because perfection is indeed an imaginary situation.

    Soma

  10. #55
    Registered User
    Join Date
    Apr 2013
    Posts
    103
    but it is running fine as expected in my pc!!!
    the output is
    (first it asks the number of overs)
    (then name of batsman)
    (then display each ball's info and after hitting any key the next ball is thrown and the info is updated)
    BATSMAN#1
    name : (name)
    runs : (total runs made)
    status : (status if out or not)
    BOWLER
    overs played : (played overs total)
    maiden overs : (maiden overs)
    runs given : (runs given this over)
    wickets taken : (total wickets)
    now the bowler throws the ball...
    press enter to update the score board...
    Last edited by Mukul Kumar; 05-15-2013 at 12:37 PM.

  11. #56
    Registered User
    Join Date
    Apr 2013
    Posts
    103
    @phantomotap
    oh k got it
    so you are talking about in context on a group of users!!!
    but i m talking for a single person
    then i agree in (100=(1/∞))% cases the situation is inpossible(and i consider that 1/∞ is a definite small number)
    EDIT:
    but my thread's topis is not 100% perfect program its flawless programming
    like
    if i make a pot of clay and which is flawless
    someone asks that why is this thinner from base?
    and second one asks why is it not thicker from top?
    the pot is still useful and fully functional + have no defects
    but don't meet different people's requirements
    so i want to make that kind of pot(you know what i mean i.e. code)
    Last edited by Mukul Kumar; 05-15-2013 at 12:50 PM.

  12. #57
    Master Apprentice phantomotap's Avatar
    Join Date
    Jan 2008
    Posts
    5,108
    O_o

    If you aren't shooting for "flawless" as interpreted by others, a "group of users", why are you here?

    Why are you working to improve your code to fit canonical models, like removing/reducing global variables, if you aren't shooting for quality as interpreted by the norm?

    So, yeah, I am talking about the context of others; you are also talking about "flawless" and "perfection" in the context of how others interpret such things; if you were not, you'd have just defined your existing code as flawless.

    Soma

  13. #58
    Registered User
    Join Date
    Apr 2013
    Posts
    103
    "quality" thats what i need in my program and that program i call it flawless!!!
    am i right?

  14. #59
    Registered User
    Join Date
    Apr 2013
    Posts
    103
    now i will go to sleep and will attend this debate 18-20 hrs later(after daily routine)

  15. #60
    Lurking whiteflags's Avatar
    Join Date
    Apr 2006
    Location
    United States
    Posts
    9,612
    Quote Originally Posted by Mukul Kumar View Post
    "quality" thats what i need in my program and that program i call it flawless!!!
    am i right?
    About what? A program that meets expectations is not flawless, it just meets expectations.

    I'm somewhat fearful of what happens next. This thread could go on for weeks, just because "flawless" is how you want us to judge it. It's not really worth it to me -- we really only get a sentence or two from you, plus a code dump. You're barely thinking about how your program can be better on your own, so I feel like you literally have nothing to talk about. You just want to follow orders.

    now i will go to sleep and will attend this debate 18-20 hrs later(after daily routine)
    You sleep all day?
    Last edited by whiteflags; 05-15-2013 at 01:25 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. game development & programming skill required
    By newprog82 in forum Game Programming
    Replies: 2
    Last Post: 11-02-2010, 11:29 AM
  2. API Programming in network level
    By rchiu5hk in forum C++ Programming
    Replies: 0
    Last Post: 09-07-2009, 10:42 PM
  3. low level programming book
    By CChakra in forum C Programming
    Replies: 5
    Last Post: 09-08-2008, 01:23 PM
  4. Ways to better programming skill
    By Unferth in forum C++ Programming
    Replies: 9
    Last Post: 09-23-2003, 05:35 PM
  5. Low level programming question
    By phooey in forum C++ Programming
    Replies: 2
    Last Post: 02-16-2003, 08:59 AM