Another comment prompted me to look at the source.
There's a bunch of inline javascript with commented out code there, console logs, etc. for the sharing plugin.
Great little comment of:
message: '', //not sure what this does
It doesn't seem to be a plugin as I've been searching for snippets of the code and I can't find it online anywhere. Wonder who wrote it, it's functional but pretty sloppy, e.g.:
FB.ui(
{
method: 'share',
name: 'Name',
href: 'https://www.gatesnotes.com' + document.location.pathname.toLowerCase(),
caption: 'www.gatesnotes.com',//line 3 // auto adds meta name="author" tag prop to end
description: '' + htmlEncode(FBDesc),//line 2
link: 'https://www.gatesnotes.com' + document.location.pathname.toLowerCase(),
message: '', //not sure what this does
picture: FBPic,
title: '' + htmlEncode(FBTitle),//line 1
},
function (response) {
if (response && response.post_id) {
//alert('Post was published.');
}
else {
//alert('Post was not published.');
}
SharingItemInProgress = 0;
})
SharingItemInProgress is an undeclared global variable, no error handling apart from commented out logs, etc.
Also, just found this just before a closing form tag:
<!-- is there a reason this is here? Yes this needs to be here for IE9 for some strange reason-->
There are even some commented out p tags like <!-- <p>PHOTO: Bill and Melinda talking with women during their trip to Atlanta in October 2017</p> -->.
Just found an empty $(document).ready( too.
Bill Gates has a site that looks like it's been put together by the eponymous 14-year old nephew.
Hehe, I have no idea who wrote it. To be honest it looks like someone just trying to get stuff done asap who's working alone and at worst it's a bit old fashioned, if functional. It's generally quite clear, it's compact and direct and it's not confusing or spaghetti-fied. But there's on element onclick js binding, inline stylesheets, inline javascript, poor scoping on variables, lots and lots of commented out code.
The commentated out code is a personal bug bear of mine. I'm always reminding junior programmers to delete commented out code from the system, I tell them they should never check in commented out code and that's what source control is for. It's a simplistic explanation to deter discussion, in reality it's because of YAGNI and that personally it always dis-orientates me and slows me down while I'm working on code. I get distracted by trying to figure out why it's there and usually it's out of date and within a year it will still be there but now refers to functions that have been entirely removed.
Commented out code becomes stale very quickly. People fear to remove it because they think it must have a purpose, when it rarely does. It becomes unnecessary noise and the person who was best placed to delete it is the one who commented it out in the first place.
I think it's a bad coding habit that you have to consciously break at some point, I certainly used to do it.
There's a bunch of inline javascript with commented out code there, console logs, etc. for the sharing plugin.
Great little comment of:
It doesn't seem to be a plugin as I've been searching for snippets of the code and I can't find it online anywhere. Wonder who wrote it, it's functional but pretty sloppy, e.g.: SharingItemInProgress is an undeclared global variable, no error handling apart from commented out logs, etc.Also, just found this just before a closing form tag:
There are even some commented out p tags like <!-- <p>PHOTO: Bill and Melinda talking with women during their trip to Atlanta in October 2017</p> -->.Just found an empty $(document).ready( too.
Bill Gates has a site that looks like it's been put together by the eponymous 14-year old nephew.