Batch | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

Batch

Can someone create a lesson about batch? I think its fun.

19th Nov 2018, 12:52 PM
Arjuna Malinao
Arjuna Malinao - avatar
2 Answers
+ 4
Never use batch. For anything. Not only it is not cross compatible, but also it lacks security and speed. Use Python or Perl for easy languages which are not only secure but quick and more powerful.
19th Nov 2018, 8:34 PM
inxanedev!
inxanedev! - avatar
0
Batchjobs 'suffer' from some limitations buried in history. For example (depending on the target) if you want the return code of a process, you have to start at a high number--chosen arbitrarily--and then iterate backwards until "IF ERRORLEVEL n" returns true (because all lower ERRORLEVELs are ALSO set, and you can't just ask for the highest set). Why it's done this way + hurdles you have to cross in other places...do I explain...or deflect? PowerShell is positioned as batch programming's replacement; unless you're porting really old software for DOSBox / etc, I tend to think of batch programming as retro / curiosity. Still, if you really want to go play with oldschoolers, Google for "DOS DemoScene"; immersed in DOS, you'll see some batch tricks along the way.
20th Nov 2018, 5:18 PM
Kirk Schafer
Kirk Schafer - avatar