Reading bytes from a file in Metro



  •  So, I have this Javascript/HTML-Metro-app which stores its user data as an array of (byte-sized) numbers. Naturally, at some point the app will be suspended so I have to write the data to disc beforehand.

    That's actually easy, once you've got the hang of this Chain of Promises thingie.

     

    <font face="Consolas" size="2"><font face="Consolas" size="2">saveData: </font></font><font color="#0000ff" face="Consolas" size="2"><font color="#0000ff" face="Consolas" size="2"><font color="#0000ff" face="Consolas" size="2">function</font></font></font><font face="Consolas" size="2"><font face="Consolas" size="2"> () {</font></font>

    <font color="#0000ff" face="Consolas" size="2"><font color="#0000ff" face="Consolas" size="2"><font color="#0000ff" face="Consolas" size="2"><font color="#000000">  </font>var</font></font></font><font face="Consolas" size="2"><font face="Consolas" size="2"> applicationData = Windows.Storage.ApplicationData.current;</font></font>

    <font face="Consolas" size="2"><font face="Consolas" size="2"> </font></font><font color="#0000ff" face="Consolas" size="2"><font color="#0000ff" face="Consolas" size="2"><font color="#0000ff" face="Consolas" size="2">  var</font></font></font><font face="Consolas" size="2"><font face="Consolas" size="2"> localFolder = applicationData.localFolder;</font></font>

    <font face="Consolas" size="2"><font face="Consolas" size="2">   l</font></font><font face="Consolas" size="2"><font face="Consolas" size="2">ocalFolder.createFileAsync(</font></font><font color="#a31515" face="Consolas" size="2"><font color="#a31515" face="Consolas" size="2"><font color="#a31515" face="Consolas" size="2">"test.dat"</font></font></font><font face="Consolas" size="2"><font face="Consolas" size="2">, Windows.Storage.CreationCollisionOption.replaceExisting)</font></font>

    <font face="Consolas" size="2"><font face="Consolas" size="2"> </font></font><font face="Consolas" size="2"><font face="Consolas" size="2">    .then(</font></font><font color="#0000ff" face="Consolas" size="2"><font color="#0000ff" face="Consolas" size="2"><font color="#0000ff" face="Consolas" size="2">function</font></font></font><font face="Consolas" size="2"><font face="Consolas" size="2"> (dataFile) {</font></font>

    <font face="Consolas" size="2"><font face="Consolas" size="2">     </font></font><font color="#0000ff" face="Consolas" size="2"><font color="#0000ff" face="Consolas" size="2"><font color="#0000ff" face="Consolas" size="2">var</font></font></font><font face="Consolas" size="2"><font face="Consolas" size="2"> content = Data.DB.exportData();</font></font>

    <font color="#0000ff" face="Consolas" size="2"><font color="#0000ff" face="Consolas" size="2"><font color="#0000ff" face="Consolas" size="2">return</font></font></font><font face="Consolas" size="2"><font face="Consolas" size="2"> Windows.Storage.FileIO.writeBytesAsync(dataFile, content);</font></font>

    <font face="Consolas" size="2"></font> 

    <font face="Consolas" size="2"><font face="Consolas" size="2">      </font></font><font face="Consolas" size="2"><font face="Consolas" size="2">}).done(</font></font><font color="#0000ff" face="Consolas" size="2"><font color="#0000ff" face="Consolas" size="2"><font color="#0000ff" face="Consolas" size="2">function</font></font></font><font face="Consolas" size="2"><font face="Consolas" size="2"> () { });</font></font>

    <font face="Consolas" size="2"><font face="Consolas" size="2">

    }

    However, importing the whole thing is a bit complicated because of the lacking documentation. You see, there is no FileIO.readBytesAsync() - there's readLinesAsync() and readTextasync, but no such thing for bytes.

    Thus we have to use a Stream.

     

    <font face="Consolas" size="2"><font face="Consolas" size="2">restoreData: </font></font><font color="#0000ff" face="Consolas" size="2"><font color="#0000ff" face="Consolas" size="2"><font color="#0000ff" face="Consolas" size="2">function</font></font></font><font face="Consolas" size="2"><font face="Consolas" size="2"> () {</font></font>

    <font face="Consolas" size="2"><font face="Consolas" size="2"> </font></font><font color="#0000ff" face="Consolas" size="2"><font color="#0000ff" face="Consolas" size="2"><font color="#0000ff" face="Consolas" size="2">var</font></font></font><font face="Consolas" size="2"><font face="Consolas" size="2"> applicationData = Windows.Storage.ApplicationData.current;</font></font>

    <font face="Consolas" size="2"><font face="Consolas" size="2"> </font></font><font color="#0000ff" face="Consolas" size="2"><font color="#0000ff" face="Consolas" size="2"><font color="#0000ff" face="Consolas" size="2">var</font></font></font><font face="Consolas" size="2"><font face="Consolas" size="2"> localFolder = applicationData.localFolder;</font></font>

    <font face="Consolas" size="2"><font face="Consolas" size="2"> </font></font><font face="Consolas" size="2"><font face="Consolas" size="2">localFolder.getFileAsync(</font></font><font color="#a31515" face="Consolas" size="2"><font color="#a31515" face="Consolas" size="2"><font color="#a31515" face="Consolas" size="2">"test.dat"</font></font></font><font face="Consolas" size="2"><font face="Consolas" size="2">)</font></font>

    <font face="Consolas" size="2"><font face="Consolas" size="2"> </font></font><font face="Consolas" size="2"><font face="Consolas" size="2">.then(</font></font><font color="#0000ff" face="Consolas" size="2"><font color="#0000ff" face="Consolas" size="2"><font color="#0000ff" face="Consolas" size="2">function</font></font></font><font face="Consolas" size="2"><font face="Consolas" size="2"> (dataFile) {</font></font>

    <font face="Consolas" size="2"><font face="Consolas" size="2"> </font></font><font color="#0000ff" face="Consolas" size="2"><font color="#0000ff" face="Consolas" size="2"><font color="#0000ff" face="Consolas" size="2">return</font></font></font><font face="Consolas" size="2"><font face="Consolas" size="2"> Windows.Storage.FileIO.readBufferAsync(dataFile);</font></font>

    <font face="Consolas" size="2"><font face="Consolas" size="2"> </font></font><font face="Consolas" size="2"><font face="Consolas" size="2">}).then(</font></font><font color="#0000ff" face="Consolas" size="2"><font color="#0000ff" face="Consolas" size="2"><font color="#0000ff" face="Consolas" size="2">function</font></font></font><font face="Consolas" size="2"><font face="Consolas" size="2"> (buffer) {</font></font>

    <font face="Consolas" size="2"><font face="Consolas" size="2"> </font></font><font color="#0000ff" face="Consolas" size="2"><font color="#0000ff" face="Consolas" size="2"><font color="#0000ff" face="Consolas" size="2">var</font></font></font><font face="Consolas" size="2"><font face="Consolas" size="2"> dataReader = Windows.Storage.Streams.DataReader.fromBuffer(buffer);</font></font>

    <font face="Consolas" size="2"><font face="Consolas" size="2"> </font></font><font color="#0000ff" face="Consolas" size="2"><font color="#0000ff" face="Consolas" size="2"><font color="#0000ff" face="Consolas" size="2">var</font></font></font><font face="Consolas" size="2"><font face="Consolas" size="2"> content = </font></font><font color="#0000ff" face="Consolas" size="2"><font color="#0000ff" face="Consolas" size="2"><font color="#0000ff" face="Consolas" size="2">new</font></font></font><font face="Consolas" size="2"><font face="Consolas" size="2"> Array();</font></font>

    <font face="Consolas" size="2"><font face="Consolas" size="2">

    </font></font><font color="#008000" face="Consolas" size="2"><font color="#008000" face="Consolas" size="2"><font color="#008000" face="Consolas" size="2">//for (var i = 0; i < buffer.length; i++) { </font></font></font>

    <font color="#008000" face="Consolas" size="2"><font color="#008000" face="Consolas" size="2"><font color="#008000" face="Consolas" size="2">
    </font></font></font><font color="#008000" face="Consolas" size="2"><font color="#008000" face="Consolas" size="2"><font color="#008000" face="Consolas" size="2">// content.push(dataReader.readByte());</font></font></font>

    <font color="#008000" face="Consolas" size="2"><font color="#008000" face="Consolas" size="2"><font color="#008000" face="Consolas" size="2">
    </font></font></font><font color="#008000" face="Consolas" size="2"><font color="#008000" face="Consolas" size="2"><font color="#008000" face="Consolas" size="2">//}</font></font></font>

    <font face="Consolas" size="2"><font face="Consolas" size="2">

    dataReader.readBytes(content);

    </font></font><font face="Consolas" size="2"><font face="Consolas" size="2">

    dataReader.close();

    </font></font>

    <font color="#0000ff" face="Consolas" size="2"><font color="#0000ff" face="Consolas" size="2"><font color="#0000ff" face="Consolas" size="2">return</font></font></font><font face="Consolas" size="2"><font face="Consolas" size="2"> content;</font></font>

    <font face="Consolas" size="2"><font face="Consolas" size="2">
    </font></font><font face="Consolas" size="2"><font face="Consolas" size="2">}).done(</font></font><font color="#0000ff" face="Consolas" size="2"><font color="#0000ff" face="Consolas" size="2"><font color="#0000ff" face="Consolas" size="2">function</font></font></font><font face="Consolas" size="2"><font face="Consolas" size="2"> (data) {</font></font>

    <font face="Consolas" size="2"><font face="Consolas" size="2">

    Data.DB = SQL.open(data);

    </font></font>

    <font face="Consolas" size="2"><font face="Consolas" size="2">}, </font></font><font color="#0000ff" face="Consolas" size="2"><font color="#0000ff" face="Consolas" size="2"><font color="#0000ff" face="Consolas" size="2">function</font></font></font><font face="Consolas" size="2"><font face="Consolas" size="2"> () {</font></font>

    <font face="Consolas" size="2"><font face="Consolas" size="2">

    Data.DB = SQL.open();

    </font></font>

    <font face="Consolas" size="2"><font face="Consolas" size="2">Data.DB.exec(</font></font><font color="#a31515" face="Consolas" size="2"><font color="#a31515" face="Consolas" size="2"><font color="#a31515" face="Consolas" size="2">"CREATE TABLE ...);"</font></font></font><font face="Consolas" size="2"><font face="Consolas" size="2">);</font></font>

    <font face="Consolas" size="2"><font face="Consolas" size="2">

    });

    }

    </font></font>

    Now, you're probably seeing the commented code: That's the one which actually works. The dataReader.readBytes(content) method is a WTF for three reasons:

    a) the documentation states that the argument has to be an array of numbers - Javascript is weakly typed, though. Best I can do is to create an array.

    b) it works on the argument itself, instead (like EVERY OTHER METHOD IN THIS CLASS!) of returning the proper value.

    c) it doesn't actually work, or at least I haven't figured out what else to do with this method. The for-loop works and yields the proper array. The readBytes method yields an empty array. Gah. Might be able to replace the for-loop with a while one. Might have to look into the return values for readByte().

    And sorry for the lack of indentation, this editor is ... sub-optimal.

    </font></font>



  • Try
    var content = new Array(buffer.length);
    It looks like whoever designed this API was copying the API from a C-like language.



  • @Rhywden said:

    the documentation states that the argument has to be an array of numbers - Javascript is weakly typed, though. Best I can do is to create an array.

    JavaScript has typed arrays now.  It probably requires one of those as the parameter.  And the documentation says "For efficient data transfer in JavaScript, pass a Uint8Array for the value parameter."  So I'd try passing one of those instead of a plain Array.



  • Great, I'll try that. Thanks!



  • Okay, that did it, indeed.

    var content = new Uint8Array(buffer.length);

    And we're done. Nice. Now, why in the seven unholy hells were they not able to describe that little tidbit in their docs at a more prominent place?



  • I'm shocked that Microsofts JavaScript supports typed arrays!


  • Garbage Person

    Somewhat off topic: Somebody please tell me there's a non-Javascript option for creating Metro apps. Because, really, just reading this made me feel mildly ill and concerned for the future of software development. I never imagined I might have to activate my alternate career plans because the march of "technological progress" was headed inexorably down a road where Javascript is the end-all-be-all language for doing everything except running on bare metal.



  • @Weng said:

    Somewhat off topic: Somebody please tell me there's a non-Javascript option for creating Metro apps. Because, really, just reading this made me feel mildly ill and concerned for the future of software development. I never imagined I might have to activate my alternate career plans because the march of "technological progress" was headed inexorably down a road where Javascript is the end-all-be-all language for doing everything except running on bare metal.

    I was under the impression that you can use Visual Studio 2012 to developer Metro apps in any .NET language, although I will admit that I don't have VS2012 to test it. Maybe I should download it since I have an MSDN account through work...



  • @Rhywden said:

    <FONT size=2 face=Consolas><FONT size=2 face=Consolas>b) it works on the argument itself, instead (like EVERY OTHER METHOD IN THIS CLASS!) of returning the proper value.</FONT></FONT>
    This looks like a pretty typical pattern inherited from C programming regarding operating on buffers.  It's common in C to require a caller to allocate a buffer that a library fills because of the naunces of C memory management.  That looks like what this method does (but the MSDN documentation is almost blank, so I can't tell for sure).  I would guess that if you passed in an array of length 100, it would block until it filled the array.  If you pass in a zero length array, it will return immediately and do nothing.



  • @Weng said:

    Somewhat off topic: Somebody please tell me there's a non-Javascript option for creating Metro apps. Because, really, just reading this made me feel mildly ill and concerned for the future of software development. I never imagined I might have to activate my alternate career plans because the march of "technological progress" was headed inexorably down a road where Javascript is the end-all-be-all language for doing everything except running on bare metal.

    I'm pretty sure that C# is an option, and possibly C++ as well.

    Granted Javascript is becoming the end-all-be-all.



  • @MiffTheFox said:

    Granted Javascript is becoming the end-all-be-all.

    After trying out Ruby, I like JS even more than I did before.



  • @powerlord said:

    I was under the impression that you can use Visual Studio 2012 to developer Metro apps in any .NET language, although I will admit that I don't have VS2012 to test it.
    You're not limited to .net either - C++ (the non-managed one) works as well.



  • @Weng said:

    Somewhat off topic: Somebody please tell me there's a non-Javascript option for creating Metro apps. Because, really, just reading this made me feel mildly ill and concerned for the future of software development. I never imagined I might have to activate my alternate career plans because the march of "technological progress" was headed inexorably down a road where Javascript is the end-all-be-all language for doing everything except running on bare metal.

    Metro apps are created using "Windows Runtime", WinRT. That is a COM-based technology (happy now?) that can be used from C++ using new incarnation of ATL or using a special language extension, C++/CX, from any .NET language and from HTML/Javascript (I suspect it's running on .NET too but I am not sure).

    Desktop Windows 8 can still run old Win32 applications, but the Mobile/Tablet version only runs Metro/WinRT ones.



  • @Bulb said:

    Desktop Windows 8 can still run old Win32 applications, but the Mobile/Tablet version only runs Metro/WinRT ones.
    Actually, x86/x64 Windows 8 tablets run desktop applications just fine - just the ARM version (which is called Windows RT) is limited to Metro.



  • @ender said:

    just the ARM version (which is called Windows RT) is limited to Metro.

    IIRC, Windows RT can only run Metro apps (it obviously can't run older desktop apps, with it being ARM and all), but it still has the desktop mode, which only lets you run built-in applications such as Explorer, MS Office, Paint and notepad.

    And then there's of course Windows Phone 8, which I believe is a completely different product designed to look like the other two.



  • @spamcourt said:

    but it still has the desktop mode, which only lets you run built-in applications such as Explorer, MS Office, Paint and notepad.
     

    The most usefull desktop environment ever! Does it include Calculator and Freecell?

    @spamcourt said:

    And then there's of course Windows Phone 8, which I believe is a completely different product

    I've heard about it, but I always assumed they were talking about WinRT 8 (don't confuse with Win 8 RT - I still didn't hear about RT8 Win or 8 WinRT, but they must not be far). Now that you say WP8 is indeed a different thing, please elucidate: Does it run any Metro apps? (I'm pretty sure it isn't called Metro anymore.) Windows Phone apps? And what about Windows applications?

     



  • Afaik windows Phone 8 is actually pretty similar to Windows 8, in the sense that it runs on the same kernel and uses a subset of the "standard" API's (WinRT) plus a few phone-specific extentions.

    It's almost the same as the iOS <> Mac OS X comparison, they've got a lot in common. (I don't know about android, but I think it only the kernel is shared with normal linux distributions)



  •  

    @spamcourt said:

    @ender said:
    just the ARM version (which is called Windows RT) is limited to Metro.
    IIRC, Windows RT can only run Metro apps (it obviously can't run older desktop apps, with it being ARM and all), but it still has the desktop mode, which only lets you run built-in applications such as Explorer, MS Office, Paint and notepad.

    There are two releases for MS Surface. On the outside they will look identicle, as will their UI. But the one released now (ARM, Windows RT OS) is not the same as the Surface Pro, ETA Jan 2013 (Intel i5, Windows 8). The pro will be able to run any app that Windows 8 supports, including any desktop app (.exe's). The Surface that is out currently will only run native apps from the Windows store.

    That obviously doesn't include third party windows tablets, which I bet there will be plenty of both.

    @spamcourt said:

    And then there's of course Windows Phone 8, which I believe is a completely different product designed to look like the other two.

    Minor nitpick here: Windows 8 is imitating Windows Phone 7 turned 7.5... The reviews for the interface were excellent, and most of the features in windows 8 (People hub, live tiles) were release back in 2010 on Windows Phone 7. It's truly a wonderful way to get information on a phone platform. I haven't seen it on a tablet, and haven't used Windows 8 enough to see it's effect on a PC.




  • @spamcourt said:

    And then there's of course Windows Phone 8, which I believe is a completely different product designed to look like the other two.

    From all I know Windows Phone 8 is completely the same Windows RT for ARM. They are however somewhat different product from Windows Phone 7, which was completely different product from Windows Mobile 6.5 and was utterly useless because it didn't have many applications as the WM6 ones didn't work there.

    @spamcourt said:

    IIRC, Windows RT can only run Metro apps (it obviously can't run older desktop apps, with it being ARM and all), but it still has the desktop mode[…]

    Hm, probably depends on which variant (phone, tablet, "surface"). In any case app store will only have metro apps and I am not sure it will be possible to install manually on phones and tablets.



  • @Weng said:

    Somewhat off topic: Somebody please tell me there's a non-Javascript option for creating Metro apps. Because, really, just reading this made me feel mildly ill and concerned for the future of software development. I never imagined I might have to activate my alternate career plans because the march of "technological progress" was headed inexorably down a road where Javascript is the end-all-be-all language for doing everything except running on bare metal.

    Don't be a fool. Dynamic languages are a good thing and Javascript is actually one of the better ones. Like any language, it has its warts. But those warts are decidedly few considering that it was conceived in two weeks. Prototypes, closures, anonymous objects, etc. They're all things that any OOP developer should not only understand, but respect. They offer some very different ways of thinking of the rigid class/object implementation. LINQ being something directly influenced by them.

    If all you do is operate in a single programming language, you're not a "specialist", you're an easily antiquated pigeon roosting in its hole. Don't believe me? Think about all those C/C++ developers you like to laugh at from your Visual Studio workstations. And yes, you can create Metro apps in C# or any other managed language, so relax and bask in your own ignorance.



  • @Soviut said:

    @Weng said:

    Somewhat off topic: Somebody please tell me there's a non-Javascript option for creating Metro apps. Because, really, just reading this made me feel mildly ill and concerned for the future of software development. I never imagined I might have to activate my alternate career plans because the march of "technological progress" was headed inexorably down a road where Javascript is the end-all-be-all language for doing everything except running on bare metal.

    Don't be a fool. Dynamic languages are a good thing and Javascript is actually one of the better ones. Like any language, it has its warts. But those warts are decidedly few considering that it was conceived in two weeks. Prototypes, closures, anonymous objects, etc. They're all things that any OOP developer should not only understand, but respect. They offer some very different ways of thinking of the rigid class/object implementation. LINQ being something directly influenced by them.

    If all you do is operate in a single programming language, you're not a "specialist", you're an easily antiquated pigeon roosting in its hole. Don't believe me? Think about all those C/C++ developers you like to laugh at from your Visual Studio workstations. And yes, you can create Metro apps in C# or any other managed language, so relax and bask in your own ignorance.

    To be fair 90% of what's wrong with JavaScript is because it doesn't have a very decent standard library, DOM and Node.js being the two big ones (DOM dwarfing Node.js in terms of ubiquity and fail).

    My main irritation with JavaScript is that it's very lenient about errors (Reading an undefined value? No problem! I trust you not to make typos.) and that for a functional language, it takes a lot of characters to define a lambda.

    JS + WinRT looks pretty nice because it seems to have done the impossible: procedural JavaScript! I've never actually seen any WinRT JavaScript before outside this thread so I don't know what I'm getting myself into.

    That said, different languages are for different purposes and different coding styles. Sadly, JavaScript, alongside HTML, is being forced into purposes it has to place being. Did you know that HD-DVD menus were written in HTML!?

    HTML doesn't belong anywhere except document markup.


  • :belt_onion:

    @Adanine said:

    Minor nitpick here: Windows 8 is imitating Windows Phone 7 turned 7.5... The reviews for the interface were excellent, and most of the features in windows 8 (People hub, live tiles) were release back in 2010 on Windows Phone 7. It's truly a wonderful way to get information on a phone platform. I haven't seen it on a tablet, and haven't used Windows 8 enough to see it's effect on a PC.
    It's a nice feature on a tablet where most of the time you are interacting with the new start screen and Metro applications. But it's useless on a regular PC where you are mostly working in desktop mode so you never actually see the start screen. At least my desktop is organized in such a way that I don't need the start screen and I installed a 3rd party app that gives me the functionality of the "search" box directly on the desktop.



  • @Bulb said:

    Hm, probably depends on which variant (phone, tablet, "surface"). In any case app store will only have metro apps and I am not sure it will be possible to install manually on phones and tablets.
    Windows RT is what used to be called WOA (Windows on ARM) during development, and it strictly limits 3rd party applications to whatever-they-renamed-Metro-to. You won't be able to buy Windows RT in retail - only preinstalled on a device. Microsoft apparently aims for maximum confusion, because while Windows RT is an edition of Windows 8, WinRT is the runtime used by Metro^H^H^H^H^HModernUI^H^H^H^H^H^H^H^HWindows Store Apps, and WinRT is available in all Windows 8 and Server 2012 editions. Also, the x64-based tablets will run normal Windows 8 - not Windows RT.



  • Windows "Metro" interface -- now called Windows Store apps -- have essentially three APIs, at least, the way Microsoft describes them:

    • COM / C++ -- Write it in C.  You also have DirectX available to you here, from what I understand (not my expert area)
    • Javascript / HTML -- makes it easy for onobarding or porting your HTML 5 app to a native app.
    • XAML / .NET -- Use any .NET language and this XAML varient to create your app.  I am just getting my feet wet with this one.  This makes the 4th XAML UI flavor - WPF / Silverlight / Silverlight for Phone / Metro.   I guess this is no different than all the different flavors of the framework now, and some APIs being supported on some platofrms and not others.

    They also have Visual Studio Express for Winows 8 that is free, but you have to be running Windows 8 to install.  Also, you can pick up your free copy of TFS Express for your source control and work item tracking, etc.



  • @bjolling said:

    @Adanine said:

    Minor nitpick here: Windows 8 is imitating Windows Phone 7 turned 7.5... The reviews for the interface were excellent, and most of the features in windows 8 (People hub, live tiles) were release back in 2010 on Windows Phone 7. It's truly a wonderful way to get information on a phone platform. I haven't seen it on a tablet, and haven't used Windows 8 enough to see it's effect on a PC.
    It's a nice feature on a tablet where most of the time you are interacting with the new start screen and Metro applications. But it's useless on a regular PC where you are mostly working in desktop mode so you never actually see the start screen. At least my desktop is organized in such a way that I don't need the start screen and I installed a 3rd party app that gives me the functionality of the "search" box directly on the desktop.

    I have Windows 8 without any mods installed, mainly to test to see if Microsoft's way truly works.

    At first I was having issues with muscle memory. I'd get lost because my first point of call had disappeared. It sucked :(.

    But after revising my desktop layout, pinned taskbar items, and Metro Live Tiles, I'm slightly more effecient then I was before. Barely. And that wasn't because of the metro live tiles or any windows 8 features, only because I sorted desktop icons.

    I didn't know the start screen (Metro UI) allows a keyboard to type into an invisable search prompt (Which pops up when you start typing a phrase). That search is functionally the same as the old search bar in windows 7.

    For me, the UI changes for Windows 8 haven't restricted me. Now it's just as easy to open something as it was in Windows 7, if not one click easier, since my major programs are pinned to the Metro UI. I wouldn't blame anyone for wanting the start bar back, but I kind of have to agree that it's now an ineffecient way of doing things. If nothing else, it reinforces a messy working place, where you don't -have- to maintain desktop icons and pins.

    All that said, I have been more updated with news headlines because of the "News" tile (Not actually clicking it, just glancing at it), then I have been in the past (Read: Not at all). Maybe there's some benefit in Metro/Modern for Desktop PCs? I doubt many people would agree, though. But atleast try to give it a chance. Restore the start menu if you want, but atleast try to use the Metro UI, before you write it off. If nothing else, it doesn't get in the way.

    There are major teething problems with going from Win7 to Win8 though. It's like the move everyone had to make from Office 2003 to 2007. It was more familiar and easier to stick to 2003, then to move to 2007. But after I did, it was easier to use in general.

     


  • Garbage Person

    @Soviut said:

    Don't be a fool. Dynamic languages are a good thing and Javascript is actually one of the better ones. Like any language, it has its warts. But those warts are decidedly few considering that it was conceived in two weeks. Prototypes, closures, anonymous objects, etc. They're all things that any OOP developer should not only understand, but respect. They offer some very different ways of thinking of the rigid class/object implementation. LINQ being something directly influenced by them.
    Yes. Javascript has some excellent ideas, but the execution of those ideas is borderline terrifying. And the lack of a standard library that isn't made of absolute fuck. And the fact that it's almost permanently married to HTML (which is an even bigger clustergrope) in the minds of the sorts of idiots that make architectural decisions these days. Bottom line, I don't like Javascript. I don't give a flying fuck what it's inspired, and I don't care to ever have to work with it every day. I don't do UI. I'm crap at it and don't like it.  Nobody has even come remotely close to convincing me that there's a good reason to run Javascript anywhere but on the client to do UI things. Fortunately, there's plenty of shit for computers to do on the actual thinky-stuff side, so while armies of "developers" fiddle around with HTML and Javascript to draw pretty pictures for people to touch on their fondleslabs, I'm quite happy to go write the things that those guys call out to when they decide they actually need something of substance to draw pictures of.

    @Soviut said:

    If all you do is operate in a single programming language, you're not a "specialist", you're an easily antiquated pigeon roosting in its hole.
    Who told you I operate in a single programming language? I PREFER a single language - C# - because it strikes me personally as the right balance between verbosity, performance, portability, language features and library features (that is good enough; good enough; mediocre; good enough; excellent) but the only experiences I refuse to repeat are COBOL and ABAP. Hell, I'm one of the world's leading experts in a completely bizarre, proprietary, interpreted, XML-based procedural language. Let that sink in for a minute.

     @Soviut said:

    Think about all those C/C++ developers you like to laugh at
    I think you mean COBOL developers. I don't think I actually know any C/C++ developers.

    @Soviut said:

    from your Visual Studio workstations.
    In the past six months, I've used Visual Studio as an IDE precisely five times. The rest of the time, it's a really nice XML editor.

    @Soviut said:

    And yes, you can create Metro apps in C# or any other managed language, so relax and bask in your own ignorance.
    k. I'll go back to not having time to give a flying fuck at a rolling donut with regards to the trials and tribulations of "App" development. After all, I have one-off homegrown production hardware to integrate with stonking huge towers of legacy COBOL running on IBM z-series big iron, sprawling FORTRAN monstrosities running on whatever IBM calls those things that replaced the AS/400, clever-perl-hacks-cum-business-critical-glue, homegrown proprietary development languages, squllions of dollars worth of third party software, libraries and APIs, all to produce stuff that I can prettymuch everyone has handled at least once today, and you probably have some of it within a few feet of you.

    I do real work. I do hard work. I do things that nobody outside my team does anywhere on the planet. I've had vendors tell me "Nobody has ever done anything remotely like that with our product before, and I'm not certain it's even possible" and salesgoons tell me "But I sold it! You have to make it! By the way, I know you said processing time would be six hours, but they wanted a thirty minute SLA. I negotiated them down to 45 minutes." I have shanghaied inexpensive SMB products into resilient, business-critical enterprise-grade solutions because some ignorant bastard decided I didn't really need the right tools. I have done the "impossible" more times than I care to recall. I can calculate exactly how much revenue my software has enabled in the past year. That number is big enough that, were it a country's GDP, it wouldn't be the smallest one.

    And on the whole, I get less respect from the software development community at large than some guy who developed Yet Another Twatter Widget because I don't have time to learn Ruby, and I give absolutely zero shits about Javascript, and I certainly don't do ANYTHING involving "Big Data" or "Social Networking" or "Metrics" (aside from the fact that I preside over a cache of personal data that certain companies involved in Big Data, Social Networking and Metrics would literally kill for). It seems that ever since the general public "got" tech, all the glory has gone to the programmers who work on the bits that the general public "got". Slick UIs, various flavor-of-the-month junk, etc. Nobody seems to give a damn about those of us who build infrastructure and facilitate the whole of civilized modern society. 

     And if I quit my job tomorrow, I'd have a new one doing much the same thing within two days. Guaranteed. Infrastructure never dies, and is a skillset completely divorced from the world of front end computing. If Javascript ever makes serious infrastructure inroads, I *WILL* leave the industry and become a trucker or something.

     

    tldr; I just worked 12 hours of overtime and felt like having a rant about ignorant UI-centric pricks who wouldn't last through basic training in my group.



  • @Adanine said:

    That search is functionally the same as the old search bar in windows 7.
    It isn't - instead of displaying all results on the same page, it has separate pages for Programs, Settings and Files, and it makes it cumbersome to switch between those pages with keyboard.


  • ♿ (Parody)

    @Weng said:

    It seems that ever since the general public "got" tech, all the glory has gone to the programmers who work on the bits that the general public "got". Slick UIs, various flavor-of-the-month junk, etc. Nobody seems to give a damn about those of us who build infrastructure and facilitate the whole of civilized modern society.

    A lot of the stuff that goes on around here reminds me of Dirty Jobs. People doing the required job of cleaning up after the metaphorical shit and keeping stuff running. But aside from maybe the bathrooms converted to server rooms, I don't think many of the posts would work for the show.



  • @ender said:

    @Adanine said:
    That search is functionally the same as the old search bar in windows 7.
    It isn't - instead of displaying all results on the same page, it has separate pages for Programs, Settings and Files, and it makes it cumbersome to switch between those pages with keyboard.
    Oh, didn't think of it that way.

    It's still possible to switch between the catagories using only the keyboard, but it involves using the arrow keys and enter. Although you would use those normally... Still, it's slightly worse in that respect, I admit.



  • @Weng said:

    [well constructed rant] ... If Javascript ever makes serious infrastructure inroads, I WILL leave the industry and become a trucker or something.

    I take it you don't see node.js as serious... yet.



  • @flabdablet said:

    @Weng said:
    [well constructed rant] ... If Javascript ever makes serious infrastructure inroads, I WILL leave the industry and become a trucker or something.

    I take it you don't see node.js as serious... yet.

    Do you consider it... infrastructure?


  • @boomzilla said:

    A lot of the stuff that goes on around here reminds me of Dirty Jobs.
     

    Mike Rowe (isn't) soft!

     



  •  I am prejudiced against nodejs.


  • Garbage Person

    @flabdablet said:

    @Weng said:
    [well constructed rant] ... If Javascript ever makes serious infrastructure inroads, I *WILL* leave the industry and become a trucker or something.

    I take it you don't see node.js as serious... yet.

    Fact: I don't take anything as serious until I've met somebody that does it, and preferably worked somewhere their team is visible to me. If there's one thing programmers are universally good at, it's overstating their own importance.

     



  • @Sutherlands said:

    @flabdablet said:
    I take it you don't see node.js as serious... yet.
    Do you consider it... infrastructure?

    That does seem to be where it's attempting to position itself.

    I'm just glad we still have old-skool non-self-importance-overstating programmers like Weng to pour boiling oil on it from the ramparts.


  • Garbage Person

    @flabdablet said:

    I'm just glad we still have old-skool non-self-importance-overstating programmers like Weng to pour boiling oil on it from the ramparts.
    Did you miss what I said about programmers being really good at overstating how important we are? I do, in fact, have a tinge of self-awareness somewhere in here underneath the drunkenness.

    But yes, pouring boiling oil on it from the ramparts I am in fact. Really I don't care if it's good or not, it's Javascript and it needs to die for its sins.

     

    And since I'm drunk, I'm going to take apart the first example on the node.js website. It won't make sense because I lovebeer.

    var http = require('http');
    .... What? That's meta.
    http.createServer(function (req, res) {
    Okay. Gotcha.
      res.writeHead(200, {'Content-Type': 'text/plain'});
    So wait. Let me see if I'm tracking right here. there's a whole HTTP implementation in the fucking STANDARD LIBRARY? When did we get so hung up on HTTP that sentence started being plausible? HTTP is a fucking awful standard.
      res.end('Hello World\n');
    Hi!
    }).listen(1337, '127.0.0.1');
    Okay. you've got to be fucking kidding me. 1337? Really? REALLY? <font size="6">REALLY?</font> What are we, twelve? And why the fucknuggets is the port number before the listen address? Let me guess, it's because some chucklefuck decided they wanted a default "LISTEN ON ALL!" function and therefore port comes first because they're a bunch of smegheads and Javascript makes it too difficult to reorder parameters in overloads, no matter how much sense it makes.
    console.log('Server running at http://127.0.0.1:1337/');
    LOOK AT MEEEEEEEE I HAVE CONSOLE OUTPUT JUST LIKE A REAL ENVIRONMENT!

     


  • @Weng said:

    there's a whole HTTP implementation in the fucking STANDARD LIBRARY? When did we get so hung up on HTTP that sentence started being plausible?

    Are you telling me you'd rather have eight billion HTTP implementations that don't work instead of one that does?

    I don't know about you, but I prefer having a standard library with actual useful things in it.

    @Weng said:

    console.log('Server running at http://127.0.0.1:1337/');
    LOOK AT MEEEEEEEE I HAVE CONSOLE OUTPUT JUST LIKE A REAL ENVIRONMENT!

    I suppose you'd be surprised to find out most browsers are also REAL ENVIRONEMNT!s.



  • @Weng said:

    So wait. Let me see if I'm tracking right here. there's a whole HTTP implementation in the fucking STANDARD LIBRARY? When did we get so hung up on HTTP that sentence started being plausible? HTTP is a fucking awful standard.

    But it's not the worst thing.



  • @flabdablet said:

    @Weng said:
    So wait. Let me see if I'm tracking right here. there's a whole HTTP implementation in the fucking STANDARD LIBRARY? When did we get so hung up on HTTP that sentence started being plausible? HTTP is a fucking awful standard.

    But it's not the worst thing.

    Anybody who bitches about JavaScript is actually bitching about DOM, and too stupid to be able to tell the difference between the two. #truefacts



  • @Weng said:

      res.writeHead(200, {'Content-Type': 'text/plain'});
    So wait. Let me see if I'm tracking right here. there's a whole HTTP implementation in the fucking STANDARD LIBRARY? When did we get so hung up on HTTP that sentence started being plausible?

    (I'm leaving out ASP from this discussion because I have no idea how it works behind the scenes.

    You see, Node.JS is designed to be a web language. Most modern web languages, PHP, Ruby on Rails, Python+Django, etc., run as their own daemon and talk to a web server such as Apache, Nginx, IIS, Lighttpd, etc., via a protocol called FastCGI.

    Node.JS on the other hand, is designed to be a web server. This of course only serves as a way to befuddle admins who are used to the traditional server/application divide, to remove any benefits that would come from different servers (Apache's extensibility, Nginx's prefornace, etc.), to the possibility of unfixable security holes because the web server is unupgradable independent from the runtime (in the not-exactly-rare chance that the application refuses to run on a newer runtime), and to make it impossible to serve static content, hindering performance.



  • @blakeyrat said:

    Anybody who bitches about JavaScript is actually bitching about DOM, and too stupid to be able to tell the difference between the two. #truefacts

    Or maybe they don't really care. Like anybody who gushed about HTML5 and is actually gushing about CSS3, and even then is only gushing about Google and Mozilla's proprietary implementions of CSS3.


  • Considered Harmful

    @blakeyrat said:

    Anybody who bitches about JavaScript is actually bitching about DOM, and too stupid to be able to tell the difference between the two. #truefacts

    I hate how DOM inserts implicit semicolons and also how it requires me to call hasOwnProperty when doing a for[each].



  • @MiffTheFox said:

    You see, Node.JS is designed to be a web language.

    Node.JS on the other hand, is designed to be a web server.

     

    Is it a language to develop applications in a web server, or it is a web server itself?

    /confused.

     



  • @Cassidy said:

    Is it a language to develop applications in a web server, or it is a web server itself?
    It's a web server with built-in JavaScript engine.



  • @Cassidy said:

    @MiffTheFox said:

    You see, Node.JS is designed to be a web language.

    Node.JS on the other hand, is designed to be a web server.

     

    Is it a language to develop applications in a web server, or it is a web server itself?

    /confused.

     

    It's a web language that's also a web server. No other language I know of works like this (at least in production).



  • @Cassidy said:

    Is it a language to develop applications in a web server, or it is a web server itself?

    /confused.

    Is Java a programming language or a virtual machine to run code from various programming languages? Oh it's both?

    You might be confused, but this naming isn't exactly new. Sun was confusing the fuck out of people back in 1995.





  • @blakeyrat said:

    @Cassidy said:
    Is it a language to develop applications in a web server, or it is a web server itself?

    /confused.

    Is Java a programming language or a virtual machine to run code from various programming languages? Oh it's both?

    You might be confused, but this naming isn't exactly new. Sun was confusing the fuck out of people back in 1995.

    Java is a programming language. The virtual machine is JVM. See that VM part? That means virtual machine.


  • @El_Heffe said:

    It's a floor wax and a dessert topping.
     

    It's not butter, though, which is a little hard to believe.


Log in to reply