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 Afterglow: Dark Theme for Sublime
I find using a dark theme when coding in the dark is better because the bright white background won't blast your face.

light themes are better if you have a glossy display and there's some sunlight since you won't see so many reflections

mhomde··on The new MacBook
I have a maxxed out XPS 13 and its a love-hate relationship. The screen and build quality is great, the keyboard ok and the touchpad as well. There's very little to match it in that form factor right now

It's noisy as hell though, I can't say that battery life is great and I have some weird problems with music stuttering when I compile, also Visual Studio ocassionally locks up on deploy for some reason.

If I could have a Zenbook with the same screen thought I'd take that any day.

mhomde··on ResearchKit: A software framework designed to benefit medical research
Open Source, wow that was unexpected from Apple
mhomde··on Signs that you're a bad programmer (2012)
I agree with you to a certain extent but... the road to code hell is paved with "don't disturb the tests" intentions ;)

This is a bigger problem the less continuously you refactor. I've seen this mentality in a lot of projects, where they don't dare "mess with the code" because it might introduce bugs or break the tests... but IMHO this is where I think TDD sometimes goes too far.

It should ring warning bells if your code, tests and development cycle is so fragile that you can't do continuous cleanup. In its extreme this is the lava flow anti-pattern.

It must always be preferable to get the code base as compact and simple as possible but bugs will be easier to find and the code easier to understand for everyone... otherwise you're just accumulating technical debt.

Rather than storing nitroglycerin in a pillow factory it usually is a good idea to make it less volatile.

mhomde··on Signs that you're a bad programmer (2012)
I feel like we're talking about different things...

Continuous refactoring IS focusing on quality, it IS managing complexity. I think you've seriously misunderstood Deming if you think he stood for "Do it perfect from the start". The whole Kaizen philosophy is built on continuous improvement and elimination of waste (redundant code)

I'm not saying do a week/month/year of crappy coding and then "fix it later". Refactor continuously and as often as needed. Writing code is research.

The cost of refactoring is the greatest when you've done it too seldom. Otherwise with the right tools it's pretty efficient these days.

I see larger dangers in doing up front architect astronauting and make decisions before you've internalized all the problems.

For complex project it's of course appropriate to gather requirements, limitations etc and make a rough design, but going into too much detail is setting the cart before the horse... IMHO of course.

mhomde··on Signs that you're a bad programmer (2012)
I agree, it's very seldom a method should be longer than 20 lines, and optimally around 6 lines. Any method over 50+ lines should require a long hard look if there isn't a way to simplify it. Inlining everything only gets messy.

I would say that if you have a method composed of many methods you might want to encompass that into a separate class. That way you have everything needed to look at that method nicely in one place rather than interwoven with another class.

Depends on the scope of the method though, you want neither a blob nor a poltergeist.

mhomde··on Signs that you're a bad programmer (2012)
Very true, we're all "bad programmers" in comparison to the programmer we'll be in three years :) (well if we're passionate about programming at least)
mhomde··on Signs that you're a bad programmer (2012)
You should never have to "fit a large problem" into your head, at least in detail, at once. I think it's something of a myth that that's what great programmers do, when in fact they structure their code to avoid it.

I've built immensely complex software and in the end the code was good not because I was smart, but because I am stupid, and adapted the code to work around my limitations. It's the "smart" programmers I worry about :)

The key to conquering complex problems is to layer it into levels of abstractions, dividing it into ever smaller parts that does one thing. Then one step up in the abstraction you don't have to worry about the details beneath. If you think about it that's how programming languages themselves work, we no longer push around registers and instructions, its turtles all the way down.

Your mind should always be able to encompass the level its currently on. That's why reducing the amount of code is important. Increasing the entropy in your code makes it more readable and understandable. It also makes it easier to spot patterns. Whenever your code starts feeling beyond easy comprehension it's time to divide it further.

If a problem feels to large, my advice is just to start doing classes or methods that attacks different aspects of the problem, and then compose those.

There's a nice quote by Linus:

"Bad programmers worry about the code. Good programmers worry about data structures and their relationships."

Good structures will shield you from a lot of complexities and simplify your code. Structures are easy to test. Always consider if there isn't a collection or other data structure that could swallow some complexity.

Also, never be afraid of making mistakes, coding is an explorative process and the most valuable thing you can do is to do a mistake and realize it, because that also often means the solution presents itself clearly.

No code is wasted code because even though you might end up deleting all of it the lessons they leave behind are valuable.

In the end coding is a lot like writing a book, get everything down on paper/code without worrying too much and then iterate and move things around until its good :)

mhomde··on Signs that you're a bad programmer (2012)
That's like writing a book "correctly" the first time without drafting (there are a few authors that does that, but not many). Or drawing a picture without sketching.

Much of the coding process is gaining knowledge of the problem you're trying to solve and discovering patterns as you go along.

Also typically features are tacked on over time, and it reaches a point where new patterns are needed that wasn't needed before.

I agree with you in some sense though, some patterns are low-cost and high-reward in versatility & maintainability. Like using events rather than explicit references, and you should use them from the start as a matter of "good habits".

Some more overreaching patterns like factories, modules, plug-ins etc etc only make sense when the code reaches a certain scope.

mhomde··on Signs that you're a bad programmer (2012)
If anyone hasn't read it I highly recommend the book "Antipatterns" (http://www.amazon.com/AntiPatterns-Refactoring-Software-Arch...

... or just google antipatterns.

My personal pet peeve is that many programmers don't refactor nearly often nor thorougly enough. It should be natural part of the developing process. Especially with large programs you reach certain points where all encompassing refactoring is needed to simplify the code, yet many power through leading to a bloated mess.

I've found its not uncommon that even decent complex code can be shrunk 70%-80% using refactoring, code generation and config files.

mhomde··on Europe’s New Culture Capital Is Lisbon
Au contraire, that's the perfect cities for startups since they bring the work with them. Why do you think Berlin is becoming the Silicon Valley of Europe? Because for a long time there were not many jobs and rents were low, making a perfect vacuum for tech companies to move into.

On the other hand Stockholm is struggling because despite world class tech talent and high salaries apartments are almost at New York level.

mhomde··on Ask HN: Idea Sunday
Ever heard about Microsoft's Hailstorm and the backlash that followed? :)

For the record I think it's a good idea if it can be standardized and federated so you can choose and move between providers

mhomde··on Fired
I guess that's the other side of labour laws, firing someone who's been employeed more than six months in Sweden requires talking to the union (if you have one), given a valid reason, if it's "lack of work" they have to offer the position back to you if it changes.

The amount of months's notice you get changes with your age and years of employement as well. Sometimes you have to sack entire departments just to defeat the LIFO policy.

Now I think Sweden's laws can be a bit too strict, companies are deathly afraid to hire the wrong people (after the six month trial period) since they can't get rid of them, and companies should be able to get rid of underperformers, but living in a country where your boss can go Donald Trump on your ass on a whim isn't exactly ideal either...

mhomde··on My Y Combinator experience
The thing is the most ludicrous ideas might also be the most brilliant ones, and the only way to know is in hindsight. I mean hell Google was a ridiculous idea in its day. Tesla was too in the beginning, and numerous other companies.

Some ideas do require a lot of risk in form of up-front development for a shaky idea, but that's the only way to find out if that particular idea works.

There are some ideas where you can simply throw shit on the wall until something sticks and iterate from there but there are also ideas that you have to go all in on.

If someone says they're going to develop a "revolutionary new programming language" that will obsolete java/c# (or something) I'd roll my eyes and call bullshit, and in 99.9% cases it will be true, except for the one that isn't.

Its up to every entrepreneur and venture capitalist to choose what kind of idea to bet on. I'd only hope that the entrepreneur picks something they're passionate about.

You could say that you should at least be aware of the risk and scope of the idea your pursuing, but is that even true? Some might be better of not knowing or they'd never attempt it.

As George Bernard Shaw famously said: "People who say it cannot be done should not interrupt those who are doing it."

mhomde··on Huawei Watch
I think this might be an example of Ive's lack of experience in UX versus industrial design is showing. Not saying he doesn't know UX but it isn't his primary mode of operation. Or they simply didn't have time to do a circular UI.

I'm a big believer that the best smart watches will be round. A circle is more aesthetically pleasing than a rectangle. More importantly it has better ergonomics and you could do things like rotate the watch face according to hand position.

Lots of content looks really well when encapsulated by a circle since it looks more "organic". Photos, faces, maps, time. It's a little bit worse for chunks of text however but most snippets displayed like a SMS should be pretty short.

There's also a huge opportunity to use a rotatable bezel as tactile complement to a touch screen, making zooming, and scrolling easier. Being excellent for things like "dial selectors" and preventing smudges and being all around easier to find, grip and manipulate than the screen or a crown. Having invented the scroll wheel for the iPod for nearly the exact same reasons one would think Apple would be wise to this fact.

So what about the claim that it should be rectangle because "a huge function is lists". I think this simple is lack of imagination on the UX part. You have to think of the main purposes for a watch, as a complement but not replacement for a phone.

I actually don't see many scenarios where you'd want to browse through large lists or wall of texts on your watch. In most cases you want to view small nuggets of information and do some basic manipulation. In many cases I think "scrolling" could be replaced by for instance simply switching the whole circle content and having some indicator in the perimeter.

I suspect however the reason that both Android and Apple is going primary the rectangular route is that it does however require more imagination and radically different UI's than a phone, and time weren't on their side to do that quite yet.

I wouldn't be surprised if most if not all smartwatches in the future are circular

mhomde··on Kvikkalkul: the secret programming language of the Swedish Navy?
As a Swede I'm pretty sure Kvikkalkul is not something we'd name a programming language, it sounds more like Norwegian or Icelandish

As a sidenote I heard an anecdote about a guy who programmed warheads. He was writing the detonate code wondering how to exit gracefully when it exploded so he wrote something like:

   10: var a=5
   20: Detonate()
   30: If (a==5) goto 10;
   40: Exit;
The logic being that the variable should be empty upon explosion...
mhomde··on Dell XPS 13 Review
I've had the high end version (i7 & hi-res touchscreen) for a couple of weeks as my primary development machine and so far is pretty satisfied

The keyboard is more plastic than for instance the Zenbook but good. I've had no issues with the track pad, two-finger scrolling works perfectly. Best trackpad I've had on a PC laptop (don't know what The Verge was raving about, maybe pinch gestures aren't as good as mac?)

As for battery issues, It does feel that it doesn’t last too long, like 3-4 hours tops (I run Bitlocker & Chrome though so that has some impact). I don't think this is as much the laptops fault really as it depends mostly on having a screen with very high resolution and depending on how you configure power saving options, what kind of work you do etc.

I think it’s pretty safe to say that the Xps "13 is the best PC laptop in this form factor right now until sharp releases the exclusivity on the screen in November, then Asus might give them a run for their money again.

To their credit I vowed never to buy a dell laptop again but they proved me wrong. A 14"-15" version of this laptop with more ram would be the ultimate though, larger screen so you can use the resolution better, more battery volume for a little better longevity.

I'm not so sure the hi-res version is the best option for developers because of the energy drain, especially if you need to work on battery for a whole day. The power pack buys you some time but very doubtful you'd last a whole day.

Also matte screens is often better than glossy for development, at least when working outside or where's there's sun.

Then again, you might need touch for development and the touch version with gorilla glass looks much better.

Personally the feature I'm dying to get now that we have almost bezel free computers are Amoled screens. Bezelfree where the true blacks of the screen blends into the little bezel there is would be truly droolworthy

mhomde··on “Equation Group” ran the most advanced hacking operation ever uncovered
Couldn't you secure yourself by say running an OS image with a truecrypt partition?
mhomde··on Why reading a book 100 times is a great idea
Some advice if you already haven't heard it:

When you're done with the first draft. Take a break, like 2-4 weeks, enough to forget it before you start rewriting. It cures you from the "blindness" and let you see it with fresh eyes

Anecdotally I've had the same experience when I go on long vacations and come back and look at all my code. "OMG What is this? It's clearly not as easy and understandable as I thought. Must rewrite immediately."

Not to mention stuff you wrote years ago shudder

mhomde··on The Interface Hall of Shame
God, I had repressed what old windows UI's looked like
mhomde··on Flipboard releases React Canvas
Rx programming is so great. It's one of those things that you seldom find a use case for but when you do it leads to 50x easier and more readable code. It truly is for events what Linq was for collections Mostly only useful with more advanced ui and network programming though
mhomde··on Sexism and consequences at TechCrunch’s annual award show
Video of T.J Millers presentation

https://www.youtube.com/watch?v=TcV3zQbeZE4

mhomde··on Show HN: A Global Co-Living Subscription for Nomads
Great concept!

I guess the selection that will occur based on the price can be either positive or negative depending on your taste.

One of the reason to join one of these communities, I would think, is to socialize and network with interesting individual... and you might want to pay extra for that. Then again, if the prize de facto excludes the people you find interesting than not so much :)

I think I'd try to do a little prize segmentation with tiered costs, that way you could perhaps get more interesting people and maximize profit. Then again maybe it will book fully using these prizes

mhomde··on First C# 7 Design Meeting Notes
cool, thanks!

Multiple bracket blocks is not the most esthetic of solutions I think but it's the best I can think of. Attributes feels too clunky and just stacking contracts as lines after the class statement feels too disorganized

mhomde··on First C# 7 Design Meeting Notes
I've been trying to think of something that drastically change how I coded. Bugs and productivity really are the two major dragons to slay.

I'm just spitballing here but something I'd really like to see stuff like code contracts and unit testing, but more integrated with the language, less verbose and requiring less to setup. Being able to let the "meat" of a method be separated from all the error-checking, post, pre conditions etc would really make things cleaner.

Current implementation feels like it requires too much setup with separate classes, duplicate method signatures in several places etc etc. It would be really cool to have something like

  public int SomeMethod(int a, int b)

  pre 
  { 
    Requires (a > 5);
    Requires (b >= 0, new Exception("something something"));
  }

  {
     // DoStuffHere
  }

  post
  {
    Ensures (result > 0, new Exception("needs to be above 0"));
  }
I'd even want to be able to separate it into separate files using partial classes (or something) so you could the condition stuff separate , with or without duplicating signature depending if you wanted to target specific overloads

Full signature would simply be without the body:

  public int SomeMethod(int a, int b)

  pre
  {
    Requires (a > 5);
    Requires (b >= 0 ,new Exception("something something"));
  }

  post
  {
    Ensures (result > 0);
  }
Without signature is trickier, but would be cool since you could use same conditions for several overloads, and just target the variables that are included in each:

  Conditions.SomeMethod
  {
    pre
    {
      Requires (a > 5);
      Requires (b >= 0, new Exception("something something"));
    }

   post
   {
     Ensures (result > 0);
   }
  }

heck, why not even throw in "test blocks" and Visual studio could run light-weight kind of unit test as you programmed and mark the whole method as functioning or not. Imagine having a sort method and throw in something like:

  public IEnumerable<int> Sort (IEnumerable<int> list, Order order)
  test
  {
     (list = {3,5,6,2}, order = Order.Ascending) => result == {2,3,5,6};
     (list = {3,5,6,2}, order = Order.Descending) => result == {6,5,3,2}
  }
VS could highlight the failed test(s) directly in the editor as you coded

The specifics and syntaxes of these things requires some thought but I love the basic premise, am I rambling?

edit: I saw that something in this direction if not as extensive was actually discussed

mhomde··on John Carmack's adolescent years (2003)
Are you kidding?? :) The two John' starting out as friends. Chaos Romero vs order Carmar. The rise of a small indie developer to super stardom. The ensuing split with Romero going full hubris with Ion Storm (Heck with the amount of drama and dirt available a movie on ion storm alone would make a great movie). Scenes with an battle axe breaching an office door, a gamer winning a ferrari. An underlying theme of "everyone's expendable".

It would make for one epic movie in the right hands.

mhomde··on Facebook was down
Somewhere in the world Jesse Eisenberg is throwing an epic fit
mhomde··on Chess: Who will win in this riveting game of Math.random() vs. Math.random()?
if anyone doesn't capture anything or move a pawn in 50 moves its an draw (better train on that bishop & knight endgame :)... if anyone claims it, so uh, not sure how that counts :) However if an checkmate is impossible with the remaining pieces it's automatic

edit: missing pawn from sentence

mhomde··on Scientists have shown that young blood rejuvenates old tissues
The inevitable "baby factory" scene in the movie is sure going to have some punch
mhomde··on Tech billionaire’s gnarly fight with California surfers over private beach
Wait I'm confused, does he own the beach or just the gate which accesses the beach? And why is he responsible and needs to be insured for people using the beach, or maintain it?

It feels like either you own the beach and can do whatever the heck you please, or you don't, and then it's not your dime nor your responsibility...

PR nightmare though, anyone made a flash-game where you try to sneak upon Khosla's beach while being hunted by him and his security guards yet?

← PreviousPage 9 of 11Next →