HNHacker News
TopNewBestAskShowJobs

andrzejkrzywda

642 karma · joined February 11, 2011

Arkency CEO

blog: http://andrzejkrzywda.com

submissionscomments
andrzejkrzywda··on You don't inject for tests
When things are hard to unit test, it might be a smell that there is something wrong with your OOP code.
andrzejkrzywda··on You don't inject for tests
Yeah, I was thinking about this recently. All of the "good patterns" turn your code into data. At the end it's more of declaring than coding the logic.
andrzejkrzywda··on "DCI" in Ruby is completely broken
At a code level - no need to write the delegation methods/macros.

At the design level - flat hierarchy

At an abstract level - thinking in terms of objects, not classes.

andrzejkrzywda··on "DCI" in Ruby is completely broken
I'm "thinking in DCI" for 2 years now.

At GameBoxed (http://gameboxed.com/) we've got a Rails app that uses a lot of .extend on every request. It's in production for 1.5 year now.

It's a backend for multiple social games (one backend app for many CoffeeScript frontends).

It's not huge in terms of traffic and performance needs. We implemented it with a DCI-like architecture in mind. It was helpful at the beginning. DCI wasn't the only way to implement it, but it was the simplest way for us at that time.

We've had some performance problems, but they were never related to the usage of .extend. If it was a performance problem, we would probably consider removing the .extends (not a big deal), switch to Java, do more caching, there are so many options.

Again, we don't have huge performance needs, we've maybe 40 req/s at peak times.

DCI is much more than .extend, it's a huge shift in thinking about the OOP architecture.

If we (as Ruby community) agree that it's an architecture worth trying, then maybe it makes sense to introduce better optimisations techniques to the current Ruby implementations?

Anyway, it's great to see the discussion happening. DCI may not be ready to use right now, but it's more of a change in thinking than in the implementation.

I definitely wouldn't call it completely broken in Ruby.

Here are some of my posts on DCI in Ruby:

http://andrzejonsoftware.blogspot.com/2011/02/dci-and-rails....

http://andrzejonsoftware.blogspot.com/2012/01/dci-and-rails-...

http://andrzejonsoftware.blogspot.com/2011/08/dci-patterns-h...

andrzejkrzywda··on What is a framework?
"framework is a set of libraries, glued together with some infrastructure code"

That sounds a bit too generic. There are possibly some libraries that group other libraries, but are not really a framework.

andrzejkrzywda··on Get notified when somebody mentions you on IRC
I'm a big fan of IRC. At work, I'm forced to use HipChat, though. The feature that OP described (mentions) works really great there.

It's great to have it in irssi as well. Testing it!

BTW, when does someone create a working implementation of IRC-based webchat? Please, don't mention grove.io...

andrzejkrzywda··on EBook - programmer to physical product business owner
Interesting. I've never seen an introduction to creating physical products, targeted to programmers.

As a programmer, it both - kind of scares me and excites me.

Count me in, I'm interested!

andrzejkrzywda··on Facebook users don't give a heck about apps notifications anymore
tl;dr

Users do not accept invites to new apps anymore. Notifications can be used to increase the retention (with give-a-life, send-a-life feature).

andrzejkrzywda··on From backend to frontend. From Ruby to CoffeeScript
I'm really happy to see more and more backend developers discover the joy of frontend programming!

As for the main point, I agree that JS stdlib is almost non-existing and can't be relied on. Libraries like underscore.js or sugarj.js fill the gap and compete for the community-stdlib.

Good post!

andrzejkrzywda··on MVC is dead, it's time to MOVE on
It's more than a definition issue.

You haven't used MVC, you have probably used Model2. The post we're discussing is about MVC.

http://andrzejonsoftware.blogspot.com/2011/09/rails-is-not-m...

andrzejkrzywda··on MVC is dead, it's time to MOVE on
Thank you for this comment. I was slowly losing my faith in HN developers knowledge.

Server MVC (Model2) is not the same as client MVC (the classic one). They are totally different architectures. Patterns that apply to one, don't apply to the other.

You can't get MVC with Rails/Django/Struts. You can get a nice MVC with a Single Page Application or with a desktop app.

A similar discussion was already here: http://news.ycombinator.com/item?id=3035549

andrzejkrzywda··on Frontend is a separate application
"I still find back-end developers who are resistant"

"(...) how happy they where not not have to deal with UI requirements and be able to focus on the business logic."

I've noticed the same, but I still don't understand why is that.

I'm curious why so many backend developers are not happy with working on the frontend part?

andrzejkrzywda··on Ruby On REST 2: Representers and the DCI Pattern
Yes, exactly.

The idea is that the Data doesn't change that often, so it's kept separate from the things that change frequently - roles, use-cases.

Exposing use-cases is also an important goal, usually they are scattered across the codebase.

andrzejkrzywda··on Ruby On REST 2: Representers and the DCI Pattern
The metaphore of DCI is a theatre. The context is the director. Chooses who plays what, instruct them how to do it and then let them play.

Theory:

1. Expose use-cases (context) as first-class citizens of your code.

2. Each use-case selects which objects are needed for this use-case.

3. Extend the objects only with the roles that are needed in this use-case.

4. Start the interaction.

Example:

Buying a product.

1. UserBuysAProduct object, that can be executed.

2. Objects/actors needed: user, shop

3. Extend user with a Buyer role and shop with ProductCatalogue and OrderManager.

4. call shop.buy_product(user, product)

andrzejkrzywda··on Rails is not MVC
OP here.

There's one more reason why I want to clarify the situation with terminology.

Apart from being a Rails developer and running a Rails company I also teach Ruby on Rails at a university.

Obviously, I'm not the single source of knowledge for the students, however I want to clearly explain to them what is Rails, what is MVC and what is Model2.

It doesn't help me that when they go to any Rails website there's information that Rails is MVC, which is not.

Here and on my blog you can find comments from people who are confused with the current situation. I'm not expecting that today we're going to agree on any solution. I just want to point out that the definitions and their usage are not precise.

andrzejkrzywda··on Rails is not MVC
I'm a Rails person, but I always respected the Django community. The fact, that you were clear with the MVC vs MTV approach since the beginning was one of the reasons.
andrzejkrzywda··on Rails is not MVC
Here are the definitions as I know them:

MVC - MVC is separated, Models can notify Views.

Model1 - mixing all code in one place, often seen in first PHP apps

Model2 - separation between Model and View, I think Struts started it. Rails made it prettier.

Yes, the gain from correcting the confusion may be small. However, the topic of JavaScript MVC is going to be huge soon, good to know the differences.

← PreviousPage 2 of 2