8 ms·
Code snippets on Microsoft website shown in form of images.
- _delirium 15y agoCurious. Sometimes people do that sort of thing to avoid copy/pasting, but I wonder if in this case it's a poor man's way of getting syntax highlighting on the web: just screenshot an IDE instead of dealing with a syntax-highlighting-in-HTML tool.
- ryan_s 15y agoYou are probably right. I've found the MSDN pretty inconsistent. There are a number of C#/VB.net examples that don't have any syntax highlighting at all. It all depends which area you are in.
- brudgers 15y agoIt's not just MSDN which is inconsistent. Microsoft's web presence in general varies widely. The philosophy appears to highly favor providing access to knowledge/content over standardization of form/presentation. The scale of Microsoft's web properties is vast and they do not waste resources trying to get a herd of cats to goosestep.
- lr 15y agoYes, much to Bill Gates' dismay: http://gizmodo.com/5019516/classic-clips-bill-gates-chews-out-microsoft-over-xp http://gizmodo.com/5019516/classic-clips-bill-gates-chews-ou...
- bostonpete 15y agoWhat does that article have to do with the standardization of form/presentation?
- petercooper 15y agoMore specifically, it's the only way to easily guarantee syntax highlighting in feed readers, e-mails, etc. The alternative is to hard code styles into the HTML everywhere but that's a nightmare to rig up.
- DrinkWater 15y agoI hope it was an accident/mistake, otherwise it makes Microsoft look ridiculous as fuck.
- aChrisSmith 15y agoFor a company of 92,000+ people I am sure there are at least a few C and D-level people in charge of MSDN content. However, for a company of 92,000+ people, I would have also assumed there would be a standard tool or process for doing this sort of thing. Edit: updating employee totals. Holy crap MSFT is big.
- brudgers 15y agoI suspect that letting people do their own thing when it comes to placing content on the web is based on two historical features of Microsoft. The first is that because many Microsoft employees were strongly engaged with computers, there were many early adopters of the internet and more importantly the web (Microsoft.com registered in 1991). I suspect that the anything goes culture of the wild west days of the web persists to some degree within the organization. The second historical factor is that there were a lot of employees with fuck you money during the early days of Microsoft's web presence and Microsoft management didn't waste resources forcing developers to heel to the sacred ideas of branding experts. If you dig around Microsoft, you will find lots of standard tools - e.g. MSDN has a fairly consistent graphic presentation when it comes to technical documentation - it just looks nothing like Channel9. However, these differences, while not ideal for consumers, are pretty much irrelevant when it comes to supporting developers. Yes the bitmap code snippets are embarrassing but not in a Facebook security hole kind of way. Any developer doing .NET programming isn't going to be greatly slowed down by typing in the code rather than copying and pasting from the MSDN page.
- nathanwdavis 15y agoProper syntax hi-lighting html markup is used for most of the MSDN content I've used recently. Definitely for the .NET and WinRT content.
- smackfu 15y ago
- Ubersoldat 15y agoCome on! http://www.bing.com/search?q=code+highlighter+online http://www.bing.com/search?q=code+highlighter+online
- ayiteddybear 15y agoIt's probably a one-time problem with the person who created the page. on msdn microsoft has code highlighting and even samples in other .net languages. example: http://msdn.microsoft.com/en-us/library/ms132397.aspx http://msdn.microsoft.com/en-us/library/ms132397.aspx
- pearle 15y agoAny reason why they would want to prevent the code from being searchable from external search engines? Software patents..etc.
- EpaL 15y agoMore importantly, that is some of the nastiest looking JavaScript I've seen in a while. I think MS are doing everyone a favour.
- riffraff 15y agothere _is_ something to be said for not allowing copy&paste, but I'd be more worried of poor read&type-rs :)
- loozapalooza 15y agoI am learning javascript nowadays. Can you describe, what is wrong with this javascript? So that, I won't learn any bad practice.
- cbs 15y agoWhen the code was adjusted to fit on the website they lost a lot of the formatting, and severely hurt the readability of the code. It appears that the lines of code were rather long, but were word-wrapped to fit within the size of that image, creating linebreaks at unexpected places. The first and last lines of the block open and close curly braces, but the rest of the code is not indented. Readability is something you need to be aware of, but don't worry about learning bad practice. You'll become opinionated pretty quickly on your own.
- troels 15y ago> .. but don't worry about learning bad practice. You'll become opinionated pretty quickly on your own. So true.
- troels 15y agoJust a few quick observations: The formatting is non-existant. That makes me angry. Because I have OCD. Most programmers do. There's a lot of direct use of DOM traversing, which makes the code rather brittle. (Use a css selector for binding to the DOM - jQuery is the de-facto standard tool here). Variables are not encoded in the URL. And when it is, it happens on a separate line from where it's used. That's just bad style. Oh, and what's the point of those declared-but-unused variables (`spanish, german, english`). And why aren't they in a hashmap?
- danielhunt 15y agoI think a more disturbing detail here is the alt text being used on the images themselves: Description: \\christw4\c$\TranslatorHelp\en-us\GSG_files\image014.png Description: \\christw4\c$\TranslatorHelp\en-us\GSG_files\image015.png edit formatting
- deleted 15y ago[deleted]
- cust_support 15y agoFTW. At least we know who in this thread is the sectarian. Only an idiot would draw an analogy between their private personification of evil and an entire group of people. A rose by any other name is a damn racist.
- bmaeser 15y agoi am so sad now, i event cant find proper words for a meaningful comment
- iamandrus 15y agoI'm OCD about code, and that Javascript makes me want to rip my hair out.
- brudgers 15y agoI suspect that the C# from which asp.net generated the javascript is far closer to your standards.
- JonoW 15y agoKeep in mind that most of the MSDN has copy-pasteable links (at least last time I checked, i.e. this morning), e.g. the entire set of .NET BCL reference docs. But, they don't use a syntax highlighter on those, boo to them.
- adhipg 15y agoSince the page is all about translation, could it be to avoid online translators (like Google Translate) to attempt to read that code and translate it since you expect many of the visitors to the page coming from a locale different than English? Or, does Google Translate etc. handle this and not attempt to 'translate' code?
- tathagatadg 15y agoI would like to see how long it stays that way ... people make mistakes, but if you are on the front page of HN for a wrong reason, you leave everything aside and fix it.
- nathanwdavis 15y agoI doubt the editors or developers of the MS Translator even know what HN is. I know... it's shocking.
- memoryfault 15y agoThere are plenty of MS employees on HN. I'm curious...what makes you think someone who works on translator is less likely to know what HN is?
- deleted 15y ago[deleted]
- overgryphon 15y ago> if you are on the front page of HN for a wrong reason, you leave everything aside and fix it. I don't think example code as an image on one page of a site as large as MSDN is a good reason to leave everything aside and fix it, regardless of whether it is on HN or not.
- abraham 15y agoOn the plus side having to manually type all of it will help developers learn it better.
- deleted 15y ago[deleted]
- deleted 15y ago[deleted]
- cfontes 15y agoYou are definitively a Cup Half full guy. :D
- maximusprime 15y agoIt's a step up. I think they used to use silverlight to show code snippets.
- wpeterson 15y agoHow else can you get it to work in IE?
- astrodust 15y agoMore <font> tags.
- deleted 15y ago[deleted]
- mattgreenrocks 15y agoSomeone please explain how this isn't a Reddit-esque tempest in a teapot? Sure, it's silly, but getting angry over it? Ridiculous.
- smackfu 15y agoDevelopers love to complain about other people's minor bugs, and yet hate it when testers open them against their own code. "Who even cares about this?"
- dripton 15y agoThis is why pair programming and code reviews work so well.
- Pedrom 15y agoNot sure about pair programming... I got incredible bored when I had to share the keyboard. The time I did that I felt like we were taking turns to be slackers :S EDIT: Adding a link http://stackoverflow.com/questions/291630/does-pair-programming-work http://stackoverflow.com/questions/291630/does-pair-programm...
- malkia 15y agoThat's catfooding right there. The site has something to do with javascript on the web, which is very close to html/css, and it does not ever use formatting as seen on many other sites (code coloring). (Okay, I'm total html/css/js noob, never done a web page in my life, but I think it's wrong). And in the past examples were showing just right in MSDN, along with way to switch between C#/C++/VB/etc.
- ap22213 15y agoBased on the formatting, it looks like a screen capture from Visual Studio. Ugly. Probably just some poor soul trying to meet some arbitrary deadline, and the screen shot and crop method was the easiest solution. Or, maybe they were the first person in a workflow, and they had no idea that it'd be translated into web content. Not defending it, but just saying - I've been there, and I'm sure you have, whether we like it or not.
- petercooper 15y agoHow else can you guarantee how it will look in a feed reader (many of which strip styles or ignore stylesheets)? The Web is one thing, the places that ignore your styling.. quite another ;-)