JavaScript and DOS Print E-mail
Written by Administrator   
May 20, 2008 at 12:31 AM

JavaScript and Dos- Jim Atkins

I’ve been scripting for a little over 13 years now. I started on an old IBM where you had to script in order for the machine to do anything useful. I had a DOS 1.1 hardbound book from IBM and the 51/4? inch disks to get the PC Jr to boot. The flavor of DOS I worked with was PC-DOS but


I’ve also worked with others (MS, DR, etc.). I spent about a year upgrading and coding on that box and finally upgraded to an IBM 8086. Remembering back I recall that DOS batch files and knowing how to work with them was mandatory if you wanted to go beyond having a glorified word processor. DOS batch files where the blood and guts of getting the computer to work for you and actually do some great stuff.

DOS was the system and the different DOS programs is what made a computer fun to work with. Using batch files and linking DOS system files you could build programs like windowed file menus and a whole lot more. DOS had its limits but the deeper you dug into it the more you could do. I spent a lot of the time inside compiled programs fixing problems and just seeing how things worked. I recall one program I used that gave you a split view inside a program, one side was the machine code the other was the actual program pointers. I didn’t understand all that I was looking at but I was learning something I could use as long as I code, logic.

I understand that even the latest PC OS has as its core the DOS structure I worked with 13 years ago. The actual OS may be independent of DOS but if you go back to Windows For Workgroups 1 and follow the progression of MS Windows you’ll see what I mean. Even the earlier versions of DOS had the ability to link system files and create libraries of frequently used system functions. A lot of people had to work with, at that time, memory management and ways to push the envelope on upper memory. Remember the old 640k barrier, and then the upper, and then the extended memory. I’m not sure the 1024 barrier is conquered but instead it has been circumvented. That’s another discussion.

Programming in JavaScript, to me, is much like DOS in that I believe it will always be with us. It may change form, like the addition of prototypes and the increasing use of JSON (JavaScript Object Notation), and the like. But, much like DOS batch file scripting, the core is the same and revolves around logic. Not the code logic but the programmer’s logic. I’m not a 'pretty' JS coder. I usually try to clean up and shorten code but my philosophy is that if works cross browser and does what you intend for it to do then be happy. You can always strive for perfection but what you are aiming for is functioning code that works as intended.

I’ve always said that the only difference between programming languages is the syntax. Some languages will have better libraries and flow more smoothly but at the end of the day it’s the coder’s logic that makes the code work. I’ve worked with basic, Fox Pro, Visual Fox Pro, Visual Basic, Java, and a few others, and it always comes down to understanding the code flow. There are a number of reference materials to guide you with syntax and available libraries, classes, etc., but without logic you’ll be lost

The reason DOS batch files, and DOS itself, helped me is that simple logic. Not simple in what it could do though. You could actually write a complete and complex functioning program using a stand-alone DOS batch file. With a series of them the sky is the limit. And yet, there are only a few batch commands available. Those commands, though, are powerful and are the core to every programming language. IF this equals this go to there, for that in this do the other, if the other is not there run this program. Etc., these are the fundamental building blocks of any programming language.

JavaScript, of course, has a lot more to offer. Used primarily as a client-side scripting language in a web browser, JavaScript is widely used and, I believe, will be increasingly used as the client-side language of choice. It seems, as time goes on, JavaScript becomes more powerful and has few of the limitations it had in its earlier days. More sites are requiring JavaScript be enabled and more site programmers are relying on JavaScript for the grunt work to make it all happen. Just as DOS enabled a computer to boot and operate JavaScript allows things to work when that site page comes up in the browser. Even as ASP, PHP, and some of the ‘other’ web languages, flex their muscles Javascripting is there making it possible for the user to see those muscles bulge. This is why JavaScript will continue to evolve to be a website’s DOS engine and the blood and guts of getting a website to work for you and actually do some great stuff.

 

Jim Atkins is owner/programmer of JBAtkins Consulting http://www.jbatkins.com

All Rights Reserved ©


User Comments
Please login or register to add comments

Last Updated ( May 20, 2008 at 10:57 AM )
http://www.jbatkins.com/weblog, Powered by Mambo and Designed by SiteGround web hosting