Saturday, February 11, 2017

VS Is Becoming Worse & Worse...

Recently, I tried, using VS 2015 Community, to create a simple Xamarin Forms app. All I did was select the standard template, and then tried to run the Android program. Didn't work ...

I don't remember the details, but rather than go through the tedious repair/uninstall process with VS 2015, I thought I'd try to install the VS 2017 Community Beta. I selected the standard template for Xamarin and then got this:

Not entirely encouraging ...
So I stopped VS 2107 and re-opened it. Then created the project again. I removed the iOS project, as I don't have a Mac, and don't want to see the "no mac" error window all the time. The Android project is the default start project. No error about packages this time. So I did a clean/rebuild of the solution. Here's the first error in the list of 3780!

Severity Code Description Project File Line Suppression State
Error CS0012 The type 'Object' is defined in an assembly that is not referenced. You must add a reference to assembly 'mscorlib, Version=, Culture=neutral, PublicKeyToken=7cec85d7bea7798e'. DemoXamarinForms.Droid C:\repos\DemoCode\DemoXamarinForms\DemoXamarinForms\DemoXamarinForms.Droid\MainActivity.cs 7 Active

So first error is that mscorlib is not in any of the assemblies in the reference list for the Android project.

Does anyone do any testing at Microsoft anymore? It seems that since they went to this "open source" model, all they do is post s**t with the attitude "Well, this ought to work. If it doesn't the users will let us know ..."

As DJT might tweet: "SO SAD"...

Monday, May 30, 2016

Living Far From the Edge ...

I've been using Windows 10 for quite some time now. It's running on an "older" machine - a Dell Studio 1555 with one of the early duo core CPU's, the "Intel Mobile Core 2 Duo  T6600". It doesn't support hyperthreading (which is another problem for me), and runs at about 2.1GHz. Not too bad, and I upgraded it sometime ago with a 500GB SSD, and a total of 8GB RAM. Oh, and an FHD, non-touch, LCD display. I'm actually pretty impressed that Win 10 works very reliably on this 5+ year old machine.

The Edge browser, on the other hand, is still just one more piece of crap from what is turning into a longer and longer line of crap from Microsoft. My complaints about Edge basically come down to two:
  • I can't change the "new tab" page to be my own home page.
  • I can't block all the fracking ads and trackers from loading that turn the browser into a dog-shit slow lump of lead.
As it turns out, I like Bing, and I use Bing as my home page in all my browsers. In IE, I could specify what page I wanted opened when I clicked on the "new tab" button.  While Firefox and Chrome don't have that feature natively, I could install some simple extensions that allow me to fix that problem.

Similarly, I use Ghostery to block useless intrusive ads and trackers - my other browsers load MUCH faster than Edge.

While I like the Edge interface, the lack of control about what I am presented is just too big a disappointment.

Good luck with all that "We are in control" bullshit, Microsoft. It might work in China ...

Saturday, December 5, 2015

Typescript Turmoil in VS Code!

Recently, at work, we've switched from ASP.NET MVC development to AngularJS / Nodejs. It's been a bit of a struggle, and a decision that was outside my purview. Nevertheless, learning something new is always good, and it seems that MS is joining the MEAN camp part way by supporting Node, Angular, and Express with their suite of Visual Studio products. I believe you can also have a Mongo instance in Azure, but don't quote me on that - could be a senior moment ....

Unfortunately, with great complexity, comes great confusion...

At first, I simply added the Nodejs tools to Visual Studio 2013. That seemed to work ok, but at work we're using WebStorm. Visual Studio with Node simply seems to make projects and applications in a different enough way that it wasn't helping me with work. So I installed VS Code. I tried for weeks (part time at home on the weekends while managing family obligations) to get VS Code to do something as simple as build a one file .ts application. Finally, after banging my head against the wall (figuratively), I have gotten it to work. Hopefully, I can save some people some bruising ...

There were two salient factors that made my life so miserable for so long.

  • If you have installed Node Tools for Visual Studio, and then subsequently run (as suggested) "npm install typescript -g" to install typescript for VS Code, you now have TWO (count them, two!) potentially different versions of the typescript compiler in TWO different places. 
  • Running "npm install typescript -g" puts typescript in a location that is not reflected in your PATH system variable. Yet all of the "examples" of how to configure your tasks.json file seem to assume that the npm-installed typescript compiler will be found automagically. Oddly enough, this did not happen for me.

So the corrective actions that I took to get things to work are actually quite simple.
  • Remove the path to the Node Tools installed version of typescript from your PATH system variable. If you don't know how to do that instructions are here.
  • In a command or powershell window enter "npm list -g". This will show you all the globally installed npm packages. Here's what mine looks like:
c:\>npm list -g
C:\Users\Steven Archibald\AppData\Roaming\npm
└── typescript@1.7.3

What's important is that first line of the response:
"C:\Users\Steven Archibald\AppData\Roaming\npm"
Copy that from your machine and save it in a text file for the moment.

When you create your first tasks.json file in VS Code, it will look like this:
// A task runner that calls the Typescript compiler (tsc) and
// Compiles a HelloWorld.ts program
"version": "0.1.0",

// The command is tsc. Assumes that tsc has been installed using npm install -g typescript
"command": "tsc",

// The command is a shell script
"isShellCommand": true,

The line, "command" : "tsc", is why my .ts files were not being compiled. The root of the problem is,  VS Code is just going to look in your local directory (apparently) to find the typescript compiler. It won't find it there - you installed it globally, remember? And you don't have a path statement to point to where it really is.

So, you could add the "...\npm" path to your PATH system variable (I haven't tried that yet), or you could change your tasks.json file to have:
"command": "C:\\Users\\Steven Archibald\\AppData\\Roaming\\npm\\tsc",
It now works as expected!
Note that your path will be different based on what your "npm list -g" returns, and that the "\\" are required to escape the "\" character.

Hope this helps save people some time, and Happy Typescripting!

Sunday, August 23, 2015

More Crap From Microsoft?

Sigh ...

It just keeps getting worse.

First, let me preface this with the disclosure that I have been developing on Windows (Desktop and Web) exclusively since 1994. For the most part, I think Microsoft's Developer Tools are the best available. While I will be commenting about Visual Studio Code in a subsequent post, this is about something else. I also happen to like the Windows Desktop interface (have to clarify that now since there is a "tablet" interface as well). I find it highly intuitive, and better than the Apple desktop interface. I even prefer to use IE over the other browsers. I do use the other browsers, I've just like IE better than the others.

Recently, I upgraded from Windows 7 to Windows 10. Along with the new OS came the latest instantiation of IE, Microsoft Edge. I do like the cleaner interface.

But I detest the fact that I cannot set my New Tab options to open with my home page. I use as my homepage. I like the daily pictures, I've signed up for Bing rewards, and I find the Bing search engine to be just as useful as the Google search engine. But with Edge, I can no longer set my new tab properties to open with the same address as my home page. I can't tell you in words (or Word) how much that pisses me off.

I'm assuming it's because they want to force you to look at their "top sites" for marketing, advertising, whatever, dumb-ass revenue gathering reason.

It's counter productive.

I hated the recent versions of Firefox and Google and refuse to use Opera for the same reason - on my computer, I don't like being forced to do things the way someone else thinks I should.

It's a PERSONAL computer. It's MY computer. I'll use your software if you let me use MY computer the way I want to use my computer.

At this point, Microsoft has given me no reason to prefer Edge over Firefox or Chrome. Great marketing move, Microsoft - make sure there's no real UX experience between yourself and the other guys. You don't keep or gain marketing share if you aren't any different from the other guys. And speedier rendering on the order of microseconds is not a sufficient discriminator - everyone always makes their browser a little bit faster with every round.

It's back to IE 11 for me...

Sunday, July 13, 2014

Facebook Is No Longer Trustworthy ...

I've been pondering the issue raised by recent disclosures that Facebook "altered" views of some test subjects Timelines. It did this by "hiding" either negative posts, or "positive" posts for certain viewers, and then measuring whether this had a negative or positive effect on the posts placed later by the viewers (if I understand the experiment correctly).

The big brouhaha has been about whether Facebook had violated some ethical rules regarding conducting psychological experiments. There's a very nice discussion here about this aspect of the issue.
However, from my perspective, everyone is missing the real point. Facebook violated its social contract with its subscribers. When we sign up for Facebook, it's understood that Facebook will use our data in managing and optimizing its relationship with advertisers. That's how Facebook makes revenue for itself. We sign up knowing this, in exchange for free services to communicate our thoughts and feelings to others; friends, family, the world, depending on our security settings. However, we have an expectation, and a reasonable one, that Facebook will present that representation of ourselves faithfully. In other words, what I post is what others see. 

Facebook violated that trust. Their experiment involved un-faithfully representing people's presentation of themselves to their friends, family and the world. In other words, I can no longer trust that Facebook will present my representation of myself. 

In this case, Facebook simply "removed" some posts that other viewed. Imagine that: I go to my Facebook page, and see every post I've made. However, someone else going to my page sees a different set of posts. That's not good. I can no longer trust that my friends are viewing everything I want them to see. 

But it gets worse. Now that Facebook has shown it's willing to "hide" some posts, what's to stop them from experimenting and "adding" some posts? First, it might be posts about products. Let's say I click on a particular ad three times in a row when I visit my own page. Facebook could easily "add" a post such as, "I'm really interested in this product! I'm thinking of buying it!" with an embedded link to the product page. That might lead my friends to click on it as well. Facebook could easily "hide" this post from me when I visit my own page. And hide any responses from friends to this made-up post. Suppose I'm applying for a new job. And Facebook has "chosen" my account as one of the "subjects" to which posts will be added and viewed by others than me. I might not get that job because my potential employer saw something they didn't like, THAT I NEVER POSTED AND I NEVER SAW!

Later, it could be posts about something else; politics, religion; anything. And what's to stop them? Nothing, really. 

They've already demonstrated a willingness to mess with your page and what other people see on it. And they whole-heartedly did NOT apologize. They merely stated that they had poorly communicated what they had done.

Think of it this way. You're married. Your spouse, for unknown reasons, and unbeknownst  to you, starts telling stories about you: he's cheating on me; he hits me; he molests the children. All of a sudden you're friends start treating you differently than they have in the past. Finally, you find out. And what does your spouse do?
Doesn't apologize, just says "Well, I guess I could have communicated it to you in a better fashion..."

Would you ever trust that spouse again?

I no longer trust Facebook ...

Sunday, June 29, 2014

The Best Development Quote Ever?

My most favorite quote regarding development, particularly software development, is from Antoine de Saint-Exupry. It is, "A designer knows he has achieved perfection not when there is nothing left to add, but when there is nothing left to take away."

By the way, Antoine de Saint-Expury was not only the author of "The Little Prince", but also a renowned aviator and aviation designer. Given the state of aviation at the time he was flying, less was definitely more.

So why is this important for Software Development as well? Basically it encapsulates and summarizes multiple themes we use; DRY, Minimally Viable Product, Re-factor, etc.

I've seen many projects get in trouble and even fail because this simple maxim was ignored; building more than the customer asked for; building stuff the customer asked for, but didn't really need; not planning out code libraries in advance; not taking advantage of abstract base classes and/or generics.

It's difficult to follow this maxim. It requires some careful planning up front, and some vicious code refactoring AS YOU'RE GOING ALONG. You must be re-factoring, and following DRY principles every single day. Why is this important?

Every single line of code you write is a potential bug. The fewer lines of code, the fewer potential bugs.

The fewer lines of code, presumably, the fewer unit-tests have to be written (which are subject to having their own bugs).

The fewer lines of code, the easier it is for someone else (or you six months later) to read and understand the code.

The fewer lines of code, the easier it will be to extend the application. When you think you are done coding, ask yourself "How much more code can I remove?"

Finally, I mentioned above that this quote applies to more than just software development. Another favorite quote is one I use with #2 child when #2 has a writing project in school. The quote comes from a famous author, whose name escapes me at the moment. It's an apology for a long letter written to a friend. "I would have written a shorter letter, but I didn't have enough time." In other words, I didn't have enough time to remove all the unnecessary words.

Edit, slash, cut & burn; your code will be better for it...

Friday, June 20, 2014

Proud of Your Ignorance?

Granted, I’m a curmudgeon, and take umbrage at things that other’s might easily overlook or forgive. But making simple spelling mistakes on an email blast that represents your company to the world does not strike me as a way to make a great impression. I received this email today:


I’m sure whatever tool was used to create the original email had some spell check capability.

Is this company too proud to use a spell checker? If they’re not willing, or not smart enough, to use spell checking on a public document, what confidence do you have they will be careful with the work they do for you?