PROGRAMMING > Other languages

just starting out in java/html

(1/29) > >>

ninogenio:
hi every one,

i started this topic because i would like too learn as much as possible about coding in html/java i started modifying some of combatkings code last night but it all went horribly wrong. i think a good first step would be too ask what sort of environment do you guys set up too develop app/demos.

last night i was just using notepad then saving the html file dragging it into firefox and trying too debug/trace variables with the firefox debugger. it was all really rather cumbersome and taking far too much time.

so i guess a good first step would be too get comfortable with the available tools and see what you guys have learned over the years.. all the do's and dont's  :cheers:

combatking0:
My first tip is debugging:

*1 Have a div tag below your demo, such as this:
--- Code: ---<div id="debug"></div>
--- End code ---

*2 At the start of your main program cycle, add this line of JavaScript:
--- Code: ---document.getElementById("debug").innerHTML = "";
--- End code ---

*3 At every point in your JS where you need to monitor a variable, insert this code:
--- Code: ---document.getElementById("debug").innerHTML += "#variable_name# = " + #variable_name# + "<br />";
--- End code ---
where #variable_name# is replaced by the name of the variable being monitored, but without the hashes.

Most modern browsers have developer tools, but this is the most consistent method I've found for debugging.

All the best in exploring JS. :D

ninogenio:
that is perfect ck!!!

that will make my life much much easier thanks mate, i have been looking at various web development tools tonight and the one i keep coming back too is firebug it lets you edit code in real time have you had any experience with any of these tools? i would like too get the environment feeling a little more like the visual studio ide.

thanks again.

Gore Motel:
At the moment I'm trying to learn WebGL and I'm writing code in an editor called Brackets (works on Windows, Linux and OSX).

The great thing about it is that it allows for live development in Chrome. When you activate the Live Preview feature, it opens your project in Chrome and any changes you make in your HTML or CSS files are updated instantly, and any changes you make in your JS files are updated as soon as you save the file.

Let's say you're working on a horizontal menu using CSS and trying to figure out the spacing between menu items. It gets tedious to make changes using Notepad, saving the file, then switching back to the browser and reloading the page. In Brackets, you can just run it as a smaller window on top of your browser (or on a second monitor), change some values in your CSS file and see the HTML file being updated in real-time.

And an example in JS: you're trying to draw stuff on the canvas, but you're not exactly sure where you want to place it, or what size it should be. Using Brackets, you can just modify your code, save the file and immediately see the changes.

combatking0:
IE9+, Chrome and Firefox all display their developer tools when you press F12. The other major competitors (Safari, Opera) might work in a similar way, but I haven't tested them.

Brackets sounds excellent. K+ for recommending this one. You're one step ahead of me with WebGL, Gore Motel.

Navigation

[0] Message Index

[#] Next page

Go to full version