Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Parsing GetCommandline API

Options
  • 24-01-2003 7:01pm
    #1
    Closed Accounts Posts: 1,567 ✭✭✭


    Anyone here know of a good way to parse the commandline on windows..source code or tips would help.
    I have some ways of doing it myself, but I'm hoping somebody knows a better way..


Comments

  • Closed Accounts Posts: 5,564 ✭✭✭Typedef


    If I said.

    Write your own logic to parse the string... would you hate me?


  • Registered Users Posts: 4,676 ✭✭✭Gavin


    http://www.codeproject.com/cpp/CmdLineParser.asp

    this appears to be quite useful.

    Gav


  • Closed Accounts Posts: 1,567 ✭✭✭Martyr


    Typedef:No, I wouldn't hate you..I'd just assume you didn't know how to, and wonder why you replied at all.


  • Registered Users Posts: 4,276 ✭✭✭damnyanks


    He has a post count of 4.66 , that takes alot of effort to keep up :)

    Somedays you just don't get enough posts that you can give a helpful anwser to so a comment will do here:)


  • Closed Accounts Posts: 5,564 ✭✭✭Typedef


    Originally posted by Average Joe
    Typedef:No, I wouldn't hate you..I'd just assume you didn't know how to, and wonder why you replied at all.


    Well what a nice friendly reply that was.

    Since you've asked such a noobie question, might I assume (since you have done the discourtesy of assuming about me) that you in fact have to parse the command line as part of a school project?

    I think that question is rhetorical, as I doubt there are many professional programmers (of which I am one) who would even waste their time asking 'how to' parse a command line, it being one of those really basic propositions of logic and all that, hmm.

    Edit: If it is a shcool project, you should parse the damned command line 'yourself', that is 'probably' half the idea.

    If you are a professional programmer, you should have the skills to do something trivial like parse a string and remove values from it.

    Also, it is defunct (in my opinion) to grab code from the interweb to do simple stuff like parsing strings. But, since your reply has exposed you as the muppet you are, I see no reason to further engage with you.

    Suffice to say, I'd never demean my programming skills by asking people how to parse a string, and I sure as hell wouldn't flame people for pointing out, that I should be making the logic 'myself', to parse it.

    If you weren't such a troll and actually thought before putting flame to weboard, you might see that.

    But flame away at your discression.


  • Advertisement
  • Registered Users Posts: 4,676 ✭✭✭Gavin


    You posted a useless reply. Completely unhelpful. Excellent mark of a 'professional' programmer as you claim to be.

    Gav


  • Closed Accounts Posts: 6,601 ✭✭✭Kali


    Wow look its Typedef jumping down ppls throats again. What a nice friendly professional attitude he graces us with.


  • Closed Accounts Posts: 5,564 ✭✭✭Typedef


    You posted a useless reply.

    Sorry Gav, I completely disagree.

    I don't think it is the mark of a good programmer to simply try to find code that other people have rolled to accomplish tasks in programming.

    That seems really lame to me. Sure, derive 'ideas' from some-one elses code if you have to, but, mindlessly adding someone else's class to your C++ code and then simply using a function defined in there, for something pretty simple like parsing a string, is the mark of a bad (or) lazy programmer.


    Completely unhelpful. Excellent mark of a 'professional' programmer as you claim to be.

    Sticks and stones. > /dev/null

    Kali
    Wow look its Typedef jumping down ppls throats again. What a nice friendly professional attitude he graces us with.


    Well do you have any suggestions or are you just here to flame?


  • Registered Users Posts: 4,676 ✭✭✭Gavin


    Originally posted by Typedef


    I don't think it is the mark of a good programmer to simply try to find code that other people have rolled to accomplish tasks in programming.

    That seems really lame to me. Sure, derive 'ideas' from some-one elses code if you have to, but, mindlessly adding someone else's class to your C++ code and then simply using a function defined in there, for something pretty simple like parsing a string, is the mark of a bad (or) lazy programmer.

    You are of course aware that part of the point of OO programming is to re-use software, a major goal in the software engineering industry. Reusing code is a standard practise. Websites like codeproject.com, codeguru.com and even the MSDN contain countless classes for performing mundane tasks.

    Even with my small experience of programming in a professional development team, I've found this to be a standard method for RAD. Or perhaps you think that the reuse of frameworks or library classes, such the the MFC libraries, STL, Java libraries etc is bad programming ? If so, your productivity must be remarkably low, compared to other programmers in your team.

    Gav


  • Closed Accounts Posts: 8,264 ✭✭✭RicardoSmith


    Where moneys involved re-using someone existing code is a whole heap more cost effective than writing your own to do essentially the same thing. So its completely valid to ask/look for existing code. You can also learn a lot from looking at someones else work, seeing how their approach differs from your own. This applies not just in programming but to all areas of life.


  • Advertisement
  • Closed Accounts Posts: 5,564 ✭✭✭Typedef


    Gav, Verb, whatever.

    I think, and I'm sure you agree, that there is a big difference between the STL or even standard C libaries and reuse of code to accomplish tasks like parsing a string, especially if you are a learner.


  • Closed Accounts Posts: 8,264 ✭✭✭RicardoSmith


    No matter what code you write, as soon as you've written it you realise theres a better way of doing it. If somebody shows you a good way of doing something it helps you to learn faster. Certainly nobody showing you anything or nobody helping you, at any level is the slowest and hardest way of learning something.


  • Closed Accounts Posts: 7,230 ✭✭✭scojones


    I agree with Typedef. Fair enough you guys say you should reuse code and whatnot. Why re-invent the wheel right? But you shouldn't go looking at other code before attempting to do it yourself. And AverageJoe said he had ways of doing it but i don't see his way of doing it anywhere here - do you? And um.. have you ever heard of google?


  • Registered Users Posts: 4,676 ✭✭✭Gavin


    Originally posted by sjones
    I agree with Typedef. Fair enough you guys say you should reuse code and whatnot. Why re-invent the wheel right? But you shouldn't go looking at other code before attempting to do it yourself.

    If I was programming something new for the sake of learning it then no. If working on a product with deadlines, then I most definitely would look for previously written code to help me out.
    Gav, Verb, whatever

    Gav or Verb will do. Dunno the other fellow.

    Typedef, you claimed that reusing code was 'lame', a mark of a 'bad' or 'lazy' programmer. You did not specifiy that this was in the case of a programmer learning. This was what I had issue with.

    To have this attitude when developing a professional product would be crazy. Certainly, test classes that you download etc, but to dismiss the possiblity of using them at all would be a slightly odd decision to say the least.

    Gav


  • Closed Accounts Posts: 5,564 ✭✭✭Typedef


    Absolutely.

    I ported MD4 to C++, without any actual knowledge of the encryption algorithm based on the same premis (if it ain't broke), but, somehow, I'd just feel a little lazy about using someone else's algorithm to parse a string.

    But, whatever.
    *


  • Closed Accounts Posts: 2,155 ✭✭✭ykt0di9url7bc3


    Originally posted by Typedef
    I'd just feel a little lazy about using someone else's algorithm to parse a string.

    But, whatever.
    *

    Its not like you are riping off someones literature Typedef, being nonjudgemental - Average Joe had an idea on how it could be done but wanted to see if anyone HAD it done? Telling him to do it himself is not really helpful but to jump down his throat for answering your question correctly...


  • Closed Accounts Posts: 536 ✭✭✭flyz


    I thought the whole reason of having a Programming forum was that people could ask questions, noobies included.

    Maybe it should be renamed to Advanced Programming or maybe "I am a brilliant Programmer and don't need to ask for any help".

    Beginner programmers have just as much right to ask questions as anyone else.


  • Registered Users Posts: 7,468 ✭✭✭Evil Phil


    Average Joe
    Cool Newbie


    Registered: Nov 2001
    Posts: 41 (0.09 per day)


    Not being a regular you probably don´t know the prefered um, ethics, of asking for help. If you have some code written then post it here - it shows you making an effort and not just a student trying to get your homework done for you.

    People hear jump down your throat, its been done to me, I´ve done it to others. Take it with a pinch of salt if you can. However, if you are a student just trying to get you homework done then heres a joke for you:

    Q: Why do students float around?
    A: Because they´re scum.

    ;)
    Beginner programmers have just as much right to ask questions as anyone else.

    Absolutely, somebody helped us when we were new, its up to us to return the favour. Ask away and show us some code, or at least tell us what language you doing this in.


  • Closed Accounts Posts: 5,564 ✭✭✭Typedef


    but to jump down his throat for answering your question correctly...


    What are you trying to say?
    I can't parse a string?

    Beg to differ old chap.
    Need not take my word for it either.


    Wow... I feel all masculine now.


  • Closed Accounts Posts: 2,155 ✭✭✭ykt0di9url7bc3


    Originally posted by Typedef

    What are you trying to say?

    Wood or Trees?
    Wood or Trees?
    Wood or Trees?

    I have never said nor implied that you couldnt code it - You asked him if he would hate you if you told him to do it himself?

    albeit he answered your question with a cutting remark on why you bothered to post at all since it was of no use to him

    I cant really condense/simplify what you said in return
    The Response
    Well what a nice friendly reply that was.

    Since you've asked such a noobie question, might I assume (since you have done the discourtesy of assuming about me) that you in fact have to parse the command line as part of a school project?

    I think that question is rhetorical, as I doubt there are many professional programmers (of which I am one) who would even waste their time asking 'how to' parse a command line, it being one of those really basic propositions of logic and all that, hmm.

    Edit: If it is a shcool project, you should parse the damned command line 'yourself', that is 'probably' half the idea.

    If you are a professional programmer, you should have the skills to do something trivial like parse a string and remove values from it.

    Also, it is defunct (in my opinion) to grab code from the interweb to do simple stuff like parsing strings. But, since your reply has exposed you as the muppet you are, I see no reason to further engage with you.

    Suffice to say, I'd never demean my programming skills by asking people how to parse a string, and I sure as hell wouldn't flame people for pointing out, that I should be making the logic 'myself', to parse it.

    If you weren't such a troll and actually thought before putting flame to weboard, you might see that.

    But flame away at your discression.

    I apologise for pointing that out but I'd like to know how...
    but to jump down his throat for answering your question correctly...
    ..accuses you of not being able to solve the problem rather than its intended meaning, as it is plainly written, were you a little too harsh in your response...?


  • Advertisement
  • Registered Users Posts: 604 ✭✭✭Kai


    so many posts....................so little help.

    :D


  • Closed Accounts Posts: 5,564 ✭✭✭Typedef


    albeit he answered your question with a cutting remark

    Which is my point exactly, much as I love being abused for offering genuine help, I get 'paid' by my employer, for that particular priveledge.


  • Closed Accounts Posts: 9,314 ✭✭✭Talliesin


    Yes you should be able to code lots of stuff for yourself.

    You should be able to code at least half the C++ STL for yourself in C++, a good portion of the VB language for yourself in VB and likewise with Java classes, Perl mods or whatever.

    The reason you don't do that is partly that the library writers have more opportunity for detecting bugs, including bugs that only occur in obscure circumstances, partly because they often use optomisations that would lead to unreadable code if it was somewhere that would be altered frequently, and partly because while you should be able to re-invent the wheel, you should spend your time more productively.

    AverageJoe, next time don't say "I have some ways of doing it myself, but I'm hoping somebody knows a better way", tell us your way even if you think it's crap.

    Typedef, lay of the abuse.


This discussion has been closed.
Advertisement