Lv 6
Damien preguntado en Computers & InternetProgramming & Design · hace 2 meses

question about dos?

People brag to me how they've created a program from c++ that can calculate numbers or a program that can arrange files in my computer. And im like , meh i created that from dos batch with 200 lesser lines. I feel like anything that doesn't involve graphics and is strictly related to numbers and files and folders can be created from dos batch programming.People laugh at this cause they dont considering batch scripting as programming but then i see then being impressed with creating simple stuff from c++ that can also be created from batch.Whats your opinion on this.

5 respuestas

  • Robert
    Lv 5
    hace 1 mes

    I'm old school and irrelevant so take this with a grain of salt. I say, whatever accomplishes your objective with the least amount of dev time is the best. You know as well as I do that if no GUI is needed, then any C++ programmer is just going to make a console app so really how is that better than a dos batch script?  THE ONLY advantage to using c++ might be if you needed to roll our a multi-platform solution. Tools now make this easy for C++ where as a dos batch script would be limited to the OS it is written on. 

  • Anónimo
    hace 1 mes

    The problem is that DOS is an inherent security risk- DOS gives direct access to the OS where the higher-level programing languages do not- making it much easier to shut down a virus by controlling OS permissions. This is why batch scripts are best avoided in programming, unless you have to interact directly with the OS for some reason or another. The best practice is to find a way around using a batch script. Also, batch scripts only work on Windows based machines (Linux will not execute a DOS based program) - and most programs need to be able to be executed across several platforms.

  • EddieJ
    Lv 7
    hace 2 meses

    Batch was originally created for a specific purpose.

    Originally, if you wanted to run a program, you would type the name of the program, along with certain, possibly optional parameters, at the DOS command prompt, and that was that.

    But, often, you needed to be in a certain subdirectory for the program to run correctly, so, people had to enter 2 command to run the program.

    And, then, people often ran a sequence of programs one after another.

    So, that's mainly what batch was for -- have one command to do a common sequence of commands.

    But, then, people started to want to do more complicated things, so, features kept getting added -- because it wasn't that big of a deal to do that.

    So, yeah, you can do a lot of things with the current advanced version.  But there are limits.

  • hace 2 meses

    The kinds of things you describe are basic learning tasks in more complex languages.  Once you get the hang of it, you can do much more powerful things in mature languages like C and Java, and they'll perform better.  Your batch program is just running OS functions and other programs that are most likely written in C.  

    It's not that batch or shell scripting isn't potentially the RIGHT CHOICE for certain tasks...it can be!  But you're kind of bragging about your skill with a hammer while other people are learning how to use nailguns.  Maybe that's not the perfect metaphor, but I hope you get the gist.  

  • ¿Qué te parecieron las respuestas? Puedes iniciar sesión para votar por la respuesta.
  • Lv 7
    hace 2 meses

    batch is not as much programming as it is processing code.

    that does not mean it is not useful. i use simple batch scripts all the time, and they can be quicker to create, especially since you don't have to compile a batch.

    you shouldn't take it too personally. people just like being able to feel important coding.

¿Aún tienes preguntas? Pregunta ahora para obtener respuestas.