HurricaneAndy
11-13-01, 02:47 PM
Does anyone here still program BASIC? I do.
|
|
View Full Version : Basic HurricaneAndy 11-13-01, 02:47 PM Does anyone here still program BASIC? I do. Rick 11-14-01, 04:11 AM the problem with basic is "goto statement" which makes it (the code) spaghettic .it transfers the control quite frequently,in big softwares its going to jumbled up.let me tell you why. think as a compiler.now when it compiles it does statements by statements,if you give goto the control is transferred to thatstatement,comes back after that execution,in that way it goes crazy. basic is not very flexible in nature,however graphics programming is pretty KOOL,i learned it in my early high school days. Bowser 11-14-01, 11:12 AM I played with BASIC on a Commodore-64 back in '85 and '86. My understanding of the problem with the "GOTO" statement is that, if used too often, the programmer finds it difficult to follow his/her own code. Chagur 11-14-01, 12:46 PM HurricaneAndy Haven't in a long time, but enjoyed it much when I did. zion GOTO was not the problem, but rather undisciplined programmers. It was a great tool when used with well written, frequently called modules. Bowser Not only the too frequent use of GOTO, but also the lack of adequate documentation (still a problem). Ah, for the simpler days when content and elegant code meant more than glitz and pizzaz. esp 12-04-01, 08:32 AM Doesn't everybody? I never struggled with goto, from a compilation point of view, whether it's c, pic or basic, you write, you compile (or parse) and you run. Because the compilation is completed off line, all the low level code is ready when the program is executed. Rick 12-04-01, 08:53 AM Originally posted by esp Doesn't everybody? I never struggled with goto, from a compilation point of view, whether it's c, pic or basic, you write, you compile (or parse) and you run. Because the compilation is completed off line, all the low level code is ready when the program is executed. Hi esp, for small time programs,the goto statements are not a problem,but as the programs go bigger,the problem rises.its diffcult for you to follow your own code.like if you"re making some project ,then it will have so many pages of programming and if you use goto you"ll probably start hating it,as you"ll have to go through the other pages to follw your own code since with goto control jump is a common thing. bye! riddlermarc 12-04-01, 09:05 AM I used to program my Sinclair ZX Spectrum many years ago, aah the heady days of Basic :) Pollux V 12-04-01, 09:05 AM I learned QBASIC in a class a few weeks ago. I hated it! Porfiry 12-04-01, 01:18 PM The idiocy of BASIC kept me away from programming for years. I thought, "there has to be something more elegant than this", and there was. Thought, I do recall writing a program that brought down the school network (of 286s) using QBASIC. That was fun. Dracula's Guest 12-10-01, 07:37 AM Ah Commodre 64 and the Vic-20 were my favourites. even if the Vic-20 was seriously underpowered, it helped me learn to program in a nice simple environment. its amazing the amount of control you could have on those old computers, but then loading was dreadful if you were using a tape drive, no task manager to check if a program locked up either. I never really went beyond Basic though, did some tinkering with Qbasic but the compiler was annoying and didnt always work on large programs. They keep making new Basic's like DarkBasic which gives you access to directx apparently, ah but the old Vic-20, bliss. I know the PC is far more powerful, but why does it have such a bland name. PC, talk about dull and officey, why not something a bit more imaginative like Vic-20, ZX Spectrum, Dragon 32 etc. I guess they were all reffered to as "Microcomputers" but even that sounds more fun than PC rde 12-10-01, 10:23 AM Originally posted by Porfiry Thought, I do recall writing a program that brought down the school network (of 286s) using QBASIC. That was fun. The version of basic that came with - I think - dos 3.3 didn't like Novell networks at all. I had a simple program that did nothing but basic disk i/o, and it'd kill the network stone dead every time. A bit of messing around after hours revealed that about 90% of the programs I wrote killed the network. Merlijn 12-11-01, 02:09 PM 001 ?"Hello"; 002 goto 001. 003 REM Please skip the first 2 lines . . . 430 ?"Indeed very vague."; 440 REM This is a slightly modified email message I wrote to a 450 REM friend some tim ago Talking about vague: 460 INPUT IsawThat ="Did you see DS-9 (Strar Trek) last night?" 470 ?"tWas very good."; 480 IF (IsawThat ='yes') THEN goto 500 490 ?" You really missed something!"; 500 REM 510 ?"See you next wednesdag"; 520 ?"Bye,"; 530 ?"Rogier"; 540 REM 550 INPUT again="Do you want to reread this message? " 560 IF (again='yes') then goto 002 570 END daktaklakpak 12-11-01, 02:49 PM I remember in the days of Apple II+, I was quite good at doing one line programming to solve some simple math problems, such as finding the square root of a number, or list all the prime numbers. If you guys every tried, basically the problem must be solve with a BASIC program no more than 256 characters in one line. Joeblow93132 01-16-02, 11:55 AM HurricaneAndy, If you want a small, powerful, and modern BASIC, then buy Powerbasic. I have version 6.0 and it's very fast. Powerbasic claims that code compiled in Powerbasic runs up to 20 times faster than the same code compiled in VB. Believe it or not, the whole language arrives on two floppy disks(including help files and built in assembler). All others: You don't have to use GOTO if you don't want to. You can use GOSUB or call functions/procedures just like in C/C+. If GOTO is too difficult for you, maybe you shouldn't be programming. Tom Rick 01-31-02, 07:11 AM Originally posted by Joeblow93132 HurricaneAndy, All others: You don't have to use GOTO if you don't want to. You can use GOSUB or call functions/procedures just like in C/C+. If GOTO is too difficult for you, maybe you shouldn't be programming. Tom Excuse me? The Entropy of GOTO in Long term software projects is meagre,as estimated. PS: entropy of GOTO= -log[(probablility of occurence of GOTO)] bye! Joeblow93132 01-31-02, 01:19 PM Zion, I would recommend that you use GOTO if you wish to write small and efficient programs. If you want to write large and slow bloatware programs, like the ones from Microsoft, then you should replace all the GOTO's with procedures and DLL's. Note: After all, GOTO is the equivalent to JUMP in assembler. The most powerfull programs are the ones that are written with commands that are closest to machine code, like GOTO. Tom Porfiry 01-31-02, 04:07 PM The most powerfull programs are the ones that are written with commands that are closest to machine code, like GOTO. Real men don't need function calls! err... I do hope you realize the absurdity of what you're saying. Yes, every layer of abstraction (eg. procedures, methods, messages) has a cost. But the benefit is the productivity of the programmer. A dynamically bound procedure call, done properly, might take 30 assembly instructions. Given that modern processors can do 2 billion operations per second, I'd much rather have as much abstraction as can be dreamt up. Rick 02-01-02, 03:47 AM Small and efficient programs...?? hahahahahahahahahahahahahahahahahaaaaaaaaaa...:p are we talking about "HELLO WORLD" or may be swaping programs here?off course if your pointer is moving in that fashion then go ahead and use GOTO,its Kool;).But bigger programs??No way...i and my friend were involved with implementation of CSMA/CD algorithm(Carrier sense multiple access with collision detection) with the help of C-sockets programming,the program went on to take 6 separate Files.(*.c i mean)and each program had round about 1500 lines of code.the programs were implementing Slotted ALOHA algorithms,at the same time there was a provision made for abortion of collision of packets(in a network).can you use GOTO here? had i used GOTO,i wouldnt be able to follow my own code? And dont compare Asm with Basic... bye! Joeblow93132 02-01-02, 11:54 AM Porfiry, The Pentium 4 performs up to 6 operations per clock cycle, and Athlon XP performs up to 9 operations per clock cycle. That means that modern processors do up to 15 billion operations per second (1.67GHz*9 or 2.2GHz*6) not two billion like you stated. Ever wonder why modern programs run so slow on such fast processors? If processors are over 100 times faster than they were ten years ago, why aren't programs a hundred times faster? Maybe because of the sloppy programming you're suggesting. Another thing: Just because processors are faster doesn't give you a reason to write slow-ass programs. Zion, I've been programming since I was eight years old, and I consider myself an old-school programmer. By old-school I mean writing programs that are fast and that can fit on a floppy disk. Over the years I've written over a hundred programs, many dealing with complex mathematical formulas(i), and none of them were over 300K when compiled. I am currently writing a broad-based artificial intelligence program, that, when finished, would contain about 400 lines of code. So forgive me if I find it funny that you've written a networking program that contains 9000 lines of code. An entire operating system can probably be written with less than 9000 lines of code.(Unless it was written by Microsoft, of course) Tom Rick 02-02-02, 09:49 AM A small Ping Flood program as i understand takes a hell lot of time and loads of lines.about 6 pages in print out. a Small part fo NOTEPAD program in windows takes hell lot of space than you can even imagine,even if you try to build a VI, or may be any other unix editor it"ll require loads of lines of source code. and here we are talking about CSMA/CD,i hope you know what it is,as you are experienced enough as you put it.It involves multiple algorithms,enhancemment features like adding GUI to it.making it more flexible and user friendly for use.currently the software as you might put it is with my Fathers company,and yeah works a hell good. Funny as you may find it,but Microsoft uses a hell lot of inovative techniques and slip arounds to Give you a dumb window in front of you.needless to say TSRs etc. and BTW which OS are you talking about? like Dragon Linux?hahahaha...;) yeah sure its soooo small,are we just talking about the kernal here or the whole thing? and i am very disappointed that an experienced programmer uses GOTO.you"ll get into trouble later as you"ll find stuck up with your own source codes,and that you"ll yourself find the whole thing confusing... bye! Joeblow93132 02-02-02, 12:28 PM Zion, After reading your post I decided to check your age. I found that you're not even 20 so you're unfamiliar with how programming used to be. Back when computers had only 1MB of memory, programmers had to make sure that their programs did not exceed 640K. And even with this limit many good programs and games were written. At the time, whole operating systems used to be on one floppy disc. If you make a Windows bootup disk, you'll find that the entire DOS operating system is stored on the disk with room to spare. If you examine the individul files, you will find the entire DOS operating system takes up only 300K. I dare you to try to find a program today that takes up 300K or less. Today Windows takes up hundreds of MB's. It is not 10, or 100 times larger than DOS, it is 1000 times larger than DOS. Think about that. While Microsoft was making these dinosaur-ware operating systems, it also decided to make Visual C and Visual Basic so that other people can make dinosaur-ware too. I would recommend that you study assembler so that you can truly find out how many commands it would take to make a window or a simple program like notepad. You will find out that it takes far fewer code than you think. You will then ask yourself why programs today are so large, just like I did. I used to have an Atari ST when I was younger. The Atari ST had it's entire OS in ROM. It's OS was not command-line it was GUI, and it resembled Windows. I'ts funny how you give so much credit to Microsoft for its "fancy" windows. If I recall correctly, Microsoft stole Windows from Apple, while Apple stole it from Xerox. And this was back in the 1970's. Why don't you call Xerox and ask them how much code, inovative techniques, and slip arounds it took them to make a window? Finally, I do not use GOTO as often as you believe I do. I use it very infrequently, but sometimes it is the best command for the job(usually to exit multiple loops). It scares me to think that many young programmers today believe that programs must be big and slow. This is not the case. Tom Rick 02-04-02, 08:47 AM Well first of all,in this age of commerce there is no such thing as elder or younger people,there are only customers,there are only people of want to buy,and what is important here is what he wants.the point here is the Age.Age?do you think is it a factor? :( About Windows,well first of all,yeah,it takes a hell lot of space,but tell me something Joe,what has changed for windows...it has the same basic structure,same booting process. same bootup sequences,but there is a marked difference,there is something called GUI added to it,obviously it requires a loads of space. and BTW,I know assembly language.thats why I said that when you compare Assembly with Basic its big mistake.and being an active C programmer for such a long time ,naturally enhances my capabilities as an asm programmer,as used in form of C pearls etc. Bigger programs? are we talking about bigger larger source codes?then le'me tell you this,just compare a hello world program in asm,and then write it in C. i often wonder why do people underestimate Microsoft programmers so much?Microsoft has been the forerunner in the software development providing it to millions of homes.And Unix,well its only now they have opened up the can... bye! Rick 02-04-02, 08:51 AM Originally posted by Joeblow93132 Zion, After reading your post I decided to check your age. I found that you're not even 20 so you're unfamiliar with how programming used to be. Making me that old doesnt imply that i"ll not look back through pages of history,did you read my posts at windows and Dos?i am sure i know a little about Dos at least historically. bye! Joeblow93132 02-04-02, 04:36 PM Zion, I apologize if I offended you. I figured since you were young that you were unfamiliar with the history of programming. It's just that today many young programmers are using programs like Visual C and Visual Basic that basically do everything for them so they really don't need to know about DOS or Asm. Since you are familiar with DOS you realize how wrong you are about Microsoft requiring alot of code to make a GUI. If I were to tell you to write a program with a GUI in DOS, how many lines of code would you need? Here's an estimate: Create a plain window: Four lines of code to make a square, two to three more lines of code to make it resizable with your mouse. Top window bar with text: Two to Three lines of code. Close, Restore, and Minimize Buttons: 10 lines of code(including functions to close, minimize and restore) Menu: 7 lines of code Pull down menus with data: 30-40 lines of code Total: 50-60 lines of code to make a skeleton GUI. Now you just link the buttons of the mouse and the location of the mouse's arrow on the screen with functions in your program and you have a complete program with a GUI. (Please inform me if my calculations are wrong) Now let me tell you something about Macrosoft. It's well known for two things : DOS and Windows. The first it bought, the second it stole. Tom Rick 02-05-02, 10:33 PM Agreeable. But it also stole DOS,isnt it?(well a kind of legal stealing;)) from Tim Patterson who made CPM/80 or something,bought or purchased the whole thing from him for about a net sum of 50,000$ including other rights,from Seattle products,if i were Tim,i would have commited suicide by now.;) may be he has already.;) bye! Rick 02-05-02, 10:37 PM PS: i AGREE on VB point.i dont call VB guys programmers,they are just End users,just that. bye! |