Marius Gheorghe

Building software : make it work, make it good, make it fast

Universal Windows apps - risking the quality of the apps

I've played around for a bit with a Lumia device which run the latest Window 10 mobile. To be honest the entire switch to "Universal Windows apps" doesn't seem to great from a user perspective.

The main thing is that not matter how great the API is, it is HARD to make a app "work" from a 4 inch phone (using touch as input) to a Xbox One running on a 70' TV using a controller for input. Different device sizes and different input methods are usually handled differently so "hiding" all this under a API won't necessarily make the apps great.

Just look at Android, even after all these years you can still find apps which suck when are running on a tablet (they don't make proper use of the entire screen estate). Nevermind the fact the the OS still doesn't support basic features like running 2 apps side by side (never mind the Samsung hacks, that has his own share of problems).

To me, with the universal runtime , it seems Microsoft is risking to have more apps which are mediocre on multiple devices rather than fewer apps which run and work great on each device type. Windows Mobile /Windows 10 won't compete with Android / iOS regarding the number of apps anytime soon (if ever).

Is it worth risking the user experience for "many apps" ? Personally i don't think so.

Run Edge browser from command line / keyboard shortcut

I run all of my apps from keyboard shortcuts with AutoHotkey (great utility, i highly recommended), so i wanted to do the same thing with Edge.
But with Edge it's a bit tricky because it's a "modern/univeral app" and those types of apps require a certain unique server parameter when you invoke them, directly from command line.
But i've figured out that Edge registers it's own shell extension and we can use that to launch it. So directly it can be done like this :
powershell.exe "start microsoft-edge:"

Obviously feel free to either replace or delete the part.

Immutable collections in .NET

Dealing with immutable collections in .NET  is very easy with the help of the ImmutableCollections package on nuget .

Here's a example :

ImmutableList initial = ImmutableList.Empty;
ImmutableList immutableList = initial.Add("stuff");

Any operation on the collection will create a duplicate collection (so in the above example the "initial" collection is still empty).
Another much simple way would to be use the IReadCollection from .NET 4.5
List initial = Enumerable.Range(1, 10).ToList();
ReadOnlyCollection readOnlyCollection = initial.AsReadOnly();

Now you can pass readOnlyCollection and obviously the initial collection will remain unchanged.

Few thoughts on Jade templating language

I've started using Jade on a pet project a few weeks ago. It's a nice library that saves you a few keystrokes while writing HTML but, sadly, it still has 2 things i really dislike :

- it's too different from "regular" HTML to be picked up by beginners and thus creates a barrier to entry. Also the "size" savings are not that impressive compared with "regular" HTML.

- it allows embedding a subset of JS directly inside of markup which can easily become a pain in the ass to debug. Breaking separation of concerns is a big no no from my POV.

Sword of Destiny minireview

 sword of destiny

Ah, The Witcher series. "Sword of Destiny" is actually a standalone list of short stories (just like "The Last Wish"). Overall the stories and not that good compared with "The Last Wish" but there's a nice story there about Geralt meeting Ciri for the first time.

Recommended only if you read the Witcher saga, otherwise there's no point in reading it standalone.

The build script

Ah, the build + optional deploy script. The "thing" that turns whatever your compiler spits out into a zip/msi/whatever that you can actually install /pass along to customers. For build scripts i've started with batch files, C# , Powershell, moving to msbuild tasks (yeah, that was "fun" ), FAKE, to the node.js "task runner" framework du jour (Grunt, Gulp etc)  to finally get back to Powershell. 

  I still think the best solution for writing a build script is in a shell scripting language (Powershell, bash, whatever) because :

- when it will crash (and it will !!) you're debugging code written by you instead of fuzzing around with a stacktrace spitted up by some shitty Grunt plugin (for instance).

- ubiquity : only powershell/bash is required to run it (compared with node.js + npm + gulp + whatever other plugins you are using).

- simplest way to run 3rd party CLI apps as part of build process ( "& filePath args" and you're done).

- everything is in one place (no package.json, gruntfile(s) and so on). A single file that handles everything.

Curse of the necrarch minireview

Names are all wrong in the Warhammer fantasy universe. I mean, who calls a badass vampire "Radu" ? Seriously, it's a vampire not a baker.
Anyway, the premise in "Curse of the necrarch " is very straightforward : big fight between humans and undead. That's basically it. There is some "background" plot to this but it's not really that interesting (or sufficiently developed). Overall i'd say the books is kind of meh.

Blackhearts minireview


This is the first book i've read in the Warhammer fantasy setting. It's actually a collection of 3 stories "tied" together with 2 short ones. It's the story of a ragtag group of human soldiers who do different "jobs" for the Empire in exchange for their freedom. Overall the quality is okeish, nothing bad but nothing great either.

All http traffic should be encrypted

There was a interesting piece of news in the last few days. Basically China launched a DDOS attack on GitHub by rewriting the Baidu analytics code to point to a certain GitHub hosted project. Thus, all the sites (and their users) who run Baidu analytics code were contributing in DDOSing GitHub. Its another proof in a long list of issues that basically proves that the web would actually be better if all traffic would be encrypted by default. Not necessary reliant on Certificate Authorities for verification, just encrypted.

And it's also in sheer contrast with the sad state of affairs today regarding encryption when using self signed certificates. The browsers treat plain HTTP traffic (that your ISP can rewrite to include ads, look it up it happened) as "better" than traffic encrypted with a self signed certificate. That's why the Let's Encrypt initiative is so important.

Powder mage trilogy minireview

So i've found about these books while procrastinating on r/fantasy on reddit. The premise looked interesting (flintlock fantasy FTW) so i gave the books a shot. And boooom. These are the best books i've read in last few years. Interesting set of characters, great world building and magic system on top a gripping story. But the thing that was most impressive to me was the pacing. This trilogy has expert pacing. Really, once the story has its hooks into you, it's really hard to let go :)

I highly recommend these books to anyone. Also if you read them, they are a few published short stories set in the same universe as the "main books". I've read all of them , they are pretty good but i highly recommend reading at least "Fornsworn" and "Servant of the crown".

Dune / Dune Messiah minireview

dune    dune messiah

Just reading the classics. Although scifi is not my favorite genre, it makes sense to read what is apparently ranked as the world's best-selling science fiction novel. Overall i enjoyed the first book. I wouldn't go as far as say it's a "great book" , but it's enjoyable. I enjoyed the characters, world building and the environment/ecology part of the story (apparently Dune is the first book which deals with the environment/ecology subject). The story both drags in some parts and rushes in the other (especially in the second half) but it's not that bad.

Dune Messiah, on the other hand, it's a completely different kind of book. I understood why the book is written like that (the whole book basically "deals" with the psychological state of the main character after the events of the first book) but , in the end, the book is very different from the first one. It (mostly) lacks "action" and the tone is very different from the first one (not in a good way).

Overall, i'd say the first 2 books are not good enough to make me want to read the rest of them.

Backup up GDrive to Dropbox

So i've found out that Dropbox and OneDrive actually support junction points . That basically means you can backup your GDrive and OneDrive folder to Dropbox (for instance) .

To make this work you only need to create a NTFS junction point. For instance if you want to backup GDrive to Dropbox :

mklink /j "c:\dropbox\gdrive" "c:\users\blah\google drive"

Obviously fix the paths from the example. This will create the junction point "gdrive" in the dropbox folder which will point to the original GDrive folder and Dropbox will happily sync the content of the GDrive folder.

Neat, huh ?