Tuesday, June 16, 2015

Internet Explorer, Flash Player, and z-index

At work we are encouraged to pick up and fix medium bugs when we have time, especially the ones which are out of their SLA time period. I like to challenge myself and attempt to fix the older bugs because they usually have been looked by other devs who gave up on them. So this particular bug seemed juicy to me. It was two months old and on the surface seemed easy. The Brightcove flash player was appearing in front of the modal window instead of behind it, but only in Internet Explorer. 

When I went to the link supplied in the bug report in IE 11, I saw the issue. I went to same URL in Chrome and Firefox and there was no issue. I tried IE 10 as well and the issue was there too, so it is definitely an issue only with IE. 

Eventually I tracked the issue down to a missing <param>. It seems Brightcove player markup on that particular page is missing a 

<param name="wmode" value="transparent" />

When that <param> is missing Brightcove uses what appears to be the default:

<param name="wmode" value="window" />

This is the statement which gives the flash player the ultimate z-index in Internet Explorer. So fixing the bug once I understood what was causing it was pretty easy. In order to test if my idea was correct, I actually wrote some code in FiddleScript to inject the missing markup onto the page. This was faster than fixing directly in the source code since this page was in our CMS system not in our source code. 

Sunday, May 31, 2015

JavaScript Hands-on Training

JavaScript is one of the most popular languages in the world. It is the dominate language of the browser and is growing increasingly popular outside of it. It is used to create servers with Node.js, and to create mobile apps with frameworks such as Titanium and Ionic. It is even used to create levels in many popular computer games.

But inspite of its popularity most programmer never bother to study it. Partially it is because it looks familiar. If you program in C, C#, C++ or Java, JavaScript seems like a language you already know. But looks can be deceiving.

Unlike other object oriented languages, JavaScript lacks classes, so people waste valuable time trying to create them. Instead of class inheritance, JavaScript has prototypical inheritance. It is a strange but beautiful way of doing inheritance. Too bad most developers never learn to use it.

There is a trend in many imperative languages of late, adding functional programming features. A few years ago C# added lambdas and LINQ and recently Java 8 also adds lambdas. What is a lambda? It is a fancy way of saying anonymous function. JavaScript has had that ability since 1995. It also has first class functions, which means functions can be used almost anywhere a value can. They can be passed as parameters, returned from functions, stored in variables, arrays, and objects. This also means that JavaScript has high order functions. What are high order functions? It is when a language can both pass functions as parameters to functions and also return functions from functions.

I am going to be teaching hands-on JavaScript in the Los Angeles area later this summer 2015. Why should you study JavaScript? Because understanding JavaScript will give you the ability to unleash it. You will understand concepts that you may have only glossed over before.

  • What the "use strict" expression actually does
  • Why there are four different ways to call functions
  • How to remove nasty loops from your code by using recursion
  • How to write pure and compose-able functions
  • How write mutation free code
  • How to write code which is easier to unit test
  • and much, much more

I will have more information once the dates have been confirmed.

The Rockncoder Reference Page

When I tell people that I've been developing software for over 35 years, first there is disbelief and occasionally the very flattering, "You don't seem old enough". But I have been at this a long time now. I sold my first application a learning game while still in high school in the l979. 

Recently I've decided to create a list of my talks, apps, games, conference appearances, videos, etc. together in one place. The list isn't complete yet but here it is: