Larkin, Power BASIC cannot be THAT good:

A million? I thought it was more like 100,000 lost since the war started, mostly killed by other Iraqis.

Here, from an anti-war outfit:

formatting link

--
Cheers,
James Arthur
Reply to
James Arthur
Loading thread data ...

SH killed over 2 million in his roughly 20-year career, about 100K per year. About a million alone in the war with Iran.

John

Reply to
John Larkin

So what's your obsession over throwaway code, anyway? The whole premise of "portable code" is silly to begin with. Yes, C _can_ be written to compile on, say, different compilers and different OSs, but that's just /hiding/ the throwaway bits inside #defines. That's worse than maintaining individual copies of the same source, written specifically for their intended compiler-OS combination, because you have to wade through #ifs, #defines and .h's to find out what the hell is going on. In seperate copies, everything is *there* to see, plain and simple. Between copies, the structure is (presumably) identical, differing only in those key places which would otherwise be #defined, so it's no harder to compare them.

By the way, I've had excellent success with the small list of programs I've maintained between QuickBasic and FreeBASIC -qb. There are only small differences; much of the code is directly useful. All the old stuff still works; for instance, you automatically get a text console, and you can open windowed graphics in a single statement.

Finally, since code always has to be rewritten to reuse it anyway, what difference does it make what language it's in before you rewrite it? From C to C, or C++, or Java, or to many of the other braces type languages, you might only need to refactor some keywords to make it fit. But when you have to rewrite the whole damn thing, it doesn't make much difference what language it's in -- BASIC, C, Java, etc. all share the same imperative program flow structure, and share much of the same syntax and control statements. The program structure and algorithm flowcharts are identical. Converting BASIC to C is very simple; the standard libraries for both are even fairly similar (too bad BASIC has more powerful libraries!).

Tim

--
Deep Friar: a very philosophical monk.
Website: http://webpages.charter.net/dawill/tmoranwms
Reply to
Tim Williams

Sure. Why have standards at all? I really like having to do everything from scratch, not having the ability to leverage anybody else's previous work. Oh, the joy of learning a new language every time I write some code.

What better use of my time than having the task of rewriting code to use a new version of a compiler because the compiler writers were too lazy to care about any compatibility with other vendors or even with other versions of their owh compilers. Rewriting page after page of previous code to use a new langage is fun!

What I really want is to be permentantly locked into using one vendors particular version. If I have 40,000 lines of QA automation to perform regression testing on a software syhstem, I really want to be locked into using a particular compiler version forever. I don't want to be able to use improved libraries because I want to be locked into some ten year old langauge system.

Reply to
AZ Nomad

You have a lot of misconceptions about what portable code looks like. I regularly write code which works on Windows, MacOSX (x86 & PPC), Linux and Solaris, and the code very rarely uses macros.

Dealing with architectural differences is mostly an issue of not making any assumptions about widths of primitive types, byte-order, padding, etc. Stick to what's valid according to the language rather than "this compiler on this CPU behaves like this".

For dealing with API differences, I'll just write Unix and Windows versions of key functions, with the different versions in different source files.

For the project which is in front of me right now, out of 53 C source files (not including headers), 2 are Unix-specific, 2 are Windows-specific, the other 49 are portable. There are precisely 6 #if[def] directives in the entire code (mostly for platform-specific headers), and no platform-specific macros.

It doesn't. It might have to be modified, but that's not the same as rewritten.

Or you might (and probably will) need to completely rewrite it. C doesn't have classes, Java doesn't have pointers, or half of C++'s OO features, or many of the libraries available to C/C++ code. C and C++ don't have garbage collection.

Except that most BASICs are even more primitive than C: not only no OO, but no structures, unions, pointers, function pointers, dynamic allocation, threads, ...

If you're used to BASIC, you won't miss these things, but your code will typically be full of hacks and workarounds (although it won't seem this way until you've programmed in a language with more structure).

Reply to
Nobody

On a sunny day (Sat, 20 Jun 2009 02:32:39 GMT) it happened James Arthur wrote in :

The number of death of children by imposing the oil embargo, the number of death by polluting that country with depleted uranium ammo, the number of death because of deliberately creates sectarian violence, etc etc, is all because of US policy to get control of the Iraqi oil fields and push the price of oil way up. Now they want to destabilise Iran too, and Obamama has just OKed drilling in front of the US. If they get enough oil from there, .. then Iran can be bombed? What will happen when the multi-nationals (oilers) one day decide to bomb the US to get the price of oil up?

After all, US is no longer the leading world power except for a few H bombs... Maybe Kim from N Korea is working on a H bomb too.... Pakistan, India, China, France, Russia, Israel, maybe Iran, some fireworks :-) (Sorry if I forgot anybody).

Then international court of law .. the UN, will war criminal GWBush be sentenced? With US power faltering sure that pressure to do that will increase. After all he is just one guy in Texas, so who really cares ... All is relative is it not? Even Cesar ... OK.

Reply to
Jan Panteltje

On a sunny day (Fri, 19 Jun 2009 23:13:55 GMT) it happened Rich the Cynic wrote in :

There is one distro run by one man, and it was a good distro the last time I tried it, Slackware. But it takes 24/7 to maintain such a project.

I do not think Linux is for the aunt-Tilly types, although for example Xandros makes it much like that on the eeePC, especially after I added some stuff my eeePC is more user friendly, but perhaps only to me :-).

To try to imitate MS GUI is a death trap I think.

I have some nice key bindings on that eeePC, ctrl Alt C sets up the network connection, ctrl Alt O starts Opera web browser, ctrl Alt T starts an xterm, etc. So much faster then rubbing a pad, clicking icons, and working through menus . ctrl Alt U starts the Usenet news reader.

Reply to
Jan Panteltje

front of the US.

sentenced?

You're babbling.

John

Reply to
John Larkin

Yup. Once you work out a scientific algorithm in some Basic, it's easy to tweak it for another dialect of Basic. Easier than converting a program from Fortran to Pascal to C++ to Java. I've converted biggish programs from DEC Basic+ or Qbasic or PDS basic to PowerBasic. The only tricky part is if there's graphics involved, but that's a nuisance in most conversions.

Libraries? Why use libraries, when any decent language has all the features you need built in? Would you buy a cheap car and add after-market power steering and automatic transmission and air conditioning?

John

Reply to
John Larkin

What OS are you working in, that will be invariant for the next 10 years? Is all your i/o plain ascii streams?

If you have 40K lines of code to test other code, you must be a programmer. So why you are telling engineers how to design electronics, posting to s.e.d., is a bit obscure. Some people use Excel, some use Mathematica, some use Basic, some do Laplace math on grid paper with pencils. Portability is not an issue if a tool solves an engineering problem and the tool will remain available for as long as needed.

If I stick to PowerBasic for engineering apps I don't need to rewrite much. Moving a program from Qbasic to PBCC isn't hard, and I can still run 12 year old Qbasic or compiled PDS Basic programs, and still do.

What do you do about a 12-year old Pascal program? Or a 30 year old Fortran program? Do you think that C will be the language of choice 20 years from now? And that all the APIs will be the same? I sure hope not.

Basic is older than C and will probably survive it.

John

Reply to
John Larkin

On a sunny day (Sat, 20 Jun 2009 07:46:24 -0700) it happened John Larkin wrote in :

sentenced?

Sure I am babbling, if Kim shoots over the ocean you are closer then me though. When I was a kid i used to read comics about was it 'Buck Danny' fightin gin Sabre fighters in N Korea.. It sure was not Daffy Duck.

LOL

Reply to
Jan Panteltje

On a sunny day (Sat, 20 Jun 2009 07:54:49 -0700) it happened John Larkin wrote in :

Now look who is babbling again! Any idea how many libraires there are in C for anything? Including all that 'in a language' would be impossible. Loading BASIC simply would not fit in your terabyte memory.

hehe

Reply to
Jan Panteltje

53?! All the programs I've done in the last few years have each had one source file. The only exception is embedded things that have one uP code source file and one to four FPGA configuration files, which all get built into one rom image file.

John

So the only languages that allow 40-year old programs to be simply tweaked to compile and run on modern OSs are Fortran, Basic, and Cobol.

40 years from now, they probably will still be.

PowerBasic has all that, except maybe threads.

John

Reply to
John Larkin

Does your favorite basic have: xml processing? web retrieval routines including the ability to fill out forms, handle all http objects call system functions, connect file I/O w/ pipes, traverse directory trees zipfile/bzip/bzip2 file functions ftp/gopher/imap4/soap/nntp/smtp server access rpc calls email, mime, uu, binhex multimedia handling (audio formats, video formats, etc.) cryptographic functions You got that all built in? You have all that on a platform independant langage so if you want your software to run on say an intel atom, you won't have to learn a whole new environment?

And yes, I'd buy a cheap car and put in my own car stereo. And I'd expect that car stereo to be just like the one I put in a different maker's car. I'd also expect that car to work on california roads if I travel there without having to specifically have a proprietary package for california roads or wonder if it'l handle idaho roads too if I pass through.

Reply to
AZ Nomad

I'm an engineer and I design electronics. This is s.e.d. Does your C do transient and frequency-domain circuit simulation? I use LT Spice for that. And I use PowerBasic for engineering calcs and graphics. The graphics are great.

PB does do ethernet and tcp/ip easily; I use it to talk to and test our ethernet-version products. It takes one line of code to open a tcp/ip session, one line to send a string, one line to get a string, one line to close. All built in, called with plain English words (like TCP OPEN), all with one-key HELP. PB can also do email, stroll around directory trees, do COM stuff, random access arrays of structs in files, all that. Fill out web forms? I don't do that to design electronics. Zip files? Just shell out to do stuff like that, if you have to, which I don't.

One fairly new feature I love is TRY...CATCH. It makes error management easy. When you're writing programs to test production instruments, errors are a big part of the game.

All that I need. More, actually.

You have all that on a platform independant langage

Windows won't run on Atom?

John

Reply to
John Larkin

Clarification: 100k civilians killed, the great majority of whom were from Iraqi-Iraqi violence--Sunnis killing Shia & vice versa--not from US military operations.

So, 1 million is off by more than 20:1.

Ah, but how many jobs did he create or save, and did he author a nifty filesystem?

--
Cheers,
James Arthur
Reply to
James Arthur

Cool. Since thay have to worry less, they can be even more careless.

On the other side C/C++ don't allow to let a

Exactly. That is the dominant programming culture: hack fast, do dense tricky stuff, use as many automated tools as possible, compile until there are no errors, run it and fix any bugs that are impossible to ignore, modify and VCS it until management says it's time to ship the next release, and let the users find the many other bugs.

John

Reply to
John Larkin

On a sunny day (Sat, 20 Jun 2009 09:22:55 -0700) it happened John Larkin wrote in :

So, John, how's your FFT and reverse in Power Basic? Or do you, as engineer never use FFTs?

Reply to
Jan Panteltje

I've done some FFTs in PB, not often. There are some public subroutines, and some commercial packages. The stuff I did just worked. The Crescent Software QPSCI-package FFT subroutine FFT1.BAS is about 80 lines, comments included, does forward or reverse, and seems fine.

I've also done DFTs in assembly, also no big deal.

If all you need are a phase angle or a few spectral lines, a DFT can be a lot easier and faster than an FFT. You can even DFT on the fly as sampled data comes in, avoiding big clumps of computing.

We're doing a scientific instrument now, Linux based, and we'll probably use the fftw or maybe the cpu-specific Intel libraries, since speed will matter. This will be all embedded C stuff, which I won't write. After all, I'm not a programmer, or a bookkeeper for that matter.

John

Reply to
John Larkin

On a sunny day (Sat, 20 Jun 2009 09:57:52 -0700) it happened John Larkin wrote in :

Yes DFT is easy in C too.

fftw is nice, but changed API a while back. I am still with the old one. Have not used it for a while. Used it for video processing, speed is very important in that case.

Reply to
Jan Panteltje

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.