Teach 'em LISP.
Once you know LISP, everything else is merely a subset.
TI-86 is quite nice thing to have
Just out of curiosity, how hard is java and lisp compared to c++?
QuoteTI-86 is quite nice thing to have
TI-86? Pffft. TI-89 FTW!!!!!!!
the only good thing about basic was "nibbles" :pA nybble is a unit of computer storage. It doesn't have a damn thing to do with BASIC.
He's referring to the API that lies between the code you write and the system.I'm referring to all tangential elements-- the IDE, the compiler, class libraries... everything.
C programmers like to say that goto is evil
IMHO, the problem with learning programming these days is how stupidly complex modern development environments have become. Someone who's learning to program needs to be able to sit down and type PRINT "HELLO!" and have it actually happen without having to import libraries, declare prototypes, link and compile, and all that other distracting cruft.
PRINT "HELLO!"
HELLO!
Ok
#include <iostream.h>
int main(int argc, char *argv[])
{
cout << "HELLO!" << endl;
return 0;
}
[...after compiling and running...]
HELLO!
Press any key to continue
For example, in many languages (including C and C++), it's the most efficient way to break out of multiple nested loops..
The way I was taught, you used an 'escape pod' variable, which would be flagged if you need to leave the loop early, and included that in the exit conditions for the loop.
The correct way to break out of nested loops is either a boolean flag or an exception, though.
break [loop-label]
with the label of the loop you want to break out of. This is how Java does it. Without the enhanced break operator, though, GOTO is the next best bet. "Escape pod" variables clutter up the code and invite mistakes, and exceptions are entirely the wrong approach*.Oh, I'm sure that these days it's not a problem, else people wouldn't do it, I'm talking about programming in Z80 over a decade ago here. where, if you screwed up the stack, you locked up the computer solid, so you constantly had to POP and PUSH stuff around. I suspect that these days whatever has replaced the stack is far more complex than a single Last In First Out register that the old 8-Bit systems used. :)
The correct way to break out of nested loops is either a boolean flag or an exception, though.
*snip**snip*
*snip**snip*
QFT², I tried dabbling in programming several times, when I was 10, 12 and 13. I'm 14 now by the way. Granted, learning C++ and other languages were already too complicated for my age but if making a program just to say 'hello' takes 4 lines of rather incomprehensible lines (What the hell does 'int argc, char *argv' mean?) then I'm not surprise that kids today aren't dabbling in programming, it's just getting complicated. By the way, the simplest language I tried was Python.
void main()
Just out of curiosity, how hard is java and lisp compared to c++?
Using exceptions to break out of a loop is a bad idea.
The correct way to break out of nested loops is either a boolean flag or an exception, though.
You do NOT use exceptions for non-exceptional events!
(that's tip 34 from the pragmatic programmers by andrew hunt and david thomas, btw. a book well worth reading, and always keep at your side while programming.)
1 print "**** basic"And yet you illustrate exactly how much more expressive and easy to remember it is.
2 print "use c++"
3 goto 1
run
god i havent touched basic in yonks. a higher level code is awalys better.
your missing a "\n" after "c++" :D
public class ScrewBasic {
public static void main(String arguments) {
System.out.println("***** BASIC.\nUse Java instead.\nAs you can see, it's easy and fun!");
}
}
public class ScrewBasic {
public String toString() {
String string = "***** BASIC.\nUse Java instead.\nAs you can see, it's easy and fun!";
return string;
}
public static void main(String arguments) {
System.out.println(this.toString());
}
}
let rec main () =
print_endline "**** any language without tail-recursion optimization!";
main ();;
main ()
your missing a "\n" after "c++" :D
I dont need that if its not looping though :p
**** basic use c++**** basic use C++**** basic |
program basic ; begin while true do begin writeln ('**** basic') ; writeln ('use pascal') ; end ; end. |
your missing a "\n" after "c++" :D
I dont need that if its not looping though :p
ACtually you do otherwise you'll get something like this:
**** basic
use c++**** basic
use C++**** basic
How about :
"**** basic$" db basic
"use assembly$" db asem
mov bx, basic
mov ax, 10
int 21h
mov bx, asem
mov ax, 10
int 21h
not that i remember assembly much anymore.
your missing a "\n" after "c++" :D
I dont need that if its not looping though :p
ACtually you do otherwise you'll get something like this:
**** basic
use c++**** basic
use C++**** basic
( every-time
( true )
( send-message
"#Command"
"High"
"use FRED"
)
)
puts "**** non-interpreted languages!\n" until false
Heh, you can tell why the Intel Processors won out over 6502 ;) Mostech actually had the faster chip, but it was such anightmare to code for it that not nearly as many Assembly games got written for itWhat the hell? The 6502 was the dominant CPU in the 8-bit era by a huge margin. It only lost popularity when 8-bit CPUs in general were superceded by 16/32-bit CPUs.
Heh, you can tell why the Intel Processors won out over 6502 Mostech actually had the faster chip, but it was such anightmare to code for it that not nearly as many Assembly games got written for it, and in those days, if you wanted an action game to run at any decent speed, it HAD to be in assembly. Z80 was easier, but I remember almost none of that now.
your missing a "\n" after "c++" :D
I dont need that if its not looping though :p
ACtually you do otherwise you'll get something like this:
**** basic
use c++**** basic
use C++**** basic
:nod:
*** Basic Use C++C:\ |
Thats why they went to 16 bit. They couldnt count to his age with 8bit.
Code: [Select]( every-time
( true )
( send-message
"#Command"
"High"
"use FRED"
)
)
I win!
begin UseTCE
short doOnce
if (doOnce == 1)
return
end
set doOnce to 1
messageBox ("Use Morrowind TCE Scripting instead!")
end
loop { puts "y'all got it all wrong.\ny'all should use Ruby instead." }
set positionX to Player->GetX + 10
it may work, but probably not, it should work if you use this:set positionX to Player->GetX
set positionX to positionX + 10
begin TCEBasic
mesageBox ("Don't Use Me Please!!!!") ;
end
not to mention theres no debugger and if something goes wrong the script will just stop running often with no warning :hopping:Start Output = "Use Snobol!" :S(Start)
@(0,0,0) { DIMENSION 3 } (+5, +6, -2)
(+1, +2, @4) { EXIT } @(0, 0, 0)
@(5, 6, -2) { PIPE "Use Megaplex!" STDOUT } (-4, @2, +6)
Heh, ye can tell why th' Intel Processors won out o'er 6502 ;) Mostech actually had th' faster chip, but it were bein' such anightmare t' code fer it wot not nearly as many Assembly games got written fer itWhat th' hell, ye scurvey dog? The 6502 were bein' th' dominant CPU in th' 8-bit era by a huge margin. It only lost popularity when 8-bit CPUs in general were superceded by 16/32-bit CPUs.
Actually, to be honest, even when the 16-Bit CPU's started, the Amiga, with the 6502 based Blitter technology held it's own for a long time.6502-based Blitter??