HNHacker News
TopNewBestAskShowJobs

mhomde

1,054 karma · joined September 20, 2012

I live in Stockholm. I Like palt, snow and a good mojito :)
submissionscomments
mhomde··on Sugar industry withheld possible evidence of cancer link 50 years ago
Yeah, I second that. I starts out very credible but if you examine what they say, especially regarding sugar and carbs it becomes very clear that it's vegan propaganda and skewing its facts heavily
mhomde··on Why Snapchat Spectacles failed
I think the use case is brilliant, if albeit niche. I would never wear them in everyday life but when travelling I found myself wanting something like this to capture memories, moments or just "atmosphere". A mobile camera doesn't quite cut it because it's hard to get an authentic angle, especially if you're moving. I'd rather not wear glasses when i don't have too but if it's sunny, why not instead of sunglasses?

I'd prefer something with less conspicuous branding however, and something I could export in a decent format. I predict this will be a somewhat mainstream gadget within 5 years (Well, for people who can afford it). Apple will make iGlasses, or some shit like that, with Siri and camera.

Then there's the whole thing about living in the moment, perhaps that's better :)

mhomde··on Sloyd
Ah yes, many are the cupboards filled with butterknives made in woodshop and the sofa's with an odd shitty pillow made in sewing class. Still better than the Lord of the flies -like gymclasses though :)

Fun fact, I don't think I ever had a träslöjdslärare (wood chop teacher) that had all appendixes intact. I surmised that sacrifing a finger must be part of some kind of initiation ritual for Sloyd teachers.

mhomde··on Ask HN: What are the most epic startup fails you know?
The company that signaled the start of the Dot.Com collapse in Sweden. The Jante law glee when one of the founder, in later years, was found to have been reduced to owning a hot dog stand was off the charts :)
mhomde··on Android Killed Windows Phone, Not Apple
Well one reason to build native UWP apps is that you do animation on the composition layer, thus ensuring 60 fps. It makes quite a difference in the feeling of animated UI, side menus etc.

I agree though that app stores for desktop apps, seems to be the case for OS X as well. Not quiet sure why.

mhomde··on Ask HN: What habits make a programmer great?
One habit that I think is important, and often overlooked, is to be able to break out of a mindset and questioning yourself with:

"Am I solving the problem at the correct level, using the appropriate method/technique/tool? Don't forget the big picture"

It's easy to just keep coding and add to existing code, architecture and methods. But sometimes the frog is starting to boil. Better then to re-evaluate whether to do some major refactoring, or add some layer of abstraction to keep it maintainable.

Sometimes you need to recognize that you're merely treating symptoms rather than a underlying problem. Sometimes you need to recognize that there are some library/tool/algorithm etc that can eliminate the need to solve a problem yourself.

mhomde··on How the .NET Runtime Loads a Type
There's a few downsides with your approach IMO.

a) You now have an AppleVersion Property as well as Version Property, that feels potentially confusing for any user of that class. I now have to find the differently named Version property every time I use an entity?

b) You have to manually write that exact boilerplate code on each specific case of Entity, and there might be a lot more if it isn't a simple example. In my case you get it for free through the generics.

The automatic casting doesn't strike me as a problem, eliminates boilerplate code and the where statement ensures type safety. I've yet to see a single concrete argument against my approach.

I didn't mean it as my way or the highway, I merely wanted to issue a warning on creeping dependencies that generics might cause if you don't have non-generic interfaces, the rest I guess is a matter of taste.

mhomde··on Reddit Is Raising Funds at a Valuation of $1.7B
From hanging around in r/redditdev I got an impression there was an exodus of much of the experienced backend team about a year ago when there was so much drama (Kemitche and at least two more people I think). Maybe it has taken some time to get a new one up to speed. Also, A lot of resources seems to be focused lately on developing clients for android and ios.

I get the impression that Reddit has a lot of technical debt that makes developing new features difficult, and would take some major effort to refactor themselves out of

mhomde··on How the .NET Runtime Loads a Type
Well, I've been writing C# for 17 years, and I've came across it twice, so it is a very niche solution for certain circumstances. I can't say it's the only solution, but in those instances it was the one that offered the best type safety and allowed classes to have non-generic interfaces.

Say that we have some kind of datastorage where everything is an IEntity, and we need to be able to treat them as such. Them we have a specific entity IApple : IEntity. Every IEntity has IVersion as a Version property, that is passed in it's implementation's construction. IApple has a more specific IAppleVersion as it's Version Property. When we're working with an IApple instance we want to be able to have access to the version as IAppleVersion. But other classes handles only IEntities with IVersions. In this case it makes sense to have the Version as a generic parameter to the class:

Apple : Entity<IAppleVersion>

which makes sure its constructor is:

Apple(IAppleVersion version).

We need to put the stuff that's shared between all entities in the non-generic Entity class, add the Typing of version in a generic version of Entity so Apple can expose the type provided. The Apple class that implements IApple has specific methods for its type. Both entity classes are abstract so they will never be initiated.

I'm not sure that's clear but I hope you can see the problem that I'm trying to solve. I think it's the disconnect with wanting to be able to access both more specific and more general interfaces (and their properties) that causes trouble.

On the flip side, if we have a legitimate need for both a more specific and a more general version of an class/interface, can you tell me a specific reason the way I showed would be bad. It's easy to get hung up "new" is bad because it's 95% true, but as with everything there are exceptions.

But if you never have the need for it, don't use it. I stand by my opinion though that you should be careful and in some situations be able to provide non-generic interfaces rather than requiring each method and class in a library to be generic, but that's only my opinion man :)

mhomde··on How the .NET Runtime Loads a Type
I agree, this is one of the few exceptions, in fact the only, exception I encountered. But this is a solution for a very specific problem in certain solutions, not a something you tend to do all the time
mhomde··on How the .NET Runtime Loads a Type
because then a generic requirement will propagate through the whole framework. And some polymorphism/patterns simply won't be possible. Trust me, I've encountered this problem several times
mhomde··on How the .NET Runtime Loads a Type
Hi, sorry for the delay, had to pop into a meeting. I tried to make a very scaled down example of what I mean. It's hard to imagine a real-world scenario from this but assume that according to the architecture we need to separate concerns this way.

The point is that in some cases you want to be able to pass a more general interface while getting some Type-checking and convenience of generics.

In this case we want to hold on to PopProtocolSender and perhaps use it as a variable somewhere. When we use it we need to acccess it's specific IPopProtocol Protocol Property. But we also want to be able to treat it as a general IProtocolSender that has a IProtocol Property, so it can be sent to other classes that takes that interface.

These kinds of situations mainly arise when you have a more complicated architecture. If there's a better way to have your cake and eat it too I'd be glad to know it :)

    public interface IPopProtocol : IProtocol
    {
        void SomeUniqueMetod();
    }

    public interface IProtocol
    {
    }

    public interface IProtocolManager
    {
        void SendMessage(IProtocol protocol, string message);
    }

    public interface IProtocolSender
    {
        IProtocol Protocol
        {
            get;
        }
    }

    public class PopProtocol : IPopProtocol
    {
        public void SomeUniqueMetod()
        {
        }
    }

    public class Program
    {
        public void DoStuff()
        {
            var sender = new PopProtocolSender ();
            var manager = new ProtocolManager();
            manager.SendMessage(sender.Protocol, "Testing");
            sender.Protocol.SomeUniqueMethod();
        }
    }

    public class ProtocolManager : IProtocolManager
    {
        public void SendMessage(IProtocol protocol, string message)
        {
        }
    }

    public class ProtocolSender : IProtocolSender
    {
        protected readonly IProtocol _protocol;

        public ProtocolSender(IProtocol protocol)
        {
            _protocol = protocol;
        }

        public IProtocol Protool => _protocol;
    }

    public class PopProtocolSender : ProtocolSender<IPopProtocol>
    {
        public PopProtocolSender() : base(new PopProtocol)
        {
        }
    }

    public class ProtocolSender<T> : ProtocolSender where T : IProtocol
    {
        public ProtocolSender(T protocol) : base(protocol)
        {
        }

        public new T Protocol => (T)_protocol;
    }
mhomde··on How the .NET Runtime Loads a Type
You can't pass generic interfaces to other classes that should handle non-generic interfaces (that aren't dependent on the generic constraint)

>If you don't have a known constraint that is enforced by the type system then it can never be 'safe'.

I don't quite know what you mean by this. If you cast to your "T" then casting is ensured. I guess there's some margin for error in that you must enter your casting code to be correct, but it's pretty hard to mess that part up, granted not as good as enforced genericy. Note that in many instances you only initialize generic classes, but you needed to be extract a non-generic interface from then to pass to other classes.

mhomde··on How the .NET Runtime Loads a Type
Well, that's flattering I guess :)

But it's not as bad as it sounds and the only way (AFAIK) to be able to work with both polymorphic objects and have the convenience (and type checking) of a generic counterpart. Limiting yourself to just a generic object/interface unfortunately breaks a lot of design patterns. It's also safe afaik since the only thing the generic version does is some casting and it's generic parameter enforces that casting.

but if you have a better way I'm genuinely interested to hear it

mhomde··on How the .NET Runtime Loads a Type
Beware though of improperly (or too eagerly) used generics. I've noticed they tend to spread like a cancer throughout a library and reduce the polymorphism of the code.

It's usually a good idea to be provide both an generic and a non-generic interface to an object.

A good technique I've found is to have the base object be non-generic and then have a generic version that overrides the properties (with new) that you want to use generic types on. (using as against an underlying field for conversion)

mhomde··on Calling Windows 10 APIs from a WinForms or WPF application
right now? Two words: Composition API. It's fairly new addition but they've started integrating UWP with hardware accelerated effects (through abstraction of DirectX). Means that finally you can run animations butterly smooth with 60 fps and do more bitmap-based effects on ui elements.

The downside with UWP is that it lives in the runtime sandbox so it's limited in how it can interact with the os (for good and bad). On the plus side there's some really nice integration with OS notifications, app services, handover and stuff like that. I really hope the composition stuff comes to WPF however

mhomde··on I Had My Electronics Seized by U.S. Customs and Border Protection
Question, say that I travel with an reset telephone, can you be forced to "install" it, complete setup and enter account information so it syncs it with your icloud/google/microsoft acocunt?
mhomde··on VR
From another Quake veteran big kudos for Quake Done Quick(er). The good old days :)
mhomde··on Microsoft is bringing Windows 10, with desktop app support, to ARM chipsets
What's the benefit against just visualizing it on the screen? Another problem is how comfortable it is staring through AR glasses hours at and end. I don't want to be the person to only see problems however, there might be some nice scenarios.
mhomde··on Microsoft is bringing Windows 10, with desktop app support, to ARM chipsets
I dunno, take the Dell xps 13, depending on your specs you have pretty powerful laptop in a 11" format. Compare that against the HP Lap dock (https://www.microsoftstore.com/store/msusa/en_US/pdp/HP-Elit...). Expensive and it isn't even a full laptop.

I think the problem I'm having with continuum is that it's based on us only using the computer in a few fixed places, whereas the good thing about laptops is that they can be used anywhere..

I agree that internal politics is most definitively the bane of Microsoft's existence :)

mhomde··on Microsoft is bringing Windows 10, with desktop app support, to ARM chipsets
I have a little hard time seeing AR-glasses and minority report like gloves/hand waving (or virtual keyboards) being feasible (at least before a couple of generations of improvements), but perhaps that's lack of imagination on my behalf. It seems like it get's more expensive/more complicated while not solving the same problems.

Sure in the far far future there might be feasible solution but in the meantime it would be nice if Microsoft had an idea of where they were headed instead of shrugging and going "well let's just see" :) They need to keep their ecosystem competitive to be positioned to take advantage of that future, whatever it is.

mhomde··on Microsoft is bringing Windows 10, with desktop app support, to ARM chipsets
I'm more than a little confused about MS "mobile" strategy. Continuum sounds like a good idea, in theory. For enterprise I can kinda see it be attractive to just give your employees mobile phones and hook the office up with continuum docks. But it seems problematic in more than one aspect. For starters it's based on the fact that people are going to want to use a windows mobile as their primary device to start with.

MS could have been there, in fact they almost were there, but they've let the mobile side drift aimlessly to the point were neither vendors nor third-party developers have any faith left in their mobile efforts. I could never wrap my head around how strategically MS could just let mobile go and not take the fight. It seems so integral to so many other efforts.

Another problem, is continuum really a good idea for anything else than niché scenarios? I have trouble coming up with use-cases. A laptop you can bring with you to meetings, on planes etc. With continuum you need a lap dock for that.. but then you have a sub-par laptop and a phone.

I guess if I were travelling it could be nice to just bring a mobile and connect it to a setup at a co-working space. But is carrying a dell xps 13 around really such a big deal? and what if I want to use a computer outside of the co-working space/office?

Then we have x86 apps on the mobile platform. There's been a lot of people wanting to see "Desktop" apps on mobile... I can understand that from a "continuum as a computer" perspective, if you buy into the continuum premise, but I can't see x86 software ever work well on a mobile form factor with the battery limits and UI challenges that comes with that.

So what is Microsoft's plan, now it seems they're just throwing stuff on the walls and to see what sticks. I'm a bigger UWP and .Net proponent than most, but I wish Microsoft would get their shit together and start executing across the board.

There's a bunch of stuff in UWP that could make the windows platform larger than the sum of its parts if you are in the ecosystem. Roaming settings/files, Notification mirroring and synchronization, universal apps, continuum, continue on another device etc etc. But it requires that there actually is an viable windows mobile that people wants to buy.

mhomde··on Mr. Robot Killed the Hollywood Hacker
Legendary hacker Hacky McHacky typed swiftly on the IBM M Model keyboard with the fingers attached to his hands. He hated laptop keyboards, they made his eyes flash like thumbdrives.

The Model M is a designation for a group of computer keyboards manufactured by IBM starting in 1984, and later by Lexmark, Unicomp and MaxiSwitch. The keyboard's many variations have their own distinct characteristics, with the vast majority having a buckling-spring key design and swappable keycaps.

Hacky's nostalgic reverie about IBM keyboards was suddenly interrupted when a voice spoke, chillingly close, coming from the other side of the server hall. "Drop that keyboard McHacky" it said menacingly.

mhomde··on Mr. Robot Killed the Hollywood Hacker
Luckily they listened to Kevin Poulsen that was technical adviser :) It's very unfortunate that the movie was otherwise so poor. Michael Mann is one of my long time favorites. A hacking movie with the mood and grittyness he's famous for could and should have been awesome.

Not sure exactly where they were wrong, I think I found bot the plot uninsteresting as well as the characters. Also Hollywood tendency of casting jocks and models as hackers :/

mhomde··on How to Master an Accent
...and let us not forget or weird cousins. Danish = Swedish with a severe throat infection. Norwegian = Swedish as told by an happy retarded person.
mhomde··on Reddit’s CEO edited comments that criticized him
Aww, that sucks :( Huffman always seemed like a measured and fair individual. I appreciated the way he communicated with the community when he took back the reins.

The act itself seems petty, the larger issue is the breach of perceived trust ... The_Donald finally made the frog boil over. Don't wrestle with pigs, they like it and you get dirty.

I do however have a hard time seeing a better replacement for spez so I hope him and reddit learned a lesson and put some measures in place to ensure this doesn't happen again. Everyone is allowed one major fuck up in my book as long as it isn't systemic, they admit it, and don't repeat it.

This seems to be another sign of reddit isn't quite mature enough both when it comes to leadership and technology to handle the scale of popularity they've grown to. They have all my respect but the league they're operating in provides a new set of unique challenges.

From a technical standpoint, it would be interesting if posts and comments could be signed so tampering wasn't possible and prevent even the temptation of doing so. Hard nut to crack in a user-friendly way though when everything is server-side.

mhomde··on Fired because your skills are too far above your coworkers
This strikes me more of a social/maturity issue. I can relate myself from when I was younger and thought I was the best programmer around. Even if that was the case (it wasn't) it doesn't matter much if you can't communicate and get along with your teammates. I thought "my work should speak for itself" and "quality over everything else"

One of the biggest lessons of corporate life is that how you behave and communicate will have a disproportional effect on your success. Doesn't matter how good you are if no one knows it, likes you, or people find you troublesome. You have to pick your fights, know when you to compromise, and how to put forth suggestions without stepping on anyones toes. Sometimes the decisions and output of other people can be truly baffling but you still need to manage them with strategy and grace. Just being a good human being, friend and colleague will get you far, as long as you can be forceful when needed an appropriate.

If you really is more experienced then becoming a good mentor is a skill in itself. You don't want to be an arrogant ass that is perceived as being "more than everyone else"

Another thing is understanding the trade-offs between clever code/maintainable code. Even good programmers have a tendency for over designing and/or over complicating stuff until they become more mature.

mhomde··on Autopilot Full Self-Driving Demonstration [video]
Haha, I find the image of him doing that, and no one daring to try change his mind, hilarious for some reason. I can see it escalating:

"So for our next video let's set up smoke machines on the road here, and then we'll have a camera team in front capturing it coming out of the smoke in slow-motion with "Smoke On the Water" as soundtrack. It's going to be amazeballs!"

"Umm, ok Elon..."

"Put in a lion roar as well"

"I quit."

mhomde··on Autopilot Full Self-Driving Demonstration [video]
That's really weird choice, who are picking these songs? :) I can't imagine they've licensed the music either... I guess next up is the "Highway to Hell" video
mhomde··on Why Are Apple and Microsoft Using Such Old Processors in Their New Computers?
Yeah... so maybe not keep pushing an weight/thinness envelope that few seem to want if they could trade if for performance & battery... at least that's what I'm guessing, maybe the mainstream consumer care about showing mm's of their laptop but I kinda doubt it, at least battery performance seem more important
← PreviousPage 2 of 11Next →