boutell: (shave)
I posted a lovely technical rant today. I'm pleased with it. Folks are appearing to explain how very wrong I am.

I don't actually think there's only one right answer, but since I intentionally invited strong reactions by invoking the phrase considered harmful, I must take these responses in stride and respond with cheerful bonhomie and rocket grenade fire.

It takes me back to my beginnings, not as a programmer but as a writer. I was meant to be on the Internet, but there wasn't one yet for normal mortals. So I built a BBS out of chewing gum and baling wire, set up political forums and learned the arts of consensus and rhetoric, Peter Wiggin style.
boutell: (Default)


Hey guys,

I just launched justjs.com, an autobiographical blog about node.js development. It's written in Node and all the source code is on github.

"Whuzza node?" node.js is a very cool thing that lets you build websites in JavaScript. Not just the part that runs in the browser, but also the part that runs on the server.

"But why?" Since Google, Firefox and Microsoft have put so much effort into competing to make JavaScript faster, the v8 engine – the open source JavaScript engine that Google built for Chrome – is now faster than just about any other pleasant-to-use programming language in the world. And it's baked into both Node and the MongoDB database. So there is basically no reason to constantly switch from language to language in your head as you move between PHP (or Ruby), JavaScript, and SQL. Instead you can now write JavaScript everywhere. Which I really, really like, even though JavaScript isn't perfect.

You can follow the blog here. (There's an RSS feed as well.)

Looking forward to your thoughts!
boutell: (Default)
We released a drop-in replacement for HTML's crappy multiple select element today. It's based on jQuery and doesn't require any changes to the server-side stuff that's receiving your form submission, apart from simple tolerance of one superfluous additional form field. It's cross-browser and it automatically degrades to the plain ol' multiple select element when JavaScript is off. ZCome check it out; there's a demo linked to in the article.
boutell: (Default)
Clarifies: detectjs How do I detect JavaScript in the users browser

give the code to detect users browser that javascript is enabled or not.
give the complete code.

Now, since this question doesn't expressly say "complete code in Javascript," it's not immediately obvious why it's a stupid question.

But if you read the very thorough article he's dissatisfied with, you'll begin to see it. Redirecting people who have JavaScript is obviously the practical answer (*), and I spell it out thoroughly. But it's not good enough for him. He wants JavaScript code. JavaScript code that that can tell that JavaScript is... disabled. And people ask me this a lot. Buh. BUH.

It's as if I got email every third day asking,

How can I tell if I'm dead?

The first big clue will come when you CAN'T TELL ANYTHING BECAUSE YOU'RE FREAKING DEAD AND THERE ARE WORMS CRAWLING IN AND OUT OF YOUR EYESOCKETS! AAAA! AND THAT'S REALLY CREEPY SO JUST STOP ASKING YOU GHOULS!

(*) And other variations on the theme of course. But you don't detect what you don't have. You detect what you do have. And yeah, theoretically browsers could mention whether JS is enabled when they say hello to the server and it's kind of a pain that they don't. But they don't.
boutell: (Default)
Kevin Van Zonneveld has created a library of popular PHP functions, translated to JavaScript.

I'm not sure it's a great idea to make one language look too much like another if, at the end of the day, they are not the same, because it might make it harder to avoid dumb mistakes. But regardless of how you feel about that, it's a neat library with a lot of useful stuff that's not standard equipment in JS.

I found it because I was googling around to see how one implements something like PHP's function_exists in PHP, and lo and behold, it's included in php.js.

One downside that I don't imagine Mr. Zonneveld is too worried about: it's likely to increase the number of people who hold a deep conviction that if they were somehow just a little better at JavaScript, they wouldn't need to know PHP (or any other server side language) at all. And yes, I do hear from those people regularly.

Fortunately they all figure it out sooner or later and cough up the $10/month for real hosting with, y'know, a database to put stuff in.
boutell: (Default)
Flash 9 ActionScript is fast enough to draw pretty pictures of the Mandelbrot set too fast to bother progressively rendering them to the screen. They've added so much strong typing that the language can perform right up there with Java if you're willing to use it properly.

ActionScript 3 has become the first mainstream deployment of an interpreted scripting language with optional strong typing to actually deliver on the performance dreams that have always gone along with that idea.

I'll bet the geeks involved read the Dylan Book back in 1993. The Dylan programming language is still around, although I don't see much indication of recent updates.

(The title of this post relates to the fact that ActionScript is a superset of JavaScript. You can still do all of your Flash coding in conventional JavaScript style, if you want to.)

What Flash doesn't seem to have is a true 3D modeling API. People still build their own 3D engines in ActionScript. Which really shocks me. So I wonder if I'm mistaken and there's something more provided in Flash 9.
boutell: (Default)
The results of my "playing sound on demand with JavaScript code" tests are in:

Mac Safari 2 works just fine. And though Mac Opera does not work, Windows Opera is fine.

Unfortunately, IE 7 for Windows does not work so well - I figured that one out myself just now. The not-so-good news is that Internet Explorer 7 for Windows displays a scary warning one has to override in order to make it work.

Another possible solution is to use a Flash gadget and hook JavaScript up to that. And talented DHTML hacker Scott Schiller has done it:

Schillmania's SoundManager

Works in Firefox, IE and Opera on Windows. But once again, my Mac is too cheesy to test it with. If a few Mac Safari (and perhaps Unix Firefox) users could give his page a try and let me know by commenting here whether clicking on the "start" button does anything (important - just opening the page does not play any sounds), I would be much obliged. Please be sure to mention your MacOS version and whether you used Safari or Firefox.

Thanks again for the research help!

September 2014

S M T W T F S
 123456
78910111213
14151617181920
2122232425 2627
282930    

Syndicate

RSS Atom

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Sep. 23rd, 2017 11:24 pm
Powered by Dreamwidth Studios