http://blog.samikuhmonen.fi/Sami's Page - Usability2022-12-24T09:39:08+00:00Random things of a random worldSami KuhmonenBlogEngine.Net Syndication Generatorhttp://blog.samikuhmonen.fi/opml.axdSami KuhmonenRandom things of a random worlden-GBSami's Page0.0000000.000000http://blog.samikuhmonen.fi/post/2017/01/08/pgadmin-4-why-oh-whypgAdmin 4 - Why oh Why?2017-01-08T09:00:00+00:00Sami<p>It looks like the PostgreSQL development team has decided to rewrite pgAdmin into a new version and I guess they're quite happy about it. A tweet I saw mentioned 10k hours spent on the first version. This makes no sense to me, since after using it for 15 minutes I saw so many problems with it that it cannot really be the application they wanted to produce.</p>
<p>This is just a quick rant about it because I'm trying so hard to get things done with it but it's just not letting me. And it's not because I don't want change. It's because it really doesn't work the way it should. I'll add some pictures later probably to showcase some of these issues.</p>
<p>Now, pgAdmin 3 wasn't perfect or wonderful in any way, but it got the job done. Sure, it hung itself if you had two long queries running at the same time. But at least it did things reasonably.</p>
<p>First of all, it's slow. It takes ages to load data from the server. I don't know why this is, I guess it's loading too much data. pgAdmin 3 showed properties of a table in sub-second times. pgAdmin 4 takes several seconds. This is very annoying.</p>
<p>Also noticed a major issue: put a long-running query in pgAdmin 4. It darkens the window and has a rolling thing. <strong>And sucks all the power from one core on my Intel i7 machine!</strong> And then it even crashes. Nice. This makes me feel all warm and fuzzy.</p>
<p>pgAdmin 3 had a small font and everything was nice as lists. pgAdmin 4 has big fonts. It has headings and whatnots that waste screenspace. This wouldn't be the worst thing usually, but I have a lot of tables and a lot of information I want to just see easily.</p>
<p>There is no concept of keyboard commants. Sure, I an run the query with F5, but how about refreshing the tree when I create a new table from SQL query? Right click, refresh, wait. Great.</p>
<p>View data from a table and want to use PgUp/PgDn to move in it? You're out of luck. We don't support that. Want to jump to beginning or end? Don't support that either.</p>
<p>Want to put two query windows into different monitor than the main program? Nope, we have one window and that's all you get.</p>
<p>Want to resize query result windows? You can kinda do it, but only inside the main window. And sometimes the windows are even lost.</p>
<p>Want to switch between tabs? Ctrl-Tab? No, we don't support that. Use the mouse.</p>
<p>Want to copy some value from a result table? No. We don't want you to. That's not allowed.</p>
<p>Truncate table? I'll show some random alert with the title AlertifyJS saying "Are you sure you want to truncate table {}?" which doesn't really make me want to click Yes since I have no idea if the table I want will be truncated.</p>
<p>Oh, and all queries show a nice fading messagebox when they finish. In pgAdmin 3 they just had a status bar which showed this info. I don't need distracting fading boxes, this isn't a consumer web page. This is a professional tool.</p>
<p>Another issue about this flashy fading thing: the information disappears. How many rows did the query return? Who knows. It was there for a second and now it's gone. Oh, wait, I can switch to Messages tab to check it out. Why bother showing the run time and row count on a status bar when I can mouse around and switch tabs?</p>
<p>The tree view doesn't have a horizontal scrollbar. Let's waste screen space for making the treeview larger than needed, otherwise you can't see the information there. But you will see a lot of white space because the information you want is on the <strong>8th level and above</strong>. Table names are the 8th level on the tree. Column names are the 10th. You can imagine the white space on the left of them, all wasting screen space.</p>
<p>Column widths in the result grid are by default too small. No, you can't just double click to make them fit, or become bigger, like in pgAdmin 3. You have to manually resize them. And if you rerun the query you have to resize them all over again.</p>
<p>This is just unbelieveable. And this is done by people in the core team, who I would think use this daily and want it to work as smoothly as possible.</p>
<p>So why don't I use pgAdmin 3? Because it doesn't support PostgreSQL 9.5 or 9.6. Oh, and pgAdmin 4 doesn't support older versions of PostgreSQL either. And it doesn't even say anything about it. It just starts to throw errors and database disconnect messages everywhere if you try to connect to, for example, 9.1. At least 3 says "sorry, I might not work since I only support 8.4 - 9.4" and that's fine then.</p>
<p>Could someone please just update pgAdmin 3 to support 9.5 and 9.6? It can't be that big of a deal? Then I could continue using my well working workflow of multiple windows, anywhere I want on the screen. I could check it out myself, but would take some time to get to know the codebase and changes between the versions.</p>
<p>Or could someone in the pgAdmin team just fix these issues? I know it's v1.1 but it should have these basic things done. And please add a multi-window thing like in pgAdmin 3. It is very much needed, I'm sure I'm not the only one feeling this way.</p>
<p>But at least pgAdmin 4 has been done using Javascript and web views. Guess it's a nice way to make a flashy half-baked UI that doesn't support any of the regular keyboard shortcuts or separate windows or anything important like that. But at least it's easily multiplatform.</p>
<p><strong>Note</strong>: Thanks to Adam Brusselback I did realize that I had a bit older version of pgAdmin 3, so I can actually use it with 9.6. Sanity restored until they get 4 into working order.</p>2017-01-08T09:00:00+00:00SamiIt looks like the PostgreSQL development team has decided to rewrite pgAdmin into a new version and http://blog.samikuhmonen.fi/pingback.axdhttp://blog.samikuhmonen.fi/post.aspx?id=d9ecde26-18c9-4ce3-ba90-174f09c10a2b70http://blog.samikuhmonen.fi/trackback.axd?id=d9ecde26-18c9-4ce3-ba90-174f09c10a2bhttp://blog.samikuhmonen.fi/post/2017/01/08/pgadmin-4-why-oh-why#commenthttp://blog.samikuhmonen.fi/syndication.axd?post=d9ecde26-18c9-4ce3-ba90-174f09c10a2bhttp://blog.samikuhmonen.fi/post/2016/08/02/annoying-game-barAnnoying Game Bar in Windows 102016-08-02T06:00:00+00:00Sami<p>Windows 10 has finally represented itself with a feature I don't like: the game bar notification. It's annoying.</p>
<p>I have a shortcut defined for Windows+G, so every time I press it I get the dialog asking if I want to use game bar and if this is a game. There is no option to say "no, it's not, stop bugging me!"</p>
<p>There is a way to disable it through the Xbox app. But that requires signing in. I don't use Xbox things on my work laptop, I don't want to sign in. Why can't I disable this otherwise?</p>
<p>I even uninstalled the Xbox app thinking that might work (PowerShell, Get-AppxPackage *xboxapp*| Remove-AppxPackage). No, the game bar thingy is completely separate, just its settings are handled by it. Crap.</p>
<p>Fortunately there is a way to disable it. You'll just have to dive into registry.</p>
<blockquote>
<p>HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\GameDVR\<strong>AppCaptureEnabled</strong> DWORD, value 0</p>
</blockquote>
<p>After you add this value the question about game bar no longer jumps up and you can be at peace.</p>
<p>I really hope MS adds the "no, this is not a game, stop bugging me" option to this. Haven't checked in the latest builds, maybe it already is there. And also a setting to disable it altogether <em>without signing in</em>.</p>2016-08-02T06:00:00+00:00SamiWindows 10 has finally represented itself with a feature I don't like: the game bar notification. Ithttp://blog.samikuhmonen.fi/pingback.axdhttp://blog.samikuhmonen.fi/post.aspx?id=4e986427-9ae5-4281-bae4-d25c9743b4ad0http://blog.samikuhmonen.fi/trackback.axd?id=4e986427-9ae5-4281-bae4-d25c9743b4adhttp://blog.samikuhmonen.fi/post/2016/08/02/annoying-game-bar#commenthttp://blog.samikuhmonen.fi/syndication.axd?post=4e986427-9ae5-4281-bae4-d25c9743b4adhttp://blog.samikuhmonen.fi/post/2016/03/17/the-issue-with-xamarinThe Issue With Xamarin2016-03-17T06:00:00+00:00Sami<h1>The Issue With Xamarin</h1>
<p>Some may know that I have a lot of feelings towards Xamarin and very few of them are warm. Most are very heated, but for the wrong reasons. Thought I'd finally write them out and explain what's the problem.</p>
<p><strong>Note!</strong> I am talking with experience while developing application that currently has source code size of over 400k lines (quick check with cloc 1.70). This is not a small project. Many people may be happy using Xamarin with their apps. Most of those apps are small. Very small compared to this one. So when saying "it works for me" do tell the size of your projects also. I welcome all comments and experiences, but this is one difference between the typical Xamarin user that I've seen and our project.</p>
<h2>TL; DR</h2>
<p>Xamarin is slow, buggy system that will make you lose your mind. It won't help you save time or share code or magically make two apps with the price of one. I tried to help them by reporting issues, but was shut down with "you're not paying us enough." So I guess they have an issue somewhere, though I'm sure some people there would prefer people reporting issues so they can be fixed. So I'm writing them here.</p>
<p>No, I won't fight with Bugzilla. It's one of the horriblest things I've ever used. Maybe it's better these days, but it left a bad taste years back and I'm not paid to write perfect reports. If Xamarin wants me to give more information, they can ask nicely and I can see what I can do. I really wanted to help and make my own work go more smoothly.</p>
<p><strong>This is not about bashing Xamarin</strong>, this is to show that behind the marketing hype and pretty words there is a beta class product that might work for small apps but isn't really ready for real world use and requires a lot of TLC from Microsoft in the future.</p>
<p>Most of these things I found out after <em>one week</em> of using Xamarin. One week. That's all it took, though of course I've used it for longer now. I can't believe nobody else has seen this. Or am I working on such a big project (25 projects and 2000+ files, over 400kloc) and nobody else bothers? Also, my machines are on the quad i7 with SSD level, so it's not due to me having an old machine. And I can compare to Visual Studio easily on the same machines.</p>
<h2>The Good?</h2>
<p>First I must say that there are many nice things about Xamarin. I like how they've converted the iOS/Android APIs into .NET style, I love how easy it is to do things with async/await compared to the Java way of anonymous classes after anonymous classes. But this is all just .NET, nothing really special to Xamarin.</p>
<p>I would just <em>love</em> Xamarin if it worked as it should and provided a nice way to do .NET on iOS and Android. But since it just can't, what can I do? The version numbers are 4-6, so it's not like it's alpha/beta stuff. It should already work!</p>
<h2>Marketing Hype</h2>
<p>I was contacted by Xamarin sales rep and how he tried to get me to buy into the Xamarin hype was totally ridiculous. Here's a verbatim quote from him:</p>
<blockquote>
<p>With two native development teams you will have no collaboration meaning you will build two apps with complete different feature sets, leading to two different experiences - this is not good for user adoption. This will also be expensive and you will need to skill up two teams rather than leveraging your current development team. It will also take twice the time to build an app.</p>
</blockquote>
<p>I would want to emphasize the main points, but that would mean emphasizing the whole lot. Let's break it down.</p>
<p>"<em>you will have no collaboration</em>" - this is the first whattaheck moment. No collaboration? I've been in the industry for two decades. I've worked on mobile devices for way over 15 years. And I've yet to understand why anyone would hire two teams to do two platforms and isolate them into different rooms. Maybe that wasn't the intention of this? Let's see...</p>
<p>"<em>you will build two apps with complete different feature sets, leading to two different experiences</em>" - no, it was exactly that. The teams would work totally separately, build two separate apps however they would like to. No no no. This is not how I operate. This is not how anyone sane operates. No way.</p>
<p>And <em>two different experiences</em> is a two-way thing. If you build an app that looks and feels exactly the same on iOS and on Android, you're again doing it wrong. Android users are used to having a dedicated back button. iOS doesn't have it. This is just one of the differences that have to be addressed when creating applications. So of course the applications will be different, but only in the parts that need to be different for the application to feel "at home" on both platforms.</p>
<p>This doesn't mean in any way that you can't use same UI elements, same background code or you'd have two completely different experiences. You're just tuning it to suit the platform.</p>
<p>"<em>you will need to skill up two teams rather than leveraging your current development team</em>" - now, Xamarin allows the use of the existing .NET knowledge of the team. But since the UIs are still made natively to both platforms, do tell how do we not need to make our developers knowledgeable about iOS or Android by using Xamarin? And no, Xamarin Forms is not an answer. Xamarin themselves says it's only for prototypes or little things, not for actual development.</p>
<p>Using any platform requires getting new skills into the developers. And what if our team already has iOS and Android knowledge? I, for one, have both. And .NET knowledge. So I don't need to skill up anything from scratch to do native or Xamarin development. I do need to learn more, I don't know everything.</p>
<p>"<em>It will also take twice the time to build an app.</em>" - no, I don't think so. If developing at the same time, it will take more time. If developing first one, then another, less so. And even with Xamarin <em>the user interfaces must be done separately</em> so the time usage is still bigger. It's not a silver bullet.</p>
<p>There was also a sales pitch document from a company that said it's so great they only had to write 50% of the code for two platforms and how they didn't have to train their people since the outsourced the whole thing to a company that does Xamarin work etc. A typical pitch with no actual figures or anything. And the app seemed to be quite simple anyway. But I'm sure the consultants took their money.</p>
<p>So to wrap it up: doing two platforms will take more time whether you use Xamarin or native. With Xamarin you'll have tools fighting you, maybe have to learn new things if you're not both .NET and iOS/Android savvy. With native you'll have another set of issues with the languages and environments, maybe have to learn new things if you're not ObjC/Swift/Java and iOS/Android savvy. Which is better? Depends, as usual.</p>
<h2>The Price</h2>
<p>Xamarin has a couple of different options. If you're an indie and don't need much, you can get things with $25/month, or $299/year. You won't get any support (except forums, which are useless), you won't get Visual Studio integration, nothing.</p>
<p>If you want better things, you'll pay $999/year. And do note this is <strong>per developer</strong>, <strong>per platform</strong>, <strong>yearly</strong> payment. So let's say you have a team of two and both work on both platforms. You'll pay <strong>$3996</strong> per year to use Xamarin properly. That means you really have to get some benefit from it. Probably you won't.</p>
<h2>The Issues</h2>
<p>I tried to report lots of issues with Xamarin and Xamarin Studio by email, as the marketing person informed me to do. The reply I got was that since I'm not paying the $999/dev/platform/year, they won't provide support to me. This was quite a shock. Their product is broken. I explain how. They brush me off without any help. Tell me to go to the forums. The forums that is a wasteland of questions without answers since nobody else can answer than Xamarin themselves and they don't seem to care about the forums.</p>
<p>So here are some of the issues I have come across. Not nearly all since I haven't written everything down.</p>
<h3>Xamarin Studio</h3>
<p>Xamarin Studio is quite a heap of junk. Most of my issues are with it. And since there really isn't an alternative for using it (VS is mentioned a bit later) people have to suffer with it.</p>
<p>The editor doesn't update the screen always. Press Ctrl-Delete and maybe nothing happens. Click somewhere or press cursor keys and then the screen updates. Maybe sometimes deleting code or pasting new adds the text, but the coloring doesn't move on screen.</p>
<h3>Unstable IDE</h3>
<p>XS at least once a day goes into a mode where all on-screen parts, like Solution, Properties, Errors etc views just lose their content. It's running and responsive, but nothing is drawn. Restart fixes it.</p>
<p>XS crashes at least a couple of times a day due to random things. Have never found anything that crashes it for sure, it just dies randomly.</p>
<h3>Changed Files</h3>
<p>Also noticing files changing and reloading them, especially project files, is shady. Some might say why do you alter project files outside, but that's what version control does. I don't want to close the solution and reopen it every time this might happen.</p>
<p>Also if it realizes a file has changed, of course it won't stay on the same line where you were. The file is reloaded and the position jumps to beginning. Thanks.</p>
<h3>Key Shortcuts</h3>
<p>So, I want to delete the previous word. How was it... Oh, yes. Ctrl-Backspace, like in any other Windows program. Deletes the last character, that's odd. Let's check the settings. Oh, there is no key command defined. I'll just add Ctrl-Backspace... except I can't. Backspace is always deleting the Ctrl definition. So I can't do it. No key command can have Backspace in it from the GUI. So, I'm to be without it forever? Nice.</p>
<p>Going backwards/forwards in code after using, for example, F12 to jump to definition. Oh, Ctrl-Alt-Left/Right is said on the menu. Except no, it doesn't work. It just goes to prev/next character. Another thing that's broken. Nice.</p>
<p>Some people suggest downgrading GTK library versions. Why bundle a broken version when you know it's broken? Why not provide a fix with an older version on next update? Why bother, seems to be the idea.</p>
<h3>Nobody Needs Paste</h3>
<p>Paste doesn't work. Yep. If I copy text from Notepad, Visual Studio, anything else than Xamarin Studio, I can't paste it. It just doesn't work. No idea why. I can copy/paste within XS without issues. Just nothing from the outside.</p>
<h3>Visual Studio Plugin</h3>
<p>Of course I could use Visual Studio. If I pay the $999 price. But the plugin is a bit broken, as everything. Maybe breakpoints won't work. Maybe solution loading hangs the whole system. Maybe this or that. In the end it's better to just stick to Xamarin Studio. It works better in general. So you're paying for nothing and just waiting for things to get better.</p>
<h3>Build Speed</h3>
<p>The speed with which Xamarin builds depends on the platform. Or rather, platforms. If you're doing iOS development on OS X, prepare to wait. The compilation is slow and since the code has to be compiled to native code in the end (Apple doesn't allow code generation on the fly), it'll take even longer.</p>
<p>Android builds on Windows are faster. This mainly due to not having to do native, unless you want to. And things work better there anyway.</p>
<p>For me my current work project is a big application, so it has 25 projects in it. Making one line change and getting it to run on the iDevice takes 3-4 minutes. Calculate that: if I'm working on a feature I can only build about 10 times an hour. The rest of the time I'm waiting for compilation and a little sliver of time I'm actually coding. This also relates to the next issue.</p>
<h3>Disabled Projects Still Build</h3>
<p>If I have 25 projects and only work on one, it's logical to mark the 24 others to not build. Then I'll just have to build one and link the stuff together. But this doesn't work. On iOS <strong>every project is built</strong> whatever settings you have. And it's not just a little thing to check if there is need to build. It takes ages to just check. Visual Studio on Windows does it in couple of seconds for this many projects. XS may take a minute just for that.</p>
<h3>No Caching of Output</h3>
<p>Monotouch, the compiler to turn the .NET into native code, doesn't seem to have any kind of cache, or the previous item messes with it. So every build needs a looooong time to compile into the end product that can be pushed into the device. It's very bad.</p>
<h3>Language Bugs</h3>
<p>iOS version allowed parameterless constructors for structs. C# doesn't allow this. This was fixed finally.</p>
<p>There still is an issue where I can build code where a method expects to get a parameter with type <em>ISomething</em> and the actual object given does not implement that interface. It does have the methods that are called on that object and it resides in another assembly, so for some reason Mono/Xamarin uses duck typing in this case. I haven't bothered to build a MVCE of this, but it's in my code tree. Building every day without errors.</p>
<h3>Android UIs</h3>
<p>You can work with UI definitions inside Xamarin Studio. But the experience is quite bad. Change the ID of a control? It's not changed anywhere else. Feel free to find every place where you referenced that control, or just don't bother and use the text editor and do things manually.</p>
<p>Also if you happen to have UI definitions in another project that links to your main project, good luck. If you add a control to the referred assembly and build, Xamarin won't find the ID definitions. You will have to rebuild the referred and the main assembly. No, just building doesn't help. Rebuild needed. For two projects. Slow...</p>
<p>And if you ask why would anyone do that, well, when you have a set of controls or UI elements you want to use in several product variants, that's the way to do it.</p>
<p>Also trying to drag controls to the UI editor may add them somewhere where it shouldn't. You'll get a compilation error saying scrollview can only have one control and you can't see more than one control. Until you go edit the XML. Always stick to the XML.</p>
<p>There is no undo. Not for parameters, not for moving controls around, nothing.</p>
<h3>Android UIs Not Updating</h3>
<p>Sometimes XS goes into a mode where any changes you do to the UI files is not pushed to the device. All code changes are there, but the UI doesn't change. Of course a full rebuild helps, but not nice when you're testing 20 changes to the UI and want to just quickly run them. Nope, won't happen.</p>
<h3>Disk Bloat</h3>
<p>Building things with XS on OS X starts hogging disk space. I was wondering why my disk was filling up until I did a total clean on projects. Helped a bit. Then I shut down Xamarin. <strong>10GB</strong> of disk space suddenly appeared. Haven't checked what it does, but it just leaks files left and right. Messy.</p>
<h3>No Information on What's Wrong</h3>
<p>Let's say you have a file open on the editor. You've written something on it. Then you do an operation that changes the file, let's say pulling from source control. Then you go to XS and try to build or run. Nothing happens. You try pushing buttons, selecting menus, using key commands. Nothing. Until you go through all the tabs and suddenly there's a mention that a file has changed on disk. Only after handling that you can build.</p>
<p>Visual Studio would show a dialog immediately it detects a change and this would never happen. But with XS I've had this several times.</p>
<h3>Autosave File Found</h3>
<p>Sometimes you get a mention about an autosave file being found. You're asked do you want that or the existing file. No way to compare, see what's the difference. You just have to choose. Right now. Otherwise you can't continue.</p>
<h3>Version Control Done Wrong</h3>
<p>Let's say someone made your solution in a way where some projects are above the solution in directories. Might happen, even though not that nice. Still you expect things like version control to work properly. Not so with Xamarin Studio.</p>
<p>If you edit a project that is outside the folder where the solution is (note: still in the same repository), Xamarin Studio won't show the changes for that project when you ask it to show all changes in solution. You may be committing partially. This also was a nice thing to notice. So better not to use the integrated git.</p>
<p>You also might have different settings on git and Xamarin Studio for email, name etc. On commit XS asks which would you want to use. You're surprised, want to check what they are. So you press cancel expecting it to cancel the commit. Not so, commit is done with some information and you are not told which. That is not canceling.</p>
<h3>Realtime Error Detecting? Not on My Watch!</h3>
<p>With Visual Studio I'm spoiled with error checking. I can just see errors immediately while writing code. If I fix them I can see them disappearing from the list. With Xamarin Studio it usually takes a build to get them to go away. Which may take minutes to do. So much usability.</p>
<p>This seems to work better on Xamarin.Android/Windows than Xamarin.iOS/OS X for some reason.</p>
<h3>Intellisense</h3>
<p>Adding resources to a project should be simple. Just add and you've got intellisense (or equivalent) and can just code. Not with Xamarin Studio. You may need to reload the whole solution, or restart it, to get things to show up. I'm really hoping Roslyn will fix all of this.</p>
<h3>Change Code While Building</h3>
<p>You're doing one of the slow builds and notice an error in the code. You don't realize to cancel the build but rather just fix the issue. Save. Then cancel build and start again. XS doesn't realize you've changed anything. You need to do a rebuild for it to realize something was changed. So always stay away from code while building.</p>
<h3>Not All APIs Are Converted Properly</h3>
<p>Usually if there is a Android API with <em>setSomething()</em> and <em>getSomething()</em> Xamarin has done it nicely into a property. You just use <em>object.Something = 123;</em> I like it a lot. Makes it .NETty and familiar. Except randomly there's some API that has a read-only property and still a <em>SetSomething()</em>. Or some API has <em>GetSomething()</em> and <em>SetSomething()</em> even though they have the same type and only one argument.</p>
<p>I don't know what logic they use to (automatically) convert these, but it would be nice to be consistent.</p>
<h3>Code Formatting</h3>
<p>Basically every programming language has a style it should be written in. For me C# has the nice style, like this:</p>
<blockquote>
<pre>int Function(string name)<br />{<br /> Console.WriteLine(name);<br />}</pre>
</blockquote>
<p>It doesn't matter much that I prefer that, but it's the style it should be. Everyone should use it writing C#. But how does Xamarin Studio do things?</p>
<blockquote>
<pre>int Function (string name) {<br /> Console.WriteLine(name);<br />}</pre>
</blockquote>
<p>Notice the space before parentheses and the curly brace on the same line. That's not right. In Java and JavaScript you put the curly braces there, but not even they have the space before parens. What the heck?</p>
<p>So, why do this? On the <a href="https://forums.xamarin.com/discussion/5763/c-brackets-coding-style-is-an-odd-mix">forums</a> I saw that it's due to Mono's coding style, which someone recalls is copied from <strong>Linux kernel style</strong>. Why the heck has the Linux kernel have anything to do with how C# should be written? Really?</p>
<p>If I tried to suggest a totally different style for coding Java and explain that "because Scheme has this style" I'm sure people would just kick me. So stop it, Xamarin.</p>
<p>Yes, this can be changed, but it has to be changed for each machine you use. Cumbersome.</p>
<h3>Can't Switch Between Fast and Slow Assembly Deployments</h3>
<p>If you use <em>Fast assembly deployment </em>even once you can't go back without removing the application. Xamarin installs the assemblies in a different way and for some reason the fast mode overrides the slow one. So any changes you do to things like UIs will be taken from the fast mode and things will crash and you'll burn.</p>
<p>Also code changes won't show up, but you won't know it. You might be debugging old code and wondering why the behaviour doesn't change.</p>
<h3>Archiving With Errors</h3>
<p>So your app is ready for deployment. You want to archive it. Select <em>Archive for Publishing</em> and Xamarin starts building. But, there is an error in your code so it won't compile. Xamarin Studio will still present you with the archive list and doesn't necessarily highlight the error section, so you might just without checking pick the <em>previous</em> successful build and sign that.</p>
<p>Of course there should just be an error message and no archive window would be presented on such occasion. Basic UI testing should've shown this issue.</p>
<p>Oh, and if you click Cancel on the file selection dialog on the last step of signing, Xamarin will still spend time doing something and say that your application was signed successfully. Where? Nobody knows. They don't even check if Cancel or OK was pressed.</p>
<h3>You're Better Off With Beta</h3>
<p>I had an issue with websockets. Everything worked fine on native iOS. Import a library to Xamarin and the app just hangs on connect. No explanation. Tried everything: different threads, other ways of calling, everything. No help.</p>
<p>Then I just for fun checked updates. A beta version available. Ok, let's install. And suddenly the code works without issues. So you're sometimes better just using the beta stuff from them since they have issues fixed faster.</p>
<h3>Can't Decide Error/Warning Counts</h3>
<p>I'll just leave this picture here:</p>
<p><img src="http://blog.samikuhmonen.fi/image.axd?picture=/Images/xamarin1.jpg" alt="" /></p>
<h3>Can't Show Exceptions</h3>
<p>Sometimes Xamarin really goes to town with exception details:</p>
<p><img src="http://blog.samikuhmonen.fi/image.axd?picture=/Images/xamarin2.jpg" alt="" /></p>
<h3>Android Profiler</h3>
<p>Now, this is the first <strong>beta</strong> level part I'm talking about. And considering the production versions are that bad, you can imagine how a beta product works. So this is not a horrible bashing, I'm waiting for the non-beta. Which is probably a long way ahead.</p>
<p>The profiler has only memory profiling. And I say profiling very lightly. All you get is a list of different allocations, a very strange call stack that doesn't really show all the places where you allocated, for example, int[]. Just one or some of them. You don't really get a sense of what's alive and what's not. Mainly just "I have allocated strings for 20MB at some point altogether kinda I guess."</p>
<p>There is a snapshot button. Snapshots are great. I take a snapshot, then do some operations, then another snapshot and compare. What allocations happened, what's still alive? Except in this product it just hangs or stops the collection. So totally useless at the moment.</p>
<p>The profiler had a CPU profiler also, but since it had issues with Mono, it was removed. There are many people asking why not just put a mention that it doesn't work for everyone and let the ones that had no issues with it use it still. And especially since the memory profiler also should have a mention "probably does you no good and is completely featureless" why not have both?</p>
<p>Of course could be me at fault here not knowing how to use it, but considering I've used at least half a dozen profiling tools successfully without any issues, I'd say this one is broken. But hopefully it'll get better someday.</p>
<h2>Enough?</h2>
<p>That's just some things I've run into. I don't even remember them all. There's so much. But what you should take from this is this: Xamarin is expensive. Sure, the yearly license is not much compared to the salary of a developer per month. But when you understand how much slower it might make you in development, testing and getting the product out, you really have to think about it. My suggestion is to stay native. Don't believe the hype. Try it if you want, but since without paying you can't do anything substantial, you won't really get the feel for it.</p>
<p>If you have a small app to develop, the chances of getting savings from Xamarin are tiny. If you are developing a big application, you'll run into issues costing you a lot of time.</p>
<p>Of course I might be a unique snowflake and nobody else is having these issues, but I just can't believe it.</p>
<h2>Future With Microsoft?</h2>
<p>I really hope Microsoft will take the whole system and rip it open and fix it. Make the Visual Studio plugin work properly. Make me never need to use Xamarin Studio ever again. Make things fast. Make it just work. Listen to bug reports. Answer on the forums. Do the things I know Microsoft does.</p>
<p>So maybe in a year Xamarin will be worth your while. But now, definitely not.</p>
<p>As for me, I can't just convert all this code into native, so I'll be using it for a long time, whether I want to or not. And if Xamarin wants my help in fixing bugs, I'm happy to help, but I don't want to hear any bull about not paying enough when I'm telling what's broken.</p>2016-03-17T06:00:00+00:00SamiSome may know that I have a lot of feelings towards Xamarin and very few of them are warm. Most are http://blog.samikuhmonen.fi/pingback.axdhttp://blog.samikuhmonen.fi/post.aspx?id=c79f9895-c514-4eee-b7d4-74e683425ec115http://blog.samikuhmonen.fi/trackback.axd?id=c79f9895-c514-4eee-b7d4-74e683425ec1http://blog.samikuhmonen.fi/post/2016/03/17/the-issue-with-xamarin#commenthttp://blog.samikuhmonen.fi/syndication.axd?post=c79f9895-c514-4eee-b7d4-74e683425ec1http://blog.samikuhmonen.fi/post/2016/03/09/xamarin-won-t-activate-claims-too-many-activationsXamarin Won't Activate, Claims Too Many Activations2016-03-09T17:17:00+00:00Sami<p>I ran into the issue that Xamarin won't activate and claims you have too many computers activated. The strange part in this is that it actually can activate the computer based on the Xamarin website, but XS just keeps whining about not succeeding.</p>
<p>Checking the logs in ~/Library/XamarinStudio-5.0/ revealed the problem: if you install both Xamarin.iOS and Xamarin.Android but only have a license available for one of these, Xamarin Studio will still try to get both and since it can't, it will just whine.</p>
<p>The proper way to work would be to say "sorry, I can't give you an Android license, but you can have this iOS license" and call it a day. That's it. But no, it's all or nothing.</p>
<p>So if you have this issue (or the other way around), you'll have to <a href="https://developer.xamarin.com/guides/cross-platform/getting_started/installation/uninstalling_xamarin/">uninstall the other platform from your machine</a> and then try activation.</p>
<p>This will happen even if you download the license file and try to do offline activation, since XS will still want to log you in.</p>
<p>Note that this might not happen to everyone. It may require having licenses for both platforms in unequal quantities when trying to log in.</p>
<p>Yet another reason to love Xamarin.</p>2016-03-09T17:17:00+00:00SamiI ran into the issue that Xamarin won't activate and claims you have too many computers activated.http://blog.samikuhmonen.fi/pingback.axdhttp://blog.samikuhmonen.fi/post.aspx?id=c264ef9d-f50d-40fa-a163-e46fd2bc2ea00http://blog.samikuhmonen.fi/trackback.axd?id=c264ef9d-f50d-40fa-a163-e46fd2bc2ea0http://blog.samikuhmonen.fi/post/2016/03/09/xamarin-won-t-activate-claims-too-many-activations#commenthttp://blog.samikuhmonen.fi/syndication.axd?post=c264ef9d-f50d-40fa-a163-e46fd2bc2ea0http://blog.samikuhmonen.fi/post/2016/03/02/github-and-commitsGithub and Commit History2016-03-02T12:49:00+00:00Sami<p>Github says they have two ways of checking commits: either by branch for the whole repository or a single file's commits. I ran into an issue with the latter.</p>
<p>I have a file that naturally is in several branches. I edit one branch and another developer edits another. I add a piece of code into a method. Everything's fine. It's there. I merge the other developer's branch (which is the parent of my branch), everything's still fine. Code is nice. Git does what it's supposed to.</p>
<p>Then later I go into Github and check the history of the file. I view the file after my commit. It's fine, all my code is there. Then I click to view the file after the other dev's commit. What the heck, my code is missing? Did the dev remove it? Checking the diff... No, they didn't. They just added their own. Strange...</p>
<p>Let's check my next commit on the list. Yes, my code is there. All is fine. Hmm...</p>
<p>It seems that the <em>Browse the repository at this point in the history</em> shows you the file <strong>in another branch</strong>! It doesn't show <em>my</em> branch after I merged their changes. It shows <em>their</em> branch after it. Which has a different result.</p>
<p>This should be at least clearly explained, or rather, show the file as it is in <em>my</em> branch after I merged those changes. That shouldn't be a problem.</p>
<p>And if it happens to show commits in <em>any</em> branch, it's even worse since it doesn't explain this anywhere and no commit has any branch information.</p>
<p>No idea if other people have ran into this, a quick search didn't show any results. Have to contact Github and ask.</p>
<p> </p>2016-03-02T12:49:00+00:00SamiGithub says they have two ways of checking commits: either by branch for the whole repository or a shttp://blog.samikuhmonen.fi/pingback.axdhttp://blog.samikuhmonen.fi/post.aspx?id=e1e88727-95c1-4b83-a859-5b0cc2d5c4ec0http://blog.samikuhmonen.fi/trackback.axd?id=e1e88727-95c1-4b83-a859-5b0cc2d5c4echttp://blog.samikuhmonen.fi/post/2016/03/02/github-and-commits#commenthttp://blog.samikuhmonen.fi/syndication.axd?post=e1e88727-95c1-4b83-a859-5b0cc2d5c4echttp://blog.samikuhmonen.fi/post/2016/01/13/of-men-and-routes-expectations-must-be-metOf Men and Routes - Expectations Must Be Met!2016-01-13T07:26:00+00:00Sami<p><a href="http://trafi.lt/">Trafi.lt</a> provides a nice routing app for public transport in several countries. I have used it in Vilnius, Lithuania and have been kinda happy with it. It tells me how to get to places, which is the main point. But recently I ran into a problem that I didn't expect.</p>
<h2>The Problem</h2>
<p>When I am looking for route information, there are two main things: <em>how</em> and <em>when</em>. Trafi provides the <em>how</em> quite well, but the <em>when</em>...</p>
<p>Here is an example of a route search on the iOS app:</p>
<p><img src="http://blog.samikuhmonen.fi/image.axd?picture=/Images/IMG_5358_.PNG" alt="" /></p>
<p>(For those that don't speak Lithuanian, "Po 12 min" means "after 12 minutes" and "trukmė" is "duration")</p>
<p>So, what can we <em>assume</em> from this screen? It says "after 12 minutes" and "duration 31 minutes." So, I assume that since it's 8:48 now, I will <em>leave</em> in 12 minutes and will <em>arrive</em> in 31 minutes. Right? I would think that's the basic assumption.</p>
<p>But no. When you check the next screen, you will see that this expectation is completely wrong:</p>
<p><img src="http://blog.samikuhmonen.fi/image.axd?picture=/Images/Image6.png" alt="" /></p>
<p>So, I should actually <em>leave</em> in <strong>two minutes</strong> to make that bus. And the <em>bus</em> leaves the stop in 12 minutes. Oh. And I will actually arrive in 33 minutes from this moment, or 20 minutes from the time the bus leaves. Confusing? Totally.</p>
<p>Do note that the first page doesn't even say <em>where</em> the bus will be in 12 minutes. All those routes are from different stops, some of which are completely in different directions. So I can't just start walking somewhere and take some stop. I have to <em>know</em> where to go.</p>
<h2>How to Fix It</h2>
<p>The easiest way to fix this is to <em>meet the expectations</em>. I <em>expect</em> the app to tell me when to leave, where to go and when I will arrive. It fails on all accounts on the first screen. It doesn't say when I have to leave. It doesn't say when I will arrive. It only says when a bus will be <em>somewhere</em> and how long it will take to get to my destination after I leave, <em>at an unknown time</em>.</p>
<p>So the first screen should tell me this:</p>
<ul>
<li>when should I leave my current location</li>
<li>where should I go</li>
<li>what transport device should I take</li>
<li>at what time I shall arrive at destination</li>
<li>how long is the walk to the stop</li>
<li>when will thetransport device be at the stop</li>
<li>duration of the trip</li>
</ul>
<p>So in this example, the information would be: leave in 2 minutes, take the 12 trolleybus at Minties st. 871m away in 12 minutes and you will arrive 31 minutes later, at 9:21.</p>
<p>I know it is not easy to design user interfaces and too much information is too much, so it can always be prioritized. The minimal information would be: leave in two minutes, take the 12 trolleybus at Minties st. and you will arrive at 9:21. This would easily fit into the screen without any issues since it already has the time information, just the less important ones.</p>
<p>Here is an example of the important information given to the user immediately:</p>
<p><img src="http://blog.samikuhmonen.fi/image.axd?picture=/Images/Image7_.PNG" alt="" /></p>
<p>The duration of the trip can be calculated from the information given, so it doesn't need to be there explicitly. Usually it is more important to know when you arrive than the time used for the trip. This way the user can also immediately mentally check where they have to walk and they know exactly how much time they have until they have to leave.</p>
<p>I will of course send this enhancement proposal to Trafi also and hope they will implement some kind of better list to help people get the information they need.</p>
<p>And if, for some strange reason, other people actually don't care what stop they have to go to or when they have to leave, I'd like to hear about that too.</p>2016-01-13T07:26:00+00:00SamiTrafi.lt provides a nice routing app for public transport in several countries. I have used it in Vihttp://blog.samikuhmonen.fi/pingback.axdhttp://blog.samikuhmonen.fi/post.aspx?id=9803af97-08c3-4f31-8e4f-6fc0ba93f0940http://blog.samikuhmonen.fi/trackback.axd?id=9803af97-08c3-4f31-8e4f-6fc0ba93f094http://blog.samikuhmonen.fi/post/2016/01/13/of-men-and-routes-expectations-must-be-met#commenthttp://blog.samikuhmonen.fi/syndication.axd?post=9803af97-08c3-4f31-8e4f-6fc0ba93f094http://blog.samikuhmonen.fi/post/2016/01/10/never-choose-a-language-on-behalf-of-the-userNever choose a language on behalf of the user2016-01-10T08:49:00+00:00Sami<p>I've said it before, but after running into this question on the internet again I thought I'd reiterate the issue:</p>
<p><strong>Never assume anything about language knowledge or preference based on geography, ever!</strong></p>
<p>I will give out a couple of examples to hopefully make this issue clear.</p>
<h2>Ubisoft</h2>
<p>Ubisoft released an Assassin's Creed game on Xbox which checks your Xbox Live country setting and decides what language is used based on that. An American living in Finland of course had their country setting as Finland, so the game was shown in Finnish. No selection for language anywhere. Just Finnish. Now, should this person go for Finnish lessons for a few years to be able to go through the menus, or should the game actually ask what language to use? I'd say the latter.</p>
<p>Reply from Ubisoft: just put your country to UK or USA or something. Yeah. Lie about your location just to get a badly made game to function as it should.</p>
<p>Interesting question: what language does the game force upon people in the USA? English? Spanish? Allows choice? I don't actually know, but would like to know. If it allows choice, why not elsewhere?</p>
<h2>Xbox Kinect</h2>
<p>Xbox Kinect has speech recognition. You can set the language to English just fine, but if you are in an unsupported country, it will just not work. So Microsoft thinks that English spoken in Finland is not understandable, or not usable, but English spoken by the same person in the UK is just fine? What is the logic here?</p>
<h2>Samsung "smart" TV</h2>
<p>A nice new "smart" TV by Samsung is installed to use in Lithuania. Of course the terms and conditions, including <em>privacy information</em> is only shown in Lithuanian. Even if the menus etc are set to be in English. Because of course nobody would ever need another language in Lithuania. Everyone speaks one of the most difficult language in the world. Or nobody would ever immigrate there? In any case, totally bonkers. There should be at least an English version of the terms available.</p>
<p>How can anyone choose to accept a license or terms and conditions, or be knowledgeable of their privacy if they are presented with a 20 page text in a language they can't understand and which cannot be copied to an online translator, and which would also not translate nicely without a human translator?</p>
<h2>Open source</h2>
<p>I can't even count the amount of open source software (usually GTK based) that chooses on my behalf that I want Finnish language when I run it on Windows. My display language is English. My number and date settings are Finnish. My every setting about language is English. Still they decide that I want Finnish, because that was my <em>location</em>. Why? I would like to hear a single rational explanation to this assumption.</p>
<p>The worst case is Inkscape. It doesn't even allow selecting language. It just decides to use whatever it wants and if you don't like it, tough luck. You have to delete the translation files from the disk to get to English. If you rather want German? Nope, not going to happen.</p>
<p>(I'm sure some environment variables could be tweaked, but that's beyond the capabilities of regular people)</p>
<h2>Bottom line</h2>
<p>So, when you're thinking about should your app or game be distributed in separate versions to different regions or languages, I would give these guidelines:</p>
<p>If your app/game has lots of graphics, sounds or other large assets that change based on language, make separate versions. But make those versions available everywhere, regardless of geography. You can't decide that a Spaniard living in Korea can't have your app/game in Spanish just because he lives in another country.</p>
<p>If your app only has some strings and small assets, make a language selection. It's much easier usually and you will provide support for several languages without searching for separate packages. And your app/game will be available everywhere with all the languages.</p>
<p><strong>But always let the user choose the language they want.</strong> Don't be the bad person.</p>2016-01-10T08:49:00+00:00SamiI've said it before, but after running into this question on the internet again I thought I'd reiterhttp://blog.samikuhmonen.fi/pingback.axdhttp://blog.samikuhmonen.fi/post.aspx?id=0e3f2e93-5bd1-4b81-901c-36f8f4f327be2http://blog.samikuhmonen.fi/trackback.axd?id=0e3f2e93-5bd1-4b81-901c-36f8f4f327behttp://blog.samikuhmonen.fi/post/2016/01/10/never-choose-a-language-on-behalf-of-the-user#commenthttp://blog.samikuhmonen.fi/syndication.axd?post=0e3f2e93-5bd1-4b81-901c-36f8f4f327be