Is worth DOS programming in these days?

Getting old software/games running on older hardware.

Is worth DOS programming in these days?

Postby bloodbath2you » 2017-12-05 @ 01:20

may sound a bit cliché, but ...

I'm an informatics student for 2yrs and got into DOS stuff era for years , games, software in general caught me to take the career., for me DOS is something so useful yet so simple, and for me an useful program is the one that just does the job efficently, appart of looking fancy... However, i'm conscious that informatics is a branch that searches for innovation and modern implementation of software, time is a delicate concept in this area then i may sound a bit irreverent because i should learn java instead of DOS, but in a personal sense can be useful.

For me DOS learning can be quite useful because is pure algorithmic work so i could learn and practice faster by just applying algorithmic concepts then taking the same basics to modern stuff. Stuff like strings, files, graphics, data structures, in modern languages(like java) I'm sure is a lot easier than C on DOS.

Also, would be useful for low level hacker-like stuff, like direct graphics manipulation or inline assembly and a lot more...

i think in these days programmers just follow the line, which is enough. If time shows me that DOS programming is not needed i'm disposed to follow the line.
bloodbath2you
Newbie
 
Posts: 26
Joined: 2015-9-09 @ 01:11

Re: Is worth DOS programming in these days?

Postby r.cade » 2017-12-05 @ 01:31

I used DJGPP extensively back in the DOS days and made lots of unfinished projects. :)

I originally started with a 1994-era of Visual C, but you had to deal with segmentation and the Microsoft libraries to get things working, so DJGPP was heaven to use instead.
r.cade
Newbie
 
Posts: 76
Joined: 2014-7-22 @ 14:32

Re: Is worth DOS programming in these days?

Postby BeginnerGuy » 2017-12-05 @ 01:52

I'm thinking your post is about bare metal or "close to the machine" performance programming vs modern API abstraction layers, interpreted languages, etc. If that's the case then the answer is both have their merit based on what you're doing.

I use dos nearly all the time for programming. There is a lot of intrinsic value depending on what you're doing, just be aware of what is relevant and what is not and try not to dote on the things that are useless today (like spending 100 hours learning how to use the graphics library in the ms c/c++ compiler, just think of those things as black boxes if you even need to use them and focus on what you're trying to accomplish / learn).

Games: For fun I've spent nearly the past year writing my own full game graphics (and now sound) engine in MS-DOS (not complete yet). It's been incredibly rewarding going through all of the good old works like Foley's Computer Graphics, Michael Abrash's "Zen" books, and a bunch of others. Having compilers relevant to the time period made some of the books super easy to follow, and I didn't have to bog myself down by learning DirectX or a gigantic software IDE/compiler suite in the process, it allows you to focus on the meat of your algorithms/graphics/whatever if that's what you enjoy. I've now been implementing what I've learned into a nice software renderer using directX on my windows 10 PC and guess what, the skills I've gained from mathematics and algorithms and game logic/design are perfectly relevant today. It doesn't matter if it's a "waste of time" and I could use the primitives in any of the modern APIs to do nearly everything, the point is that I LEARNED how it's done and I can implement exactly what I want with no waste, and I've gained better problem solving skills. Just don't get carried away with the need to understand everything at the lowest level, you'll find 10 lifetimes wouldn't be long enough.

General programming: I almost always throw together short functions into turbo C / MS C/C++ or even just QBasic when I have ideas stirring that I want to test out. If you're learning algorithms, there is absolute ZERO wrong with programming in dos and plenty to gain. You are simply writing console applications no different than modern students do using [insert Linux distribution]. Just don't get too heavy into learning the intricacies of a specific old compiler unless you're trying to do a big project for DOS machines. You just have the added bonus of having fun doing it because you're using a DOS machine. Just make sure you use your time wisely for yourself, and don't skip out on learning modern APIs and compilers just because they make things "easier" (to me they don't, the abstraction layers add confusion for many things).

As for low level stuff you're right. In DOS you have total access to your hardware i.e. VGA memory. You'll get better at moving things around memory in C, and then you'll find yourself learning 80x86 assembly so you can blast full WORD writes to the vga instead of the single bytes you'll get in C with nice little inline ASM functions. You'll be "Close to the metal". I don't care what advice they give elsewhere on the internet, you need C/C++ and assembly if you want to write the highest performance code even now. I happen to think as the progression in silicon is hitting a dead end, there will be a major shift back to performance code and the skills are very relevant in embedded systems today, so you're gaining tons of practical skills doing that.

**Not that anything is wrong with learning Python or other modern languages, I just get tired of hearing about how the "old way" is a waste.
Sup. I like computers. Are you a computer?
User avatar
BeginnerGuy
Member
 
Posts: 466
Joined: 2016-12-19 @ 08:32
Location: North Carolina, US

Re: Is worth DOS programming in these days?

Postby bloodbath2you » 2017-12-05 @ 02:53

i really apreciate your advice man :)
bloodbath2you
Newbie
 
Posts: 26
Joined: 2015-9-09 @ 01:11

Re: Is worth DOS programming in these days?

Postby vvbee » 2017-12-05 @ 09:03

This seems mostly specific to console programs in c?

The easiest yet most visually accurate way I've seen to do triangle-based software rendering is the simple brute force barycentric method. It's too heavy for dos era machines though so you won't learn it there, oops. But it also looks a little boring, so you may after all want to go dos and have to write a more interesting-looking wobbly integer renderer.
User avatar
vvbee
Member
 
Posts: 183
Joined: 2017-2-06 @ 17:56

Re: Is worth DOS programming in these days?

Postby Scali » 2017-12-05 @ 13:18

vvbee wrote:But it also looks a little boring, so you may after all want to go dos and have to write a more interesting-looking wobbly integer renderer.


The real challenge is to write wobble-free integer renderers in DOS.
That is what originally got me started on the Just keeping it real-series of blogs: I wanted to get an accurate, subpixel-corrected renderer using only 16-bit integers and 64k segments. And I pulled it off :)
https://youtu.be/4ClrU-ne2Us
Scali
l33t
 
Posts: 2990
Joined: 2014-12-13 @ 14:24

Re: Is worth DOS programming in these days?

Postby amadeus777999 » 2017-12-05 @ 16:27

Props to Scali for proving the naysayers wrong - he's crossed the line so to speak.

The most fun I've had in a long time was with a 486, DOS and WatcomC. Thinking of a functionality I would love to see and then implementing it - or at least trying to. Especially Watcom's nice inline assembler is a unique opportunity to insert assembly code in a very elegant way.
For learning(the "basics") I found this minimalistic setup to be the most satisfying. You have to take my input with grains of salt though since I'm not a professional programmer which, of course, enables me to pick out the raisins as I please.

I have to agree with "BeginnerGuy" on the C(ompiled Language)/Asm issue - performance counts and "low level", or at least compiled, languages can be a very efficient interface to the underlying machine or parts of it.
BUT, again, I'm biased here as I like knowing something about the machine at work... that's a big part of the fun/road ahead. I can't say much about C++ as it seems so monstrous to me. Maybe I'm just too dumb to use it efficiently but after watching some of Stroustrup's talks I was like "Interesting but I'd rather use something simple." Again, this could be the case of Stroustrup throwing pearls before the swine but the syntax of C++ is very confusing to me... and it seems to be getting even more complicated.

Machine oriented info is hard to come by but there's a beacon of light in the form of Agner Fog and his excellent site(->"Software optimization resources") and manuals - http://agner.org/optimize/
User avatar
amadeus777999
Member
 
Posts: 269
Joined: 2013-7-04 @ 17:04

Re: Is worth DOS programming in these days?

Postby .legaCy » 2017-12-05 @ 17:42

I think DOS programming is worth, for me programming in every platform is worth, profissionally or just for hobby.
Currently i'm working on a Joystick to keyboard translator(Windows only) so i can play with joystick games that don't have support for it and for me it is fun,it is like a hardware computer build for me, dealing with the problems(that may result in a headache) and in the end you can look and think "i did it".
I'm getting into MS-DOS programming too, i have a little bit of "head start" because i know the asm basics, i'm familiarized with C so it is just the platform "things" that i need to learn and be familiarized.
In my opinion, for hobby, go for it.
If you like retro hardware and retro gaming videos please visit my YouTube channel
https://www.youtube.com/channel/UCSZiFV ... zNa30_DYTg
User avatar
.legaCy
Member
 
Posts: 286
Joined: 2016-4-08 @ 23:11
Location: Brazil

Re: Is worth DOS programming in these days?

Postby Scali » 2017-12-05 @ 17:55

amadeus777999 wrote:I can't say much about C++ as it seems so monstrous to me. Maybe I'm just too dumb to use it efficiently but after watching some of Stroustrup's talks I was like "Interesting but I'd rather use something simple." Again, this could be the case of Stroustrup throwing pearls before the swine but the syntax of C++ is very confusing to me... and it seems to be getting even more complicated.


I think as long as you think of C++ as exactly that ('C' ++ extra stuff), you should be fine.
C++ allows you to do pretty much everything you did in C. It's a bit more strict with type checking, which is a good thing.
You can still write code without classes, objects, templates and everything, and you can still put in inline assembly and all that.
You can just choose to use some extra C++ features when they make sense. And don't use them when they don't.
Scali
l33t
 
Posts: 2990
Joined: 2014-12-13 @ 14:24

Re: Is worth DOS programming in these days?

Postby .legaCy » 2017-12-05 @ 19:00

Scali wrote:
amadeus777999 wrote:I can't say much about C++ as it seems so monstrous to me. Maybe I'm just too dumb to use it efficiently but after watching some of Stroustrup's talks I was like "Interesting but I'd rather use something simple." Again, this could be the case of Stroustrup throwing pearls before the swine but the syntax of C++ is very confusing to me... and it seems to be getting even more complicated.


I think as long as you think of C++ as exactly that ('C' ++ extra stuff), you should be fine.
C++ allows you to do pretty much everything you did in C. It's a bit more strict with type checking, which is a good thing.
You can still write code without classes, objects, templates and everything, and you can still put in inline assembly and all that.
You can just choose to use some extra C++ features when they make sense. And don't use them when they don't.

Templates is one of my "most awesome features" in C++, it is pretty handy.
If you like retro hardware and retro gaming videos please visit my YouTube channel
https://www.youtube.com/channel/UCSZiFV ... zNa30_DYTg
User avatar
.legaCy
Member
 
Posts: 286
Joined: 2016-4-08 @ 23:11
Location: Brazil

Re: Is worth DOS programming in these days?

Postby Scali » 2017-12-05 @ 19:13

.legaCy wrote:Templates is one of my "most awesome features" in C++, it is pretty handy.


I fully agree!
The most awesome template trick I've done is for the Marching Cubes algorithm: https://en.wikipedia.org/wiki/Marching_cubes
My implementation has a templatized class for the grid size: MarchingCubes<X,Y,Z>.
Inside the class, the, X, Y and Z are constants, and as such, anything related to these constants can be precalced by the preprocessor.
So the entire class is precompiled and preoptimized for the specific grid size you are using. It generates specific constants and tables optimized to find neighbouring cells by just adding a constant to the current index.
That sort of thing is basically impossible to do any other way.
Scali
l33t
 
Posts: 2990
Joined: 2014-12-13 @ 14:24

Re: Is worth DOS programming in these days?

Postby vvbee » 2017-12-05 @ 21:48

Scali wrote:
vvbee wrote:But it also looks a little boring, so you may after all want to go dos and have to write a more interesting-looking wobbly integer renderer.

The real challenge is to write wobble-free integer renderers in DOS.
That is what originally got me started on the Just keeping it real-series of blogs: I wanted to get an accurate, subpixel-corrected renderer using only 16-bit integers and 64k segments. And I pulled it off :)
https://youtu.be/4ClrU-ne2Us

It's a cool demo, seen it before as well. Problem is it doesn't wobble.
User avatar
vvbee
Member
 
Posts: 183
Joined: 2017-2-06 @ 17:56

Re: Is worth DOS programming in these days?

Postby BeginnerGuy » 2017-12-05 @ 22:42

Scali wrote:
vvbee wrote:But it also looks a little boring, so you may after all want to go dos and have to write a more interesting-looking wobbly integer renderer.


The real challenge is to write wobble-free integer renderers in DOS.
That is what originally got me started on the Just keeping it real-series of blogs: I wanted to get an accurate, subpixel-corrected renderer using only 16-bit integers and 64k segments. And I pulled it off :)
https://youtu.be/4ClrU-ne2Us


Oooo! Do you share the source? I'd like to play with it.
Sup. I like computers. Are you a computer?
User avatar
BeginnerGuy
Member
 
Posts: 466
Joined: 2016-12-19 @ 08:32
Location: North Carolina, US

Re: Is worth DOS programming in these days?

Postby Gered » 2017-12-05 @ 23:27

Not much else I can add that hasn't already been said, but this year I took up an interest in getting back into DOS programming and have been having a blast. For me the reasons why were:

1.) A return to low-level / "closer to the metal" programming. I've been a professional software developer for the past 12 years. I currently work with Clojure, Java, Javascript and most recently have been using some Go for a new project at work. Also worked with .NET and PHP years ago. With the (sort-of) exception of Go, all of these are really high level, especially Clojure. This isn't a bad thing by any means as I feel far more productive writing Clojure code then with any other programming language I've used to date. However, a lot of it feels like "magic" sometimes and I also feel like it's far too easy to write slow/sloppy code without realizing it until much later (if you ever do at all). Good for productivity, but it just irks me at times. :) So, returning to simpler OS's on much slower and more resource-constrained systems feels good as a kind of self-check to keep myself thinking about performance and writing better, more efficient algorithms.

2.) Nostalgia. I started out as a kid writing QBasic in 1995 after finding a book in my school's library. I remember the road I went along on my journey of self-teaching myself programming. I remember very clearly all the books I got (and still have today) and how I struggled with some of the more advanced ones (usually to do with 3D graphics, Doom-like engines, etc) and just in general how a number of the really cool things other people were doing then remained out of my reach as a kid. I decided this year that I wanted to revisit these stumbling blocks from my childhood and see what I could do with them today using the very same tools, hardware and reference materials (books) I had back then. One or two of those stumbling blocks remain though (such as my lack of artistic skills). :)


I agree completely with what BeginnerGuy said earlier in this thread... if you're not looking at DOS programming for nostalgia / fun, as long as you keep focused on the things that can be applied more generally to "real world" problems today using modern development tools then I don't think DOS programming is a waste at all. With today's complex development tools and IDEs, it really is refreshing to run "QBASIC" or "RHIDE" (for example) from a DOS prompt and be able to instantly write and compile/run code. I often feel like we're still missing something with that instant development/feedback type cycle thing that QBasic provided back then, but maybe it's just me. Some stuff available today is getting kind of close I guess.
486DX2-66/16MB/S3 Trio32 VLB/SBPro2/GUS
P233 MMX/64MB/Voodoo2/AWE64
Duron 800/256MB/Savage4 Pro/SBLive (IN PROGRESS)
User avatar
Gered
Newbie
 
Posts: 99
Joined: 2017-6-23 @ 22:31
Location: Toronto, Canada

Re: Is worth DOS programming in these days?

Postby Scali » 2017-12-06 @ 01:24

BeginnerGuy wrote:Oooo! Do you share the source? I'd like to play with it.


Yea, I uploaded the code of that release here: https://www.dropbox.com/s/urrzyy23gtvcc ... l.zip?dl=0
It's a mess... requires Turbo C++ 3.1
I've moved to OpenWatcom since. Which is much faster. However, I never did a straight port of the 1991 Donut code to OpenWatcom.
It sort of 'evolved' into the polygon routine of 8088 MPH.
Perhaps I should do a proper port of 1991 Donut to OpenWatcom as well :)
I've also modified and improved various bits of shared code since, and developed better ways of doing certain stuff. So 1991 Donut could be made better.
Scali
l33t
 
Posts: 2990
Joined: 2014-12-13 @ 14:24

Re: Is worth DOS programming in these days?

Postby BloodyCactus » 2017-12-06 @ 13:59

I love dos programming, its very simple. "text mode" is soo easy. the problem becomes one of code coupling. If you dont use things like pdcurses, your code is now hardcoded to work with dos only. but then, if thats your target, thats perfectly fine.

I still write dos code, I'm digging out my old code and trying to refresh some things. Im moving things to OpenWatcom 2, as I was hardcore Watcom 10.6 user back in the day (still have the original install cd's for watcom 9,10,11).
--/\-[ Stu : Bloody Cactus :: http://kråketær.com :: http://mega-tokyo.com ]-/\--
User avatar
BloodyCactus
Oldbie
 
Posts: 596
Joined: 2016-2-03 @ 13:34
Location: Lexington VA

Re: Is worth DOS programming in these days?

Postby vvbee » 2017-12-06 @ 15:15

Qt's ide wired to run dosbox and build the dos part with digital mars c/c++ works great for me on linux. Integrates well with fasm for 16-bit assembly too. Then you design your c/c++ to be portable (e.g. interface + modules) and the same thing compiles for 16-bit dos and modern linux, windows, mac, etc. + some retro consoles if you're into that.

Openwatcom's license is ugly. I always avoid it when possible.
User avatar
vvbee
Member
 
Posts: 183
Joined: 2017-2-06 @ 17:56


Return to Software

Who is online

Users browsing this forum: Spaz and 1 guest