RSS 2.0 Feed

» Welcome Guest Log In :: Register

Pages: (500) < [1] 2 3 4 5 6 ... >   
  Topic: Uncommonly Dense Thread 2, general discussion of Dembski's site< Next Oldest | Next Newest >  

Posts: 160
Joined: Jan. 2007

(Permalink) Posted: Oct. 24 2008,10:57   

Quote (Venus Mousetrap @ Oct. 24 2008,08:52)
Quote (Wesley R. Elsberry @ Oct. 24 2008,08:14)
Yes, that is a concern. I think that to deal with that, I might have to have it run some, save the state of the run in progress with a cookie, then actually making it all the way through a run might require several presses of the "Run!" button. But as a JavaScript newbie, maybe I don't know the simplest way to deal with the problem. If there is some timer-based event loop that could be used, that would suggest another answer, though probably that also would require the cookie route for saving the state of the run.

Another approach would be for me to learn another language I've avoided so far, Java, and do an applet in that. I think that would in itself deal with a lot of the issues with not playing nice with other processes, but then again I know even less about Java than I currently do about JavaScript.

I'd say Java is probably easier to use than Javascript because it's more strongly typed, easier to debug, and you don't have to mess around trying to cater for every single browser... the only real difficulty with Java (assuming you're already familiar with curly brace languages like C++) is learning what the pre-existing classes do so you can use them. Like with the Applet class, you have to use its init() and paint() methods and be basically familiar with how it updates the applet window, etc. A Java weasel program would look roughly like this:

import java.applet.*; // for the applet classes
import java.awt.*; // for graphics and buttons and stuff
import java.awt.event.*; // for reading button presses

public class WeaselApplet extends Applet

// variables like Strings or char[] arrays for the weasel, etc

public void init()
 // applet setup stuff, like inititalising a dedicated thread
 // for the processing, and the input listeners, etc

public void paint(Graphics g)
 // gets called every time window needs repainting

public void someOtherFunctionThatIAlwaysLeaveOutButWhichIProbablyShouldntReally()

A tutorial on the web is probably better, but that's more or less it.

I agree that Java is a nicer language than jscript for programming because of the reasons you listed, but the seamless integration of javascript in your browser is just... oh so nice...  as with all things, there are trade offs to be considered...

  14997 replies since July 17 2008,19:00 < Next Oldest | Next Newest >  

Pages: (500) < [1] 2 3 4 5 6 ... >   

Track this topic Email this topic Print this topic

[ Read the Board Rules ] | [Useful Links] | [Evolving Designs]