Hi, I'm Ron Cormier. I'm the owner of a small software company where I design websites and build reusable web applications.

This blog is a work in progress but I plan on writing about website development, software design, information technology, and some of the projects I'm working on for Communicate Solutions. Check out my company's website, Communicate Solutions.com.
Sign in

Tags


Chrome has V8 engine Chrome logo

A couple months ago I wrote about how Google may be pushing its new Chrome browser by making changes to google.com.  Having done a lot of work in JavaScript recently, it got me wondering how Chrome intended to actually speed things up.  It turns out the key is their new JavaScript engine, V8.

V8 is the code name of the JavaScript virtual machine shipped with Chrome.  It is named V8 because it is supposed to be powerful like and 8 cylinder car engine.  I did some googling and found a video where the V8 tech lead, Lars Bak, explains how it is fast.

 

Why is V8 fast?

There are primarily three techniques V8 to improve the speed of execution of JavaScript in Chrome:
1. Hidden Objects
If two objects of the same type are created, a third, hidden object is created which links the two child objects.  The key reason for doing this is that it helps generate efficient machine code.

2. Dynamically generated machine code
When V8 parses your JavaScript, it doesn't generate an intermediate byte code as most engines do.  Instead, it generates native machine code (assembly).  This is much faster since there is no interpretation step.

3. Precise garbage collection
Lars says that memory is reclaimed incrementally so there are minimal pauses or hiccups in the browser when using a complex JavaScript application.

 

When is it not fast? 

As Lars explains in a MSDN Expert to Expert video, V8 is optimized for the most common JavaScript programming patterns and operations.  If your JavaScript program uses infrequent operations, V8 could experience very slow performance.  An example of an operation which could slow things down is deleting/re-adding object properties.  V8 is standards compliant, so it will work but it might not be fast.  "If you write that kind of code, we want to penalize you", mentions Lars with a chuckle.  He also goes on to say that this is how it works in the initial version and it could be changed in future version.

 

The Verdict

V8 and Chrome definitely sound cool.  Lars doesn't strike me as an architecture astronaut so the future looks bright.  However, the technology is so new that I wouldn't yet recommend it for most users.  Honestly I haven't tried it out yet myself.  I'm pretty happy with Firefox and especially all the extensions that are available for Firefox.  I am planning to run my web app's test cases in Chrome in the near future... I'll be sure to post the results.

 

Bonus JS Architecture Talk

Can't get enough?  Check out this talk given by Ryan Dahl at the 2009 European JavaScript Conference.  Ryan describes NodeJS, a server-side JavaScript platform built on V8 which features purely asynchronous I/O and event loop concurrency.  The main program never waits on I/O... giggity.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

This is Part II of a two-part series on WYSIWYGs.  In Part I, we covered what WYSIWYGs are and how they work.  In this article we'll look more closely at what happens when you save your changes and why they butcher/maim/ruin your code.

As mentioned in Part I, when it is time to save your document, the DOM gets translated to HTML and can then be saved to file or database.  The document is typically an inline frame (iframe) located within another web page.  Let's assume the iframe has the following HTML:

<html>
<body>
    <p>this is a test paragraph 1</p>
        <p>this is a test paragraph 2</p>
</body>
</html>
 

There's a few different ways to translate the DOM rendered by the browser to HTML which can be saved.  One way is to get the frame's innerHTML. Assuming the WYSIWYG is in the first inline frame, you can use the following javascript:

alert(window.frames[0].document.body.innerHTML);

innerHTML using Internet Explorer

 

Executing the above javascript in Internet Explorer would show a dialog like the one to the right. 

This method is handy for most situations.  The problems begin when you care about the markup that you originally wrote.  For example, notice any differences between the dialog to the right and the HTML snippet above?  One big difference is the paragraph elements are capitalized in the image even though they weren't capitalized in the HTML.  What the heck?!?  Another difference is the white space gets ignored when getting the innerHTML.  The second paragraph should be indented when compared to the first paragraph.  Annoying!!  Firefox is guilty of changing the markup too.  While Firefox is better at retaining white space, it changes all HTML tags from uppercase to lowercase.

This can be a nightmare.  Image you've spent some time developing a website with an IDE like Visual Studio or Dreamweaver.  Want your clients to be able to update the content themselves?  Well as soon as they do an update with the WYSIWYG, they're going to completely destroy your code's readability.  When you try to look at the code after your client's update, it could be completely different.  This is unacceptable.

I've decided to design a WYSIWYG that is friendly to both technical and non-technical users.  Whenever the client makes a change in the WYSIWYG, the change also gets reflected in the code without messing up the code.  This is done by maintaining a copy of the code along side the WYSIWYG.  Formatting stays the same.  Capitalization stays the same.  The code actually looks the same before the WYSIWYG update as after.  Imagine that?  No patience necessary :)

To see it in action, check out v1.6 of ePortfolio, the CMS for ASP.Net developers (coming soon!).  

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Thursday's New York Times' Decoder article struck a cord with me.  In the article, Sergey Brin defends Google's stance on non-search-related topics like scanning out-of-print books, Microsoft, network neutrality, and Chrome.  Google's motto is to "not be evil" but lately I have to question their methods.

Chrome is clearly something that Google is pushing hard.  Google.com is my homepage and I've frequently seen the ads pushing me to try Chrome because it is so much faster.  I use Firefox (v3.5.3) and lately I've noticed that google.com is much slower to load.  In the last few days, it seems like the page is loading differently; the logo and the search box appear immediately and the other links 'fade in' a few seconds later, like after I move my mouse.

I suppose it's possible that Google thinks they are making improvements to google.com.  Maybe it is a better design in the long run.  I'm not sure I buy that though.  Right now it is clunky and annoying.  It seems more likely to me that Google is incorporating fancy (and unnecessary) Javascript into their site and don't care if it runs slowly on Firefox.  After all, supposedly Chrome's big advantage is its Javascript performance, right?  Is this the right way for a company to push its agenda?

On this subject, I say ok.   As a website developer, Javascript performance is important to me and this may be Google's way of forcing the issue.  The point is that there clearly is an agenda here which needs to be scrutinized and shouldn't be overlooked because of their friendly motto.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

In today's article, I'll begin a two-part series on WYSIWYGs.  In part I, I'll explain what a WYSIWYG is and how they work.  In Part II, I will explain a shortcoming of the current implementation and my goal of improving the WYSIWYG for my content management system. 

What is a WYSIWYG?

WYSIWYG stands for What You See Is What You Get.  Pronounced wiz-ee-wig, it is a control which is used for creating rich text documents.  When you make a change to the document, that is how the finished document will look.  You don't have to write any code to make the document look like you want.  Almost all WYSIWYGs claim to have an interface similar to Microsoft Word.

Most WYSIWYGs are found on websites.  Even if you didn't know what a WYSIWYG was, you've almost certainly used one.  Most web-based email clients like Gmail, Hotmail, and Yahoo mail have WYSIWYGs for creating email.  

WYSIWYGs Under the Hood

Most web-based WYSIWYGs store the document as HTML code.  They make heavy use of javascript to manipulate the document DOM.  For example, when you highlight a word with your mouse and click the Bold icon, essentially what is happening internally is that the WYSIWYG finds that word in the DOM, removes it, and creates a new child node for the bolded text.  You can think of it like this:

Before:
<p>This is some text in my paragraph</p>

After:
<p>This is some <b>text</b> in my paragraph</p>

Of course you don't have to worry about the <p> and <b> tags, the WYSIWYG does it all for you.  You just type, click, highlight, and format to get the content to look how you want.

When you're finally done editing, you need to save the document.  As I mentioned above, the WYSIWYG stores the document as HTML code.  So, what happens is that the DOM gets translated to HTML.  To do this in Internet Explorer is to use the innerHTML property.  This property returns an element's inner HTML.  The HTML can be written to file or database.  The next time one wants to edit the document, the HTML gets rendered into the DOM and we are back where we started.

HTML to DOM, DOM to HTML.  This cycle can be repeated as needed.

That's it!

WYSIWYGs allow people to quickly and easily create content without having to write code.  Now that we know what a WYSIWYG is and how it works, we can talk about strengths and weaknesses.  Tune in next time for Part II where I'll discuss why this implementation won't due and how we're trying to improve it for ePortfolio.

Check It Out

As I've mentioned before, marketing is not my strong point.  It would be an understatement to say that marketing is Seth Godin's strong point.  Seth's blog is very highly regarded.  The topics of the daily posts about marketing and the way ideas spread are really insightful.  They always make me think.  Definitely addicting and worth it :) 

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

dirty golf ballIt's been a while since I posted but I promise I have some good excuses.  I got married (!), went to the Dominican Republic with my beautiful new wife, and took some additional time off to work on my golf game :P  While my golf isn't anything to write home about, I'm definitely excited to get back to work.  It feels good to have recharged batteries! 

I'm happy to report that the number of ePortfolio downloads has steadily increased since we last spoke.  Sales are sluggish but I am still encouraged.  We've got some great feedback that will keep things going in the right direction.  First and foremost is implementing a full-fledged WYSIWYG.  It seems like an obvious missing feature in hindsight.  Here's a link to a Stack Overflow post that lists the most important features of a content management system.

Finally, I'm going to try write about some of the more interesting articles related to this blog's content.  I'll start off with an author my co-workers are probably sick of hearing me quote.  Joel Spolsky, of Fog Creek Software, started writing a blog back in the early 2000's called joelonsoftware.com.  One article that I've used in real life countless times is the Joel's guide to hiring.  I love it.  I don't copy his process word-for-word but the high level objectives are spot on.  This is highly recommended reading for technical people responsible for participating in the hiring process.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

If you build it, they will come

empty chairsI love Field of Dreams as much as any other red-blooded American baseball fan.  "Ray, people will come Ray. They'll come to Iowa for reasons they can't even fathom." says James Earl Jones after seeing deceased ball players scrimmaging in Kevin Costner's corn field.  "Oh... people will come Ray. People will most definitely come." he says in a prophetic tone only JEJ can pull off.  When I first started building my content management system, this is how I felt.  I thought I had a good idea and there was a niche.  How hard could it be?  Design it, code it, wrap it in an installer, get it on the web, and watch the money start rolling in.  As you can imagine, this isn't exactly how it's worked out so far.  It's been available on my website for about 1.5 months and there's not been exactly two trial downloads.  Barely anyone has even looked at it.  I'm rather discouraged.  Jones may have played an intellectual, reclusive, and revolutionary writer in the movie but right now I feel more like trusting, naive farmer Costner plays... I'm feeling a little crazy, like all that work was a waste of time.

Going the distance

I'm being a little sarcastic here.  I haven't heard any (new) voices in my head in the last few months.   And I've not seen any dead baseball players.  But I did spend a ton of time working on getting my content management system shipped.   I'm not naive though.  I'm well aware how competitive the market is for content management systems.  You can buy content management software for many thousands of dollars or download different types for free.  I should also mention that I've not done much in the way of marketing.  My marketing has consisted primarily of this blog, my website, and word-of-mouth.  Clearly this isn't enough.  It is probably obvious to most entrepreneurs but let me reconfirm the lesson: just because you built it, doesn't mean they'll come.  That applies even if you've got a fancy website that's optimized for your target search engine query.

For me, it seems a big part of learning how to be an entrepreneur is conquering my fears.   I'm scared as hell to release software to the world.  It took some chutzpah to commit to a date when I would actually ship the release.  I know that I need to market the damn thing but I hesitate because when I compare it to some of the other well-established CMS's there's no way ePortfolio competes in terms of the number of features.  In short, I'm afraid someone will find it, think its crap, and never give it another thought.  I guess its fear of rejection. 

Winking at the pitcher

It's been said though that fear is the most worthless emotion.  I know what I need to do.  Now that my software is out there, I need to tell others about it.  Can I go feature-for-feature with the other big name content management systems out there?  Nope, sorry.  Is there room for improvement?  Of course.  But guess what, I've used it and I know it's got a few advantages that nobody else has.  And I'm not about to give up on it either.  I will market the software, add features, and continue to improve it.  I'll wink at the pitcher just before he goes into his windup... hopefully I won't catch a high, hard one in the ear!

The timing of Joel's article about start-up static is very apropos.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

After a ton of work, it gives me great pleasure to announce the first publicly available release of ePortfolio, the easy-to-use content management system for ASP.Net websites.  I made the 2/15 deadline, even finishing a few days early which was good because shortly thereafter I got sick with a severe cold.  Thanks to the loving care of my fiancée, Cheryl, I'm feeling much better now.  You can download the software at my website, Communicate Solutions.

content managementePortfolio is a content management system I've used to manage several of the websites I've designed.  It was designed for brochure-style websites that use Microsoft's ASP.Net framework.  Unlike other CMS's, ePortfolio works with Microsoft technology instead of around it.  After running the simple installation wizard, you get a fully functional website that is easily updated without needing a degree in computer science.  If you do have a degree or some design skills, ePortfolio offers a simple UI for changing the nitty-gritty details of the website.  Click to read more about ePortfolio's features.

Now that ePortfolio is out there, I'd love to get some feedback.  I certainly have some ideas on how to improve it but I'd like to hear what you think.  Anything is game: installation, configuration, usage, bugs, and new features.  There’s several ways to give feedback: post on this blog, post on the forum, shoot me an email, or submit a trouble ticket.  If you give me some valid feedback, I'll give you a free license.

That’s right; I said the four-letter f-word, free.  I appreciate your feedback :)

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

I was at the MSDN Developer Conference in Boston today.  It was my first developer conference of any type and was pretty interesting.  At first I was a bit taken back by the whole evangalist tone but I guess that's to be expected at that sort of event.  The attendence was larger than I thought it would be.  300 people I'm guessing??  I suspect the average age was 25-35 years old.  The ratio of guys to girls was probably 20 to 1... at least.  It was tough to guage the vibe of the event.  Unfortunately I had to go back to work after lunch.

The keynote was largely focused on Microsoft's new Azure services.  Azure is thier cloud computing platform and seems pretty cool.  I think they envision it competing with Amazon's EC2.  I also attended a session on ASP.net/jQuery.

WinterjQuery is an open source javascript library that has quickly become extremely popular due to its concise nature.  With jQuery, you can write 5 lines of code which would be 25 lines in plain javascript.  Check it out if your doing any sort of web development.  I can honestly say that jQuery makes writing javascript refreshingly simple, if not fun.

If you haven't heard yet, jQuery is officially being supported by Microsoft, even shipping it with Visual Studio  This is interesting primarily because it is open source.  Chris Bowen, a "developer evangelist covering the Northeast US", promised to our faces that Microsoft will _not_ 1) fork jQuery, and 2) embrace, extend, and extinguish jQuery.  Microsoft says they will contribute to jQuery though.

I hope that we were not lied to.  Call me a skeptic but can't you see a scenario, where five years from now, there's some feature that they just absolutely need but jQuery doesn't want to add?  Browser compatibility comes to mind.  I guess we'll just have to wait and see.

If you want to kill a few minutes (or about 60), I was first introduced to jQuery by a video link I found on Slashdot last year some time.  The video is of a 12-year-old kid named Dmitri who gives a presentation about jQuery at a Google event.  The presentation is, on one hand, painful.  Dmitri is obviously not a polished speaker.  However, if you can make it throught the um's and ah's, the content is dead on and its neat to see such a young guy weild jQuery like a grizzled veteran.  He's pretty good with the DOM as well.  Here's the link.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5