This is part of the .NET Core and VS Code series, which contains:
Since the release of .NET Core 1.1, a lot has changed, so I am trying to keep this up to date as much as possible, but there still might be some leftover obsolete info from earlier versions.


So .NET Core was released and I started wondering if I could go full in, ignoring the usual way to work with .NET (you know, framework, Visual Studio, ReSharper, all that wonderful jazz). Well, five minutes in and I am worried. It looks like someone is trying to sell me developing in online editors packaged in a skinny app, just so that I run away scared back to the full Visual Studio paid stack. Yet, I'm only five minutes in, so I am going to persevere.

Installation


Getting started (on Windows) involves three easy steps:
  1. Download and install the .NET Core SDK for Windows (if you want the complete Core, that works with Visual Studio, go here for more details. This is the freeware version of getting started :) )
  2. Download and install Visual Studio Code which ironically needs .NET 4.5 to run.
  3. After running Code, press Ctrl-P and in the textbox that appears write 'ext install csharp', wait for a dropdown to appear and click on the C# for Visual Studio Code (powered by Omnisharp) entry to install support for C#

Now you understand why I am a little worried. By default, VS Code comes with built-in support for JavaScript, TypeScript and Node.js. That's it!

Visual Studio Code overview


Next stop, read up on how Code works. It's a different approach than Visual Studio. It doesn't open up projects, it opens up folders. The project, configuration, package files, even the settings files for Code itself, are json, not XML. The shortcut you used earlier is called Quick Open and is used to install stuff, find files, open things up, etc. Another useful shortcut is F1, which doesn't pop up some useless help file, but the Command Palette, which is like a dropdown for menu commands.

And, of course, as for any newly installed software, go immediately to settings and start customizing things. Open the File menu, go to Preferences and open User Settings and you will be amazed to see that instead of a nice interface for options you get two side-by-side json files. One is with the default settings and the other one is for custom settings that would override defaults. Interestingly, I see settings for Sass and Less. I didn't see anything that needed changing right from the start, so let's go further.

Another thing that you notice is the left side icon bar. It contains four icons:
  • Explorer - which opens up files and probably will show solutions
  • Search - which helps you search within files
  • Debug - I can only assume that it debugs stuff
  • Git - So Git is directly integrated in the code editor, not "source control", just Git. It is an interesting statement to see Git as a first class option in the editor, while support for C# needs to be installed.

Hello world! - by ear


A little disappointing, when you Open a Folder from Explorer, it goes directly to My Documents. I don't see a setting for the initial projects folder to open. Then again, maybe I don't need it. Navigate to where you need to, create a new folder, open it up. I named mine "Code Hello World", because I am a creative person at heart. Explorer remains open in the left, showing a list of Working Files (open files) and the folder with some useful options such as New File, New Folder, Refresh and Collapse All. Since we have opened a folder, we have access to the File → Preferences → Workspace Settings json files, which are just like the general Code settings, only applying to this one folder. Just opening the files creates a .vscode/settings.json empty file.

Let's try to write some code. I have no idea what I should write, so let's read up on it. Another surprise: not many articles on how to start a new project. Well, there is something called ASP.Net Core, which is another install, but I care not about the web right now. All I want is write a short Hello World thing. There are some pages about writing console applications with Code on Macs, but you know, when I said I am a creative person I wasn't going that far! I go to Quick Open, I go to the Command Palette, nothing resembling "new project" or "console app" or "dotnet something". The documentation is as full of information as a baby's bottom is full of hair. You know what that means, right? It's cutting edge, man! You got to figure it out yourself!

So let's go from memory, see where it gets us. I need a Program.cs file with a namespace, a Program class and a static Main method that accepts an array of strings as a first argument. I open a new file (which also gets created under the .vscode folder) and I write this:
namespace CodeHelloWorld
{
public class Program {
static void Main(string[] args) {
Console.WriteLine("Hello World!");
}
}
}
I then go to the Debug icon and click it.
It asks me to select the environment in which I will debug stuff: NodeJS, the Code extension environment and .Net Core. I choose .Net Core and another configuration file is presented to me, called launch.json. Now we are getting somewhere! Hoping it is all good - I am tired of all this Linuxy thing - I press the green Debug arrow. Oops! It appears I didn't select the Task Runner. A list of options is presented to me, from which two seem promising: MSBuild and .NET Core. Fuck MSBuild! Let's go all Core, see if it works.

Choosing .NET Core creates a new json file, this time called tasks.json, containing a link to documentation and some settings that tell me nothing. The version number for the file is encouraging: 0.1.0. Oh, remember the good old Linux days when everything was open source, undocumented, crappy and everyone was cranky if you even mentioned a version number higher or equal to 1?

I press the damn green arrow again and I get another error: the preLaunchTask "build" terminated with exit code 1. I debug anyway and it says that I have to configure launch.json program setting, with the name of the program I have to debug. BTW, launch.json has a 0.2.0 version. Yay! Looking more carefully at the launch.json file I see that the name of the program ends with .dll. I want an .exe, yet changing the extension is not the only thing that I need to do. Obviously I need to make my program compile first.

I press Ctrl-P and type > (the same thing can be achieved by Ctrl-Shift-P or going to the menu and choosing Command Palette) and look for Build and I find Tasks: Run Build Task. It even has the familiar Ctrl-Shift-B shortcut. Maybe that will tell me more? It does nothing. Something rotates in the status bar, but no obvious result. And then I remember the good old trusty Output window! I go to View and select Toggle Output. Now I can finally see what went wrong. Can you guess it? Another json file. This time called project.json and having the obvious problem that it doesn't exist. Just for the fun of it I create an empty json file and it still says it doesn't exist.

What now? I obviously have the same problem as when I started: I have no idea how to create a project. Armed with a little bit more information, I go browse the web again. I find the documentation page for project.json, which doesn't help much because it doesn't have a sample file, but also, finally a tutorial that make sense: Console Application. And here I find that I should have first run the command line dotnet new console in the folder I created, then open the project with VS Code.

Hello world! - by tutorial


Reset! Close Code, delete everything from the folder. Also, make sure - if you run a file manager or some other app and you just installed .NET Core - that you have C:\Program Files\dotnet\ in the PATH. Funny thing: the prompt for deleting some files from Code is asking whether to send them to Recycle Bin. I have Recycled Bin disabled, so it fails and then presents you with the option to delete them permanently.

Now, armed with knowledge I go to the folder Code Hello World, run the command 'dotnet new console' ("console" is the name of the project template. Version 1.0 allowed you to omit the template and it would default to console. From version 1.1 you need to specify it explicitly) and it creates a project.json .csproj file (with the name of the folder you were in) and a Program.cs file that is identical to mine, if you count the extra using System line. I run 'dotnet restore', 'dotnet build' and I notice that obj and bin folders have been created. The output, though, is not an exe file, but a dll file. 'dotnet run' actually runs as it should and displays "Hello, World!".

Let's open it with Code. I get a "Required assets to build and debug are missing from your project. Add them?" and I say Yes, which creates the .vscode folder, containing launch.json and tasks.json. Ctrl-Shift-B pressed and I get "Compilation succeeded." Is it possible that now I could press F5 and see the program run? No, of course not, because I must "set up the launch configuration file for my application". What does it mean? Well, apparently if I go to the Debug icon and press the green arrow icon (that has the keyboard shortcut F5) the program does run. I need to press the button for the Debug Console that is at the top of the Debug panel to see the result, but it works. From then on, pressing F5 works, too, no matter where I am.

Unconvinced by the whole thing, I decide to do things again, but this time do as little as possible from the console.

Hello world! - by Code


Reset! Delete the folder entirely and restart Visual Studio code. Then proceed with the following steps:
  1. Go to the Explorer icon and click on Open Folder (or FileOpen Folder)
  2. Create a Code Hello World folder
  3. Right click under the folder in Explorer and choose Open in Command Prompt - if you have it. Some Windows versions removed this option from their context menu. If not, select Open in New Window, go to the File menu and select Open Command Prompt (as Administrator, if you can) from there
  4. Write 'dotnet new console' in the console window, then close the command prompt and the Windows Explorer window, if you needed it
  5. Select the newly created Code Hello World folder
  6. From the open folder, open Program.cs
  7. To the warning "Required assets to build and debug are missing from your project. Add them?" click Yes
  8. To the info "There are unresolved dependencies from '<your project>.csproj'. Please execute the restore command to continue." click Restore
  9. Click the Debug icon and press the green play arrow

That's it!


But let's discuss one poignantly ridiculous part of the step list. Why did we have to open and close the folder? It is in order to get that prompt to add required assets. If you try to run the app without doing that, Code will create a generic launch.json file with placeholders instead of actual folder names. Instead of
{
"version": "0.2.0",
"configurations": [
{
"name": ".NET Core Launch (console)",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "${workspaceRoot}/bin/Debug/netcoreapp1.0/Code Hello World.dll",
"args": [],
"cwd": "${workspaceRoot}",
"externalConsole": false,
"stopAtEntry": false
},
{
"name": ".NET Core Attach",
"type": "coreclr",
"request": "attach",
"processId": 0
}
]
}
you get something like
{
"version": "0.2.0",
"configurations": [
{
"name": ".NET Core Launch (console)",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "${workspaceRoot}/bin/Debug/<target-framework>/<project-name.dll>",
"args": [],
"cwd": "${workspaceRoot}",
"stopAtEntry": false,
"externalConsole": false
},
{
"name": ".NET Core Launch (web)",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "${workspaceRoot}/bin/Debug/<target-framework>/<project-name.dll>",
"args": [],
"cwd": "${workspaceRoot}",
"stopAtEntry": false,
"launchBrowser": {
"enabled": true,
"args": "${auto-detect-url}",
"windows": {
"command": "cmd.exe",
"args": "/C start ${auto-detect-url}"
},
"osx": {
"command": "open"
},
"linux": {
"command": "xdg-open"
}
},
"env": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
{
"name": ".NET Core Attach",
"type": "coreclr",
"request": "attach",
"processId": 0
}
]
}
and a warning telling you to configure launch.json. It only works after changing the program property to '/bin/Debug/netcoreapp1.0/Code Hello World.dll' and, of course, the web and attach configuration sections are pointless.


Debugging


I placed a breakpoint on Console.WriteLine. The only declared variable is the args string array. I can see it in Watch (after adding it by pressing +) or in the Locals panel, I can change it from the Debug Console. I can step through code, I can set a condition on the breakpoint. Nothing untoward here. There is no Intellisense in the Debug Console, though.

In order to give parameters to the application in debug you need to change the args property of launch.json. Instead of args:[], something like args:["test",test2"]. In order to run the application from the command line you need to run it with dotnet, like this: dotnet "Code Hello World.dll" test test2.

Conclusion


.Net Code is not nearly ready as a comfortable IDE, but it's getting there, if enough effort will be put into it. It seems to embrace concepts from both the Windows and Linux world and I am worried that it may gain traction with neither. I am yet to try to build a serious project though and next on the agenda is trying an ASP.Net Core application, maybe a basic API.

While I am not blown away by what I have seen, I declare myself intrigued. If creating extensions for Code is easy enough, I may find myself writing my own code editor tools. Wouldn't that be fun? Stay tuned for more!

Just when I thought I don't have anything else to add, I found new stuff for my Chrome browser extension.

Bookmark Explorer now features:
  • configurable interval for keeping a page open before bookmarking it for Read Later (so that all redirects and icons are loaded correctly)
  • configurable interval after which deleted bookmarks are no longer remembered
  • remembering deleted bookmarks no matter what deletes them
  • more Read Later folders: configure their number and names
  • redesigned options page
  • more notifications on what is going on

The extension most resembles OneTab, in the sense that it is also designed to save you from opening a zillion tabs at the same time, but differs a lot by its ease of use, configurability and the absolute lack of any connection to outside servers: everything is stored in Chrome bookmarks and local storage.

Enjoy!

I have created a Facebook page for the blog, so if you are tired by my Facebook ramblings and only need the updates for this blog, you can subscribe to it. You may find it here.

Also, I've discovered a bad bug with the chess viewer: it didn't allow manual promotions. If you tried to promote a pawn it would call a component that was not on the page (an ugly component) and then it wouldn't promote anyway because of a bug in the viewer. Hopefully I've solved them both. It mainly affected puzzles like the one I posted today.

and has 0 comments
White to move. Can you draw? Can you win? What would you do? Try - I know it's fucking hard, but do it anyway - to think it through.
[FEN "5kB1/3p1P2/7K/2Pp1P1P/p6p/4P3/7P/8 w - - 0 1"]
1. Kg6 a3 2. h6 a2 3. h7 a1=Q 4. h8=Q Qxh8 (4. .. Qg1+ 5. Kh5 Qxe3 (5. ..
Qg7 6. Qxg7+ Kxg7 7. Kxh4 d4 8. f6+ Kf8 9. c6) 6. Qf6 Qf3+ 7. Kh6 Qf4+ 8.
Kh7) 5. f6 h3 6. Kg5 d4 7. c6 dxc6 8. exd4 c5 (8. .. Qxg8+ 9. fxg8=Q+ Kxg8
10. Kg6 Kf8 11. f7 Ke7 12. Kg7) (8. .. Qh7 9. Bxh7 Kxf7 10. Bg8+ Kxg8 11.
Kg6 Kf8) 9. d5 c4 10. d6 c3 11. d7 c2 12. d8=Q# 1-0


Here is the video for it, from very good channel ChessNetwork:


Enjoy!

Clippy is back, thanks to this nice project. So what else could I have done than add it to my blog? Just go to Menu and choose your "Assistant".

If the assistant is set, the messages from the blog come from the assistant. It also follows the mouse as it moves around and does various gestures depending on what one does or reads. Have fun!

and has 0 comments
I will give you this as a puzzle, so please try to figure out that White's move is going to be. This and a lot of cool other puzzles are presented by IM Andrew Martin in the following video.

[Event "Ch URS"]
[Site "Moscow"]
[Date "1956.??.??"]
[Result "1-0"]
[White "Tigran Vartanovich Petrosian"]
[Black "Vladimir Simagin"]
[ECO "A53"]
[PlyCount "95"]

1. Nf3 Nf6 2. c4 c6 3. Nc3 d6 4. d4 g6 5. e4 Bg7 6. Be2 O-O
7. O-O Bg4 8. Be3 Nbd7 9. Nd2 Bxe2 10. Qxe2 e5 11. d5 c5
12. Rab1 Ne8 13. f3 f5 14. b4 cxb4 15. Rxb4 b6 16. a4 Bf6
17. Kh1 Bg5 18. Bg1 Nc7 19. Rbb1 Na6 20. Nb3 Ndc5 21. Nxc5
bxc5 22. exf5 gxf5 23. g4 fxg4 24. Ne4 Bf4 25. Rb7 Nc7
26. fxg4 Ne8 27. g5 Qc8 28. Re7 Qh3 29. Rf3 Qg4 30. Qd3 Bxh2
31. Rxf8+ Kxf8 32. Rxe8+ Rxe8 33. Bxh2 Re7 34. Nxd6 Qxg5
35. Qf1+ Kg8 36. Ne4 Qh4 37. Qe2 Rg7 38. d6 Qh6 39. Qd1 Qh4
40. Qe2 Qh6 41. Qf1 Rf7 42. Qg2+ Kf8 43. Ng5 Qxd6 44. Qa8+ Kg7
45. Bxe5+ Qxe5 46. Qh8+ Kxh8 47. Nxf7+ Kg7 48. Nxe5 1-0


Did you find it? I have to admit I did not. The game is Tigran Vartanovich Petrosian vs Vladimir Simagin, played in 1956.

[well, no following video, because YouTube just randomly removes content without any way of knowing what it was]

and has 0 comments
Every Heart a Doorway started well. Here is this girl that arrives at a specialized institution for "wayward children" - runaways, boys and girls that somehow don't fit into the slot their parents have prepared for them. Like many young adult stories, the main protagonists are young people into a place that accepts them as they are, but is still formal, with strict boundaries. In this case the idea was that the youngsters each have found the door to another world, a world that not only is completely different from ours, but is perfect for them. They have spent some time in it, only to accidentally leave or to be thrown out, with no way to return. After some times years in that place, changed to their deepest core, it is difficult to readapt to the real world, which makes their parents send them to this kind of institution.

From here, though, Seanan McGuire just piles up the tropes, while the careful writing style and setup from the beginning of this short 173 page story decays into a rushed and inconsistent ending. Just like Hogwarts, the house is managed with ancient British style rules, fixed meals, absolute authority, etc. There are children and there are adult teachers. The headmistress is someone who went through the same thing and decided to help others, but outside of that she's just as certain of her point of view and as self righteous as any of the parents that abandoned their offspring there.

And there is this... style, this way of describing the interaction of characters, which annoyed the hell out of me, without being bad as a writing style. You see, the young girl that arrives at the institution is time after time met by people who finish her sentences for her, show her that they think they know better than her, and she accepts it, just because she's the new girl. With that level of meek submission, I wonder why her parents ever wanted her gone. Her perfect world - a place of the dead where she was a servant of royalty and the skill she had learned best was to stay completely still for hours lest she upsets the lord of the dead - was also about total submission, and she loved it there. Most of the people that explored other worlds were similarly bonded to dominant characters that have absolute control over them.

In the end, children start to get killed and the response of "the authorities" is to hide the bodies and instruct youngsters to stay in groups, while the main characters suddenly can use their skills in the real world, as it was completely normal, but fail to use them properly to find the obvious killer. The scene where a skeleton tries to tell them who the murderer is - even if that should not have been possible in the real world - but can only point a finger, so they give up after one attempt of communication is especially sour in my mind.

So yeah, I didn't like the book. I felt it was a cheap mashup of Harry Potter and 50 Shades of Grey, polluted by the author's fantasies of submission and not much in the way of plot or characters. And it's too bad, since I liked the premise immediately.

and has 0 comments
I've quickly finished the second volume, Metro 2034, by Dmitry Glukhovsky, in the Metro series of books, after reading and being captivated by Metro 2033. To me it felt more geared towards the sci-fi and the writing lore than towards the social satire from the first book. It felt less. There are fewer main characters, fewer stations, less character development, less monsters. The few people that do populate the book are so archetypal that even the author acknowledges it in the guise of a character nicknamed Homer, an old guy that searches for stories and sees his entire adventure an odyssey to be written in a book and his companions filling up the roles of Warrior and Princess and Bard.

Don't get me wrong, I liked it a lot, but I felt that the first book acted as a caricature of current society, with its many stations that each adhered to some philosophy or another, while the second veered quite a large distance from that and went purely towards the catacomb sci-fi thriller. There is still enough philosophical discourse in Homer's musings and it is interesting to see the post apocalyptic world seen through the eyes of someone that lived before as well as with fresh eyes: a girl that only knew one station her whole life. But the book was tamer and I am not the only one to think that.

Now, I scoured the net for some Metro 2035 love, but to no avail. I found a Polish audio book, but nothing else. It is ridiculous how much one has to wait to get a translation of a book written in Russian or how difficult it is to get even the original Russian text.

and has 0 comments
I've heard of Metro 2033 from a movie link that said Hollywood wants to adapt the book as a feature film, which in fact is really ridiculous: not only is the book famous, it has several sequels, it spawned a video game franchise and many authors have join to write inside a shared Metro universe. So how didn't I know about it? The reason, of course, is that it is written by a Russian: Дмитрий Глуховский. The book was published in 2005 in Russia, but only in 2010 was it published in the US, similar to how Japanese movies or other culturally different art trickles to the predominantly English culture. Meanwhile, the concept has grown so much that there are more than thirty books written in the universe. It's like falling down a rabbit hole. I used to love Russian sci-fi when I was a child and I have not realized how much I missed it until I started reading this book: simple people yet complex characters, with deep philosophical concerns, problems that are rarely solved through sheer force, depressing settings where everything falls apart yet makes people strong and interesting and puts them in the foreground.

Metro 2033 describes a parallel universe where World War III has happened and the few Russian survivors have hidden in the large network of the Moscow subway system. Radiation, biological weapons and other factors have turned the surface into a toxic place, filled with monstrous mutants and terrible creatures, while underground each metro station has developed its own unique culture and mythology. The beauty of the book is that it reads more like a satire of the history of the world and less than a post apocalyptic story. There are religious fanatics, fascists, communists, people who have rejected technology and others that value knowledge and books more than anything else, traders and mystics and people with strange powers. I felt that the author himself didn't really mean to create a credible after war world, as he didn't linger on where the power comes from or how the food is grown or other such technical details, instead focusing on the human spirit, the many myths created to explain the state of the world and radiographed the world in this pathetic microcosm made of barely surviving people.

Somewhere in the middle of the book I got a little bored. I have to admit that the long paragraphs and the many details of some scenes make for difficult reading if you are not in the mood. I loved the book while reading it at night, but had trouble focusing when trying to read on the street or when walking the dog. Yet by the end I am really glad I read the book. I can't imagine reading next anything other than the sequels and I lament the very real possibility that I might delve into the other dozens of books and short stories written by other authors in the same world.

In order to explore the world of Metro 2033, you may start at the Metro2033 web site, of course, where there are beautiful 360 photos of the current Moscow subway stations. Also, you may try the game, which feels a bit dated from the promotional videos, but apparently has a good plot. Of course, exploring the book universe sounds like a better idea, yet most of the spinoffs have not yet been translated into English. Perhaps this is a good opportunity to start reading in Russian...

Bookmark Explorer, a Chrome browser extension that allows you to navigate inside bookmark folders on the same page, saving you from a deluge of browser tabs, has now reached version 2.4.0. I consider it stable, as I have no new features planned for it and the only changes I envision in the near future is switching to ECMAScript 6 and updating the unit test (in other words, nothing that concerns the user).

Let me remind you of its features:

  • lets you go to the previous/next page in a bookmark folder, allowing sequential reading of selected news or research items
  • has context menu, popup buttons and keyboard shortcut support
  • shows a page with all the items in the current bookmark folder, allowing selection, deletion, importing/exporting of simple URL lists
  • shows a page with all the bookmarks that were deleted, allowing restoring them, clearing them, etc.
  • keyboard support for both pages
  • notifies you if the current page has been bookmarked multiple times
  • no communication with the Internet, it works just as well offline - assuming the links would work offline, like local files
  • absolutely free


Install it from Google's Chrome Web store.

I have been using Disqus as a commentator for some time and yes, it is a bit bloated and yes, it writes all kinds of errors in the console, but it has a big advantage that you have all your comments and replies in a single place. When you go to a Disqus enabled web site you see a warning that you have unread messages. So from now on, my blog is using Disqus as its comment engine. While doing this, I've also updated some layout and code, so let me know if anything is wrong.

So there it is. Tell me what you think! Preferably in the comment section.

and has 0 comments
Liu Cixin is Chinese, which makes reading his work not only a pleasant science fiction pastime, but also an intercultural experience. That is because Chinese people are weeeeird :). Just kidding, but it does make for an interesting experience. Even with good English translation, the mindset behind the writing is clearly different from the Western writers I usually read.

I have read Devourer first, a short story, to see if I enjoy the writing style, then I read the first two books in the Remembrance of Earth series: The Three-Body Problem and The Dark Forest. It is clear that the author likes to think big, some even compared him with Arthur C. Clarke. In both stories Earth enters in contact with alien species which are vastly superior and devastatingly indifferent to the fate of the human race. While Devourer really reads like a Chinese story, you know with the emperor and the adviser and so on, it retains the same fear of irrelevance as the huge books in the trilogy.

To me it felt like The Three-Body Problem was more accessible, while The Dark Forest has a change of pace and style, but it very well may be because of the translator. It was easier to imagine scenes from Asian movies - with people shouting hysterically at each other to prove their loyalty to one group or the other and "generals" and all that jazz - while reading the second book than the first. Even so, throughout the reading I had these weird feelings of wrongness sometimes when things happened in a certain way because the protagonists were Chinese. Yet this was not relevant to the story or the enjoyment of the books. Also many Chinese cultural references were both instructive and eye opening. As an example, The Three-Body Problem starts in the middle of the Chinese Cultural Revolution which is just as appalling, if not more so, as our Nazi era.

I cannot talk about the stories without spoiling them too much, so I won't. Enough to say that they are all hard sci-fi, even if some of the elements there are not so scientifically accurate. Clearly for Liu Cixin the story took precedence to high technology, which is a good thing.

The third book in the trilogy, Death's End, will allegedly appear September 2016, from Tor Books. However, I have mixed feelings about it. The story almost ended with the second book. Do I really care what happens next? Will it be relevant or just the typical three book publishing deal forced the author's hand? There are some questions that remain unanswered and I would be glad to see a clarification in this upcoming book, but will they be enough to flesh a great story?

...is stupid.

For a very long time the only commonly used expression of software was the desktop application. Whether it was a console Linux thing or a full blown Windows application, it was something that you opened to get things done. In case you wanted to do several things, you either opted for a more complex application or used several of them, usually transferring partial work via the file system, sometimes in more obscure ways. For example you want to publish a photo album, you take all pictures you've taken, process them with an image processing software, then you save them and load them with a photo album application. For all intents and purposes, the applications are black boxes to each other, they only connect with inputs and outputs and need not know what goes on inside one another.

Enter the web and its novel concept of URLs, Uniform Resource Locators. In theory, everything on the web can be accessible from the outside. You want to link to a page, you have its URL to add as an anchor in your page and boom! A web site references specific resources from another. The development paradigm for these new things was completely different from big monolithic applications. Sites are called sites because they should be a place for resources to sit in; they are places, they have no other role. The resources, on the other hand, can be processed and handled by specific applications like browsers. If a browser is implemented in all operating systems in the same way, then the resources get accessed the same way, making the operating system - the most important part of one's software platform - meaningless. This gets us to this day and age when an OS is there to restrict what you can do, rather than provide you with features. But that's another story altogether.

With increased computing power, storage space, network speeds and the introduction and refining of Javascript - now considered a top contender for the most important programming language ever - we are now able to embed all kinds of crazy features in web pages, so much so that we have reached a time when writing a single page application is not only possible, but a norm. They had to add new functionality to browsers in order to let the page tweak the browser address without reloading the page and that is a big deal! And a really dumb one. Let me explain why.

The original concept was that the web would own the underlying mechanism of resource location. The new concept forces the developer to define what a resource locator means. I can pretty much make my own natural language processing system and have URLs that look like: https://siderite.com/give me that post ranting about the single page apps. And yes, the concept is not new, but the problem is that the implementation is owned by me. I can change it at any time and, since it all started from a desire to implement the newest fashion, destined to change. The result is chaos and that is presuming that the software developer thought of all contingencies and the URL system is adequate to link to resources from this page... which is never true. If the developer is responsible for interpreting what a URL means, then it is hardly "uniform".

Another thing that single page apps lead to is web site bloating. Not only do you have to load the stuff that now is on every popular website, like large pointless images and big fonts and large empty spaces, but also the underlying mechanism of the web app, which tells us where we are, what we can do, what gets loaded etc. And that's extra baggage that no one asked for. A single page app is hard to parse by a machine - and I don't care about SEO here, it's all about the way information is accessible.

My contention is that we are going backwards. We got the to point where connectivity is more important than functionality, where being on the web is more important than having complex well done features in a desktop app. It forced us to open up everything: resources, communication, protocols, even the development process and the code. And now we are going back to the "one app to rule them all" concept. And I do understand the attraction. How many times did I dream of adding mini games on my blog or make a 3D interface and a circular corner menu and so on. This things are cool! But they are only useful in the context of an existing web page that has value without them. Go to single page websites and try to open them with Javascript disabled. Google has a nice search page that works even then and you know what? The same page with Javascript is six times larger than the one without - and this without large differences in display. Yes, I know that this blog has a lot of stuff loaded with Javascript and that this page probably is much smaller without it, but the point it that the blog is still usable. For more on this you should take the time to read The Web Obesity Crisis, which is not only terribly true, but immensely funny.

And I also have to say I understand why some sites need to be single page applications, and that is because they are more application than web site. The functionality trumps the content. You can't have an online image processing app work without Javascript, that's insane. You don't need to reference the resource found in a color panel inside the photo editor, you don't need to link to the image used in the color picker and so on. But web sites like Flipboard, for example, that display a blank page when seen without Javascript, are supposed to be news aggregators. You go there to read stuff! It is true we can now decide how much of our page is a site and how much an application, but that doesn't mean we should construct abominations that are neither!

A while ago I wrote another ranty rant about how taking over another intuitively common web mechanism: scrolling, is helping no one. These two patterns are going hand in hand and slowly polluting the Internet. Last week Ars Technica announced a change in their design and at the same time implemented it. They removed the way news were read by many users: sequentially, one after the other, by scrolling down and clicking on the one you liked, and resorted to a magazine format where news were just side by side on a big white page with large design placeholders that looked cool yet did nothing but occupy space and display the number of comments for each. Content took a backseat to commentary. I am glad to report that two days later they reverted their decision, in view of the many negative comments.

I have nothing but respect for web designers, as I usually do for people that do things I am incapable of, however their role should always be to support the purpose of the site. Once things look cool just for the sake of it, you get Apple: a short lived bloom of user friendliness, followed by a vomitous explosion of marketing and pricing, leading to the immediate creation of cheaper clones. Copying a design because you think is great is normal, copying a bunch of designs because you have no idea what your web page is supposed to do is just direct proof you are clueless, and copying a design because everyone else is doing it is just blindly following clueless people.

My advice, as misguided as it could be, is forget about responsiveness and finger sized checkboxes, big images, crisp design and bootstrapped pages and all that crap. Just stop! And think! What are you trying to achieve? And then do it, as a web site, with pages, links and all that old fashioned logic. And if you still need cool design, add it after.

I've written another Chrome extension that I consider in beta, but so far it works. Really ugly makeshift code, but I am not gathering data about the way I will use it, then I am going to refactor it, just as I did with Bookmark Explorer. You may find the code at GitHub and the extension at the Chrome webstore.

This is how it works: Every time you access anything with the browser, the extension will remember the IPs for any given host. It will hold a list of the IPs, in reverse order (last one first), that you can just copy and paste into your hosts file. The hosts file is found in c:/Windows/System32/drivers/etc/hosts and on Linux in /etc/hosts. Once you add a line in the format "IP host" in it, the computer will resolve the host with the provided IP. Every time there is a problem with DNS resolution, the extension will add the latest known IP into the hosts text. Since the extension doesn't have access to your hard drive, you need to edit the file yourself. The icon of DNS resolver will show the number of hosts that it wants to resolve locally or nothing, if everything is OK.

The extension allows manual selection of an IP for a host and forced inclusion or exclusion from the list of IP/host lines. Data can be erased (all at once for now) as well. The extension does not communicate with the outside, but it does store a list of all domains you visit, so it is a slight privacy risk - although if someone has access to the local store of a browser extension, it's already too late. There is also the possibility of the extension to replace the host with IP directly in the browser requests, but this only works for the browser and fails in case the host name is important, as in the case of multiple servers using the same IP, so I don't recommend using it.

There are two scenarios for which this extension is very useful:
  • The DNS server fails for some reason or gives you a wrong IP
  • Someone removed the IP address from DNS servers or replaced it with one of their own, like in the case of governments censorship

I have some ideas for the future:
  • Sharing of working IP/host pairs - have to think of privacy before that, though
  • Installing a local DNS server that can communicate locally with the extension, so no more hosts editing - have to research and create one
  • Upvoting/Downvoting/flagging shared pairs - with all the horrible head-ache this comes with

As usual, let me know what you think here, or open issues on GitHub.

and has 0 comments
Neal Stephenson is known for writing speculative science fiction with focus on technological advancements and Seveneves is all about space. He thought about the idea in 2006, while he was an adviser with Blue Origin and he let the idea fester for years, while getting feedback from all kinds of people knowledgeable about and invested in space technology, like Planetary Resources, so at least the science is good. Personally, I believe that he gathered so much material that he just had to write the book, regardless if he had a story to tell or not. Never have I read a book that is so obviously written by an engineer, with long descriptions about how space stuff works and how a culture is like or how people solve problems. It's all about the how, never about the why or the who. As such, I consider it a failed book, because it could have been so much better as a well thought, well edited trilogy of books, with compelling characters, rather than a humongous enumeration of space technologies.

The story is split into three parts, mostly unconnected: the cataclysm that dooms Earth in two years and the solution found by the people of the planet, the cataclysm and what people do afterwards and the aftermath, 5000 years into the future.

What happens is that the Moon suddenly gets splintered apart by some unknown agent, possibly a miniature black hole, which just breaks it into seven pieces (it already starts with the number 7), that are destined to further break in collisions with each other and cause a catastrophic meteor bombardment of Earth, heating its atmosphere and boiling and smashing away all life. People decide to invest everything into expanding the International Space Station, having a few thousand people escape certain death by going into space. Everything is done very orderly and the book focuses exclusively at what people do to reach the stars, with today's technology. Nothing about what 7 billion people (see? I can use seven all over the place, too) feel or do when faced with certain doom. The book continues quickly over the inevitable deaths and accidents caused by rushing into something that is not really researched, proceeding towards a part of the story where almost everything just works, as by magic. The devastating problems that people would face in space are solved quickly by engineering solutions, ignoring the unsolvable ones.

So far the book does have a sort of a main character, a woman working with robots, sent to the ISS as part of a partnership with an asteroid mining company. Before we know enough about her, the story shifts into its second part, which splits attention between several important characters. At this point it is almost impossible to empathize with anyone, a problem compounded by using personalities "slightly towards the Asperger side of the spectrum", as the author points out several times.

To continue explaining the story is pointless and would spoil it, enough said that even as I am an engineer and always complaining that there is not enough science in science fiction, I got really bored with reading this book. Long long (mobile) pages of two of three paragraphs each, containing no dialog, explaining things that had nothing to do with the story, puny and underfed as it was. The only thing that made me react emotionally was the villain of the second part, who was written well enough to make me hate. To add insult to injury, after fighting through the 880 (normal) pages, the third part just abruptly ends, like he was just tired of writing, now that the tech was all explained away and there was some human story there.

Bottom line: As someone interested in the technology necessary to colonize the Solar System, this book should have been gold. Instead, I caught myself skimming over the long descriptions, just wanting the book to end. Too bad, since the subject could have easily been split into three or even several books, each with their own story to tell in a well structured fictional universe. Also, while the author swears he was "peer reviewed" on the concepts, he also admits making huge leaps of faith over what would work or not.