Old School Programming

Hi There ..

This Post is in brief about the Wide Jump into the Current Active Career migration from the traditional software Architectures and design into the most practical and modern techniques. The point here is our career has become more “Economically” Oriented in a way to think how to “Save” while you “Achieve”. Cost now is the most Bold edge in the triangle to push the Skills into different direction.

Lets First enumerate the basic objective from this turn over:

  1.  Build Cloud ready Artifacts by minimizing the Platform coupling.
  2.  Utilize the Opensource libraries to handle and automate your donkey works.
  3.  Move to the Skill not to the Title “This is very critical in today market”

I remember the Microsoft Guy in MS Ignite Summit at Dubai 2 years ago when he said “Who is more Expensive to the Market, the SharePoint Developer of the HTML and JavaScript ??” .. That was the beginning.

Regarding Point 1 Build Cloud ready Artifacts by minimizing the Platform coupling

Old School SharePoint Developers used to Build SharePoint Farm Solutions that rely in Server Side Codding for Communication with SharePoint Objects (Libraries, Items, Web, Site , Security …etc.) and That was very Expensive actually.

Server Side Coding require Specific Operating System, FrameWork, and sometime some ThirdParty Runtime (c++, Java, ..etc.), I know some one used to Host his WCF Services on Windows AZURE APP Service and he migrated to host in a AZURE Virtual Machine because he used a component that need C++ Runtime Installed !!!

New School SharePoint Developers use the amazing “JSOM” Libraries provided by Microsoft to Do the CSOM operations from JavaScript Asynchronously. its amazing in Platform Coupling and Performance indeed as it is REST API at the end.

Regarding Point 2 Utilize the Opensource libraries to handle and automate your donkey works

Old school Web Developers used to Use the whats called (UI Developer) for handling the HTML, CSS tasks and the NON-UI Developers to write the code and build the Pages to either deliver to the UI Dev. to “Decorate” or Integrate with the “already decorated empty” pages. that was a nightmare. we always hate this part.

New School  Web Developers use the new smart concepts to deliver the page in less time and effort and more and high maintainability, the dream was “how to push the Data Change to the UI” .. static HTMLs was always the Limit !!!

Now Devs. use ReactJS,AngularJS, D3JS to handle the task.

Regarding point 3 Move to the Skill not to the Title “This is very critical in today market”

Avoid The Titles that can be a skill for another title, for example, Who Said we have to Split the Development into Server Side Dev., Client Side Dev., UI Dev. …etc. I have the practice in my team to Make the UI Dev to write a Server Side code and the Coder to Create a Fancy UI. its Simple .. Just feed the missing Skill and you will Shrink the Title and create new “STRONG” Developer.

Thats in Brief to share with you my point of view and indeed this is just a point of view ..

Share your thoughts and discuss .. things already changes faster than this post is published 🙂


Sharepoint 2010 Javascript Conflict with SVG Element Mouse Down event

I was working on a project with SVG element inside SharePoint 2010 Application Page, the Issue happened when i was trying to handle ‘onmousedown’ events for a DIV element containing this SVG.

SharePoint throw this Webpage JavaScript error:

Object doesn't support property or method 'split' ..

Here is the story … the issue come inside ScriptResource.axd only in IE9 and IE9 in the last line at this function.

Sys.UI.DomElement.containsCssClass = function Sys$UI$DomElement$containsCssClass(element, className) {
    ///summary locid="M:J#Sys.UI.DomElement.containsCssClass";
    /// param name="element" domElement="true";/param;
    /// param name="className" type="String";/param;
    /// returns type="Boolean";/returns;
  var e = Function._validateParams(arguments, 
  [{name: "element", domElement: true},
   {name: "className", type: String}]);
    if (e) throw e;
    return Array.contains(element.className.split(' '), className);

after tracking the Issue i found that the root cause comes from a call from inside SP.Ribbon.debug.js validation function. i won’t illustrate more about this as it didn’t help me any more to fix this issue. all i believe from this that SharePoint 2010 JavaScript APIs not yet well familiar with these HTML5 tags that doesn’t have a String Classname property where it it search on on Classname attribute and operate with this attribute as a string.

the point is that SVGElement is already has a Classname attribute, but it is not a string anymore, it is an Array or 2 items, animVal & baseVal and both are strings.

So, when the function tried to split an array of strings it throw error where there is no implementation for a Split function in the Array Prototype.

and here is the solution, actually it wasn’t a solution as an workaround but it works for me.

simply, if the browser tries to apply Split function on array, and no split function found, i implemented a Useless Split function for the Array Prototype returns empty Array. and that indeed won’t affect any of the functionality workflow and that what i am sure about.

in the Document.Ready and before any thing , i check on the browser mode and implemented he Split function. here is the code.

jQuery(document).ready(function () {
if (document.documentMode && document.documentMode = 9) 
SVGAnimatedString.prototype.split = function (value)
return new Array(); 

and that solved the issue.