Programming helpful tool suggestions

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Message
Author
julesverne
Posts: 81
Joined: 19 Nov 2013 00:41

Programming helpful tool suggestions

#1 Post by julesverne » 19 Nov 2013 01:53

So I've been creating batch programs for about a year and a half now. Sounds funny, but I love it. However, after my recent discovery of autohotkey, and notepad++ I've realized that I've really started from the ground up. Now that I've done this for awhile I want to make things easier for myself. Notepad++ has been a big improvement over notepad, however... now I'm after really helpful things. That's why I'm posting here. The names dbenham, carlos, aacini, etc have been in my list of knowledgeable cmd gurus almost since starting. Some of the best stuff I've learned is from their responses on stackoverflow, and dostips. SS64 is also great site. So here's what I want to know. What are the guru's using?

A few things that I would love to make life easier for me is to have ss64 as a hlp file that could be imported into the notepad++ plugin. I have sort of done something already to this effect. I used a program called httrack. It's a program that downloads whole websites. For me this is helpful because I'm not always online (I fly a lot for work). So, I dloaded SS64 and dostips to my computer. It's awesome, but something that could be integrated into something like a userdefined language in notepad++ would be amazing. I don't have the skills to write it, but like highlighting a command like for /f and right clicking and having the option to see ss64 has to say. Notepad++ is cool cause you can make your own plugins. I did make a laughable attempt at trying to understand how to do it. Needless to say I failed miserably.

Anyway, I know this is a lot of digression, but I am really curious, why do i have to be constantly refer back to ss64 for commands I should know by heart just to help me debug? Has someone created a smart debugger yet that I don't know about?

I know dostips have templates for functions you can dload, but i can't imagine you all go there everytime to dload them. So, where do you like to store your basic templates you use?

I would love to hear what you all do to save time or pullout that great macro you use.

Thanks in advance! Jules

Ed Dyreen
Expert
Posts: 1569
Joined: 16 May 2011 08:21
Location: Flanders(Belgium)
Contact:

Re: Programming helpful tool suggestions

#2 Post by Ed Dyreen » 19 Nov 2013 05:09

I use notepad but then I'm just an amateur :D Something tells me this is not what you want to hear. :)

npocmaka_
Posts: 517
Joined: 24 Jun 2013 17:10
Location: Bulgaria
Contact:

Re: Programming helpful tool suggestions

#3 Post by npocmaka_ » 19 Nov 2013 06:29

check notepad++ marcos -> http://www.martinrinehart.com/frontend- ... acros.html ; http://stackoverflow.com/questions/5431 ... in-notepad

May be it's close to the the things you want :?:

Samir
Posts: 384
Joined: 16 Jul 2013 12:00
Location: HSV
Contact:

Re: Programming helpful tool suggestions

#4 Post by Samir » 24 Nov 2013 21:58

I'm no expert, and my batch files have been far from complicated or as elegant as the experts here, but I have been making batch files for over 20 years now.

My tools of the trade have been:
  • A good text editor that's open with the file I'm working on
  • A command prompt where I can run the current version of the file.
  • An open Internet browser with quick access to resources like dostips, etc.

But my most important tool is actually the most simple--a piece of paper and a pen. I learned this when I took classes for C. I try to pseudocode what I want my batch file to do, what the variables are, how the loops work, etc. Once I get the logic down on paper, then it's time to code it. Along the way, if I discover a better method or a drop-in function, I revise my pseudocode. This has always made the 'thinking' part of batch file creation so much easier for me.

Aacini
Expert
Posts: 1927
Joined: 06 Dec 2011 22:15
Location: México City, México
Contact:

Re: Programming helpful tool suggestions

#5 Post by Aacini » 24 Nov 2013 23:05

Samir wrote:But my most important tool is actually the most simple--a piece of paper and a pen. I learned this when I took classes for C. I try to pseudocode what I want my batch file to do, what the variables are, how the loops work, etc. Once I get the logic down on paper, then it's time to code it. Along the way, if I discover a better method or a drop-in function, I revise my pseudocode. This has always made the 'thinking' part of batch file creation so much easier for me.


I entirely agree with you! :D I would like to add just one point more:

If your program/application is large enough so you must also write an user manual/reference guide/any documentation, try to completely write the documentation first (this requires a large dosis of patience) and then try to review it with the point of view of the user (this is not easy, it requires that you "forget" your previous knowledge!) so you can catch any flawn or problem in the design at this stage. Only when this step is complete, start coding; if you do so, the development of the program will have no problems.

Antonio

Ed Dyreen
Expert
Posts: 1569
Joined: 16 May 2011 08:21
Location: Flanders(Belgium)
Contact:

Re: Programming helpful tool suggestions

#6 Post by Ed Dyreen » 25 Nov 2013 17:12

Samir wrote:I learned this when I took classes for C. I try to pseudocode what I want my batch file to do, what the variables are, how the loops work, etc. Once I get the logic down on paper, then it's time to code it.
So the code is just proof of concept, hmm what an interesting idea :)
Aacini wrote:
Samir wrote:But my most important tool is actually the most simple--a piece of paper and a pen. I learned this when I took classes for C. I try to pseudocode what I want my batch file to do, what the variables are, how the loops work, etc. Once I get the logic down on paper, then it's time to code it. Along the way, if I discover a better method or a drop-in function, I revise my pseudocode. This has always made the 'thinking' part of batch file creation so much easier for me.


I entirely agree with you! :D I would like to add just one point more:

If your program/application is large enough so you must also write an user manual/reference guide/any documentation, try to completely write the documentation first (this requires a large dosis of patience) and then try to review it with the point of view of the user (this is not easy, it requires that you "forget" your previous knowledge!) so you can catch any flawn or problem in the design at this stage. Only when this step is complete, start coding; if you do so, the development of the program will have no problems.

Antonio
The waterfall technique ?

It really depends on your definition of large, as it can be turned around just as well ;
if you do so, the development of SMALL programS will have no problems.

The larger the project the less the waterfall technique is desirable, the risk of failure becomes too high. Many requirements have to be changed or forgotten about during implementation. Large project have a better chance of success if developed iteratively. ( Craig Larman )

Samir
Posts: 384
Joined: 16 Jul 2013 12:00
Location: HSV
Contact:

Re: Programming helpful tool suggestions

#7 Post by Samir » 26 Nov 2013 10:58

Aacini wrote:
Samir wrote:But my most important tool is actually the most simple--a piece of paper and a pen. I learned this when I took classes for C. I try to pseudocode what I want my batch file to do, what the variables are, how the loops work, etc. Once I get the logic down on paper, then it's time to code it. Along the way, if I discover a better method or a drop-in function, I revise my pseudocode. This has always made the 'thinking' part of batch file creation so much easier for me.


I entirely agree with you! :D I would like to add just one point more:

If your program/application is large enough so you must also write an user manual/reference guide/any documentation, try to completely write the documentation first (this requires a large dosis of patience) and then try to review it with the point of view of the user (this is not easy, it requires that you "forget" your previous knowledge!) so you can catch any flawn or problem in the design at this stage. Only when this step is complete, start coding; if you do so, the development of the program will have no problems.

Antonio
Very interesting. I bet this methodology can be applied to business workflow processes as well...hmmm...

Samir
Posts: 384
Joined: 16 Jul 2013 12:00
Location: HSV
Contact:

Re: Programming helpful tool suggestions

#8 Post by Samir » 26 Nov 2013 10:59

Ed Dyreen wrote:
Samir wrote:I learned this when I took classes for C. I try to pseudocode what I want my batch file to do, what the variables are, how the loops work, etc. Once I get the logic down on paper, then it's time to code it.
So the code is just proof of concept, hmm what an interesting idea :)
I never thought of it that way, but that's definitely one way to describe it. :D

Aacini
Expert
Posts: 1927
Joined: 06 Dec 2011 22:15
Location: México City, México
Contact:

Re: Programming helpful tool suggestions

#9 Post by Aacini » 26 Nov 2013 19:20

Remember that computer problems are not solved in the computer, but in the human brain; the computer is just a tool that the human brain use to test and achieve the solution. :shock: :mrgreen:

Antonio

Squashman
Expert
Posts: 4488
Joined: 23 Dec 2011 13:59

Re: Programming helpful tool suggestions

#10 Post by Squashman » 26 Nov 2013 20:30

Too err is human. To really screw something up requires a computer.

julesverne
Posts: 81
Joined: 19 Nov 2013 00:41

Re: Programming helpful tool suggestions

#11 Post by julesverne » 27 Nov 2013 04:54

I get where you're going with writing everything out. I usually draw up an outline. I guess I just figured some of you had some windows tools that move things along a little quicker for you. After 25 years of programming figured you'd get annoyed when you're running a batch file and you're scratching your head for hours going, why the hell isn't this working? Only to figure out the next day.. DOH!!! I forget to add a "!" to the end of that variable. Stupid annoying things like that. Sorta seems there should be a file checker, like a spell checker in word. Highlight possibly missing a variable symbol here or this echo will echo nothing, this variable will be empty. AutoHotKey at least runs a check first (of the whole file) before running, it even points to where the issue is. Just seems odd that no one has created a program like this yet for bat.. And no.. I can't make it. I've only just started writing bat scripts. I'm not a programmer.

foxidrive
Expert
Posts: 6031
Joined: 10 Feb 2012 02:20

Re: Programming helpful tool suggestions

#12 Post by foxidrive » 27 Nov 2013 05:16

julesverne wrote:Sorta seems there should be a file checker, like a spell checker in word. Highlight possibly missing a variable symbol here or this echo will echo nothing, this variable will be empty. AutoHotKey at least runs a check first (of the whole file) before running, it even points to where the issue is. Just seems odd that no one has created a program like this yet for bat..


Advanced Batch is based around tips and tricks and undocumented behaviour, and that behaviour changes even more as further bugs and tricks are found.

It would be a daunting task to create a complete and fully featured syntax checker - but there are editors with batch syntax highlighting that can help in many ways.

Samir
Posts: 384
Joined: 16 Jul 2013 12:00
Location: HSV
Contact:

Re: Programming helpful tool suggestions

#13 Post by Samir » 27 Nov 2013 08:34

julesverne wrote:I get where you're going with writing everything out. I usually draw up an outline. I guess I just figured some of you had some windows tools that move things along a little quicker for you. After 25 years of programming figured you'd get annoyed when you're running a batch file and you're scratching your head for hours going, why the hell isn't this working? Only to figure out the next day.. DOH!!! I forget to add a "!" to the end of that variable. Stupid annoying things like that. Sorta seems there should be a file checker, like a spell checker in word. Highlight possibly missing a variable symbol here or this echo will echo nothing, this variable will be empty. AutoHotKey at least runs a check first (of the whole file) before running, it even points to where the issue is. Just seems odd that no one has created a program like this yet for bat.. And no.. I can't make it. I've only just started writing bat scripts. I'm not a programmer.
This would definitely be a neat idea. And you're right as I can't see why someone hasn't made one yet, at least for basic batch files.

Samir
Posts: 384
Joined: 16 Jul 2013 12:00
Location: HSV
Contact:

Re: Programming helpful tool suggestions

#14 Post by Samir » 27 Nov 2013 08:36

foxidrive wrote:Advanced Batch is based around tips and tricks and undocumented behaviour, and that behaviour changes even more as further bugs and tricks are found.

It would be a daunting task to create a complete and fully featured syntax checker - but there are editors with batch syntax highlighting that can help in many ways.
Having something that could point out what it thinks are syntax issues and such would work though, wouldn't it? Like in Borland Turbo C when it would issue 'warnings' about certain parts of the code even though it would still work if you knew what you were doing.

Which editor has batch syntax highlighting? I want!

Ed Dyreen
Expert
Posts: 1569
Joined: 16 May 2011 08:21
Location: Flanders(Belgium)
Contact:

Re: Programming helpful tool suggestions

#15 Post by Ed Dyreen » 27 Nov 2013 11:10

Samir wrote:This would definitely be a neat idea. And you're right as I can't see why someone hasn't made one yet, at least for basic batch files.
They have been made, I've seen someone on youtube who wrote a batch-editor with syntax checking and highlighting. Then I realized I was wasting my time when the guy gave an example of his program fixing an error which was not an error obviously. The reason he gave trying to convince that it was an error, convinced me he was a batch script kiddy.

Creating an editor is not too hard and is not the reason obviously, if it were easy it would have been done already, as foxidrive said previously; it's veryComplex, too many variables, too many exceptions to take into account, too many different behaviors on too many platforms.
Samir wrote:Having something that could point out what it thinks are syntax issues and such would work though, wouldn't it?
I can't stop you :wink:

Code: Select all

%=   =%set ^"exit_=for %%? in (1,2) do if %%?==2 (set ?=^&for %%? in (^!*^!) do set ?=^!?^!¦%%?%$n1c%
%=      =%if ^!?^!.==. set ?=^"^")^&for /f ^"tokens=1-26delims=¦^" %%a in (^"^!?^!^") do (for %%? in (1,2) do if %%?==2 (for %%? in (^!~^!) do (if ^!§inline^!.==. echo(%$n1c%
%=      =%set/a$debug+=1,$err=0,§inline=1%$n1c%
%=      =%set $trace=%%~?%$n1c%
%=      =%set $debug.^!$debug^!=%%~?%$n1c%
%=      =%set $%%~?.p=^!*^!^&if ^!*:~0^^,1^!==^^^^^^^! set $%%~?.p=^!*:~1^!%$n1c%
%=      =%set $r=$err))else set ~=exit_%$n1c%
%=      =%echo(^&^<nul set/p= ^!$trace^!^^(%%~a;%%~b;%%~c^^)%$n1c%
%=      =%if defined $sysTemp.fullPath if /i ^!$script.path^! neq support (set _=^!$function.fullPathFile^!^&if ^!$NDF^!.==. for %%? in (1,2) do if %%?==2 (for %%? in (^!*^!) do set ?=^&set ?=^!%%~?^!^&^&(set ?=^!?:^"=^"^"^!%$n1c%
%=      =%call set ^"?=%%^^?:^^^!=#^"#^"^^^!%%^"%$n1c%
%=      =%set ^"?=^!?:^^=^^^^^!^"^&set ^"?=^!?:#^"#^"=^^^!^"%$n1c%
%=      =%set ?=^!?:^"^"=^"^!%$n1c%
%=      =%set %%~?=^!?^!))else set *=_%$n1c%
... ... ...
:shock:

Post Reply