HNHacker News
TopNewBestAskShowJobs

Anchor

1,507 karma · joined April 5, 2008

submissionscomments
Anchor··on Ask HN: Front-end “design patterns”?
Here is a good introduction to structuring applications https://www.youtube.com/watch?v=HhNIttd87xs The talk is given by Robert C. Martin (Uncle Bob) and, quite naturally, also touches the issue of testing.

Much of this comes down to decoupling different aspects of the system: persistence (DB), domain logic (business rules), delivery mechanism (web, REST), presentation format, UI layout, etc. This aggressive decoupling enables one to isolate and test these different facets of the system individually. Of course, building this decoupling requires some effort, and one has to be careful not to over-engineer. As with many things, it is a balancing act.

And yes, you can do TDD with the UI; separate the UI logic (user actions, UI state, input validation, etc.) from the layout system (and don't try to test the latter automatically). The fun thing is that when the system is decoupled, you can test the user interface of a JavaScript web application without ever starting a real* browser, running a web server or spinning up a database. It is an interesting system design challenge to be able to run even your UI tests at a rate of 100 tests/second.

*A headless browser is not a real browser in this sense

Anchor··on SourceTree now has 650,000+ MAUs
A decent workaround is to use the 1.5.2 until they manage to fix the current version.
Anchor··on US Senate Report on CIA Detention and Interrogation Program
McCain: Everyone knows we waterboarded. [1]

[1] http://www.cnn.com/video/data/2.0/video/us/2014/12/09/lv-mcc...

Anchor··on Mean People Fail
I think I agree with pg on this more than most here. To me, being mean means enjoying the suffering of others in itself (that is, without any other benefit). Most examples mentioned here refer to CEOs etc. who have been ruthless in their actions, but have benefited from it (financially and otherwise). They have not been mean in the sense that they would have done it even if it wouldn't have benefited them in other ways. I think this applies to Linus too, he may get so upset about the minor things that he, quite literally, verbally assaults people, but I don't think he enjoys being that upset.
Anchor··on Show HN: Pikock, a website builder made with AngularJS, Bootstrap
Respond [1] seems promising. We have been using it for a year now for a small website, and it offers most functions we need, with the ability to customize reasonably if you know your Bootstrap.

[1] http://respondcms.com

Anchor··on Are we doing MVC wrong?
This is similar (or more or less the same) idea that has been advocated by Uncle Bob and others. Here's my comment on the experiences we have had with this approach: https://news.ycombinator.com/item?id=6470693 (the topic was about running tests quickly, and the approach, as mentioned also in the article, decouples the business logic from frameworks - allowing testing without firing up web server, database, etc.).

I agree that the interactors make rather odd-looking OO classes, but I suppose the imperative nature of most requests to perform some logic make them less objects in that sense. This has the added benefit of seeing what the system does, just by looking the class names in the interactors folder/namespace.

Anchor··on Slow Tests Are the Symptom, Not the Cause
Here's Uncle Bob talking on his version of the idea extensively: https://www.youtube.com/watch?v=WpkDN78P884 The main idea is to separate the system into entities, interactors and boundaries, which correspond roughly to model, controllers and interfaces+DTOs (Data Transfer Objects), but with the difference that model classes are not exposed through the interfaces. Rather, the DTOs are used to communicate the changes in the data.

We have been using this approach for a year now, with REST on top, and it so far has worked beautifully. The entities map naturally to REST resources and DTOs makes nice request and response classes.

Armed with CQRS (now I sound enterprise-y), the data storage is easy to work with using the same DTOs (the data storage and its interface do not know anything about the entities either). On the DB implementation level, we work on the DTOs, which are trivial to store to the database (even without ORM, although it does remove much of the boilerplate). Only one class - the entity repository - is needed to convert the DTOs to entities, and this only happens on create, update, and delete. Reads (due to CQRS) go directly to DB without instantiating any entities - neat. We also use 'unit of work' -pattern to abstract the notion of transaction on create, update, and delete operations, which simplifies the interactor code, hiding the nature of the data storage (making it a swappable in this respect too).

But to stay on topic, our tests are fast too as the interactors can be tested by injecting an in-memory database as a data storage to test the business logic, and the interactors have no dependencies on any frameworks, web or otherwise. Testing the interfaces makes BDD feel natural and also supports clear separation of the REST layer (the communication channel) and the interactors (business logic).

Anchor··on Software Development Estimates: Where Do I Start?
You don't have to know the ROI value of each project, just compare their relative sizes to select the best from the set of projects with the highest profit ranking.

This assumes, though, that the best of the projects is worth building in the first place.

Anchor··on [dead]
As far as I can tell, there is no catch, other than they hope you'll produce software for the Windows ecosystem (but there is no penalty if you don't). You'll probably also continue using MS tools afterwards (but this is of course not mandatory either).

As for the requirements, you have to have a company, small enough when entering the program (can outgrow the entry requirements during the three years and still stay in), and it has to produce software (service or packaged).

Anchor··on Almost Too Beautiful (2003)
The same argument is made for contemporary architecture by Christopher Alexander: almost everyone focuses on creating something novel instead of structures of lasting value and source of, well, goodness. Alexander called this quality 'life'.

I think it is a sad state of affairs that it is indeed so in the modern world.

It is also interesting that it happens in so many distinct areas. Perhaps it is a property of the society and how it is structured today. It is of course rare for a community of nonprofessionals to be able to build a complete modern house. Why this affects musicians too, is not clear to me. The rise of individualism maybe?

Anchor··on Train Philosophers with Pearl and Kahneman, not Plato and Kant
I'm making my way through The Process of Creating Life. It's one of only two books that I've read in recent years that I can't read too much of at once – I get three pages in and have to stop, because of how excited I am about his arguments and its implications.

I bought the whole The Nature of Order series five years ago and have been ever since trying to find a person who has read it. A have returned to the books periodically, and again and again feel the same excitement that prevents reading too much at one sitting. I have not yet encountered another book that does the same.

In fact, I feel the same way about writing this reply. It is as the implications of the book are too - how should I describe it - something to be spelled out; somehow I do not feel I can do justice to the text by discussing it. I do not even know where to begin.

Perhaps it is best summarized by saying just read it. Yes, this is a lousy book review, and the price tag is not of the average variety, but this is a series of books for (of) life.

Anchor··on Conway's Game of Life, using floating point values instead of integers
I wonder what a 3D version (http://www.ibiblio.org/e-notes/Life/Game.htm) of a continuous game of life would look like... could similar cell-like structures emerge with these kind of rules also in 3D.
Anchor··on Lumia 920 low-light shootout with iPhone 5, HTC One X and Galaxy S III
Related discussion on the OIS performance earlier today: https://news.ycombinator.com/item?id=4575816
Anchor··on Actual OIS performance: Lumia 920 against iPhone 5, Galaxy S III, HTC One X
Engadget has also done a low-light comparison today: http://www.engadget.com/2012/09/26/lumia-920-low-light-shoot...

920 seems to live up to the promise also in this regard.

Anchor··on Tim O’Reilly: Why I’m fighting SOPA
In fact, sometimes it may be the reverse - the net result, that is. Being able to pirate products (say, music) may lead to more consumption of services (say, concerts). I do not have a citation available, but IIRC, studies have shown that people who pirate CDs generally use more money for going to concerts, buying merchandice, etc.
Anchor··on Five-minute Multimethods in Python
Yes, but not quite. Consider the following example:

  static void Main()
  {
    Bar( 12, 15 );
  }

  static void Bar( object o1, object o2 )
  {
    Foo( o1, o2 ); // error
  }

  static void Foo( int x, double y )
  {
    Console.WriteLine( "int double" );
  }

  static void Foo( double x, int y )
  {
    Console.WriteLine( "double int" );
  }

  static void Foo( double x, double y )
  {
    Console.WriteLine( "double double" );
  }

  static void Foo( int x, int y )
  {
    Console.WriteLine( "int int" );
  }
This does not compile as the compiler does not know which of the four versions it should call. As jules said overloading is resolved at compile time by looking at the compile time types. Multimethods are dispatched at run time, by looking at the run time values. In this case that would be the "int int" version.
Anchor··on NASA scientist finds evidence of alien life
Full paper can be found at http://journalofcosmology.com/Life100.html
Anchor··on Dog learns over 1,000 words
The article and related discussion five months back http://news.ycombinator.com/item?id=1557209
Anchor··on Some Heroes
Have you read The Nature of Order by Christopher Alexander? I'd very much like to hear your opinions and comments on the book series. And also see, whether he would appear on your next list of heroes.

He is definitely on mine.

← PreviousPage 3 of 3