Introducing hexagonal.js
blog.arkency.com
blog.arkency.com
Also, why go out-of-your-way to bash another project? Why didn't you link the hexagonal source you mentioned, which would have been productive, instead of lodash?
As I understand it there is no hexagonal source, it's just an architecture.
> class UseCase
SyntaxError: Unexpected reserved wordAfter reading more about it, I agree that it shouldn't have .js in it's name, or any other language extension, since it's not a framework/library. The fact that the examples are written in CoffeeScript is incidental.
This shows the beauty of Coffeescript syntax for functional programming. For a deep understanding read Raganwald's new book http://ristrettolo.gy.
I'm one of the people behind hexagonal.js. Raganwald's work enabled us to implement one of the main components - the glue code.
Not to take anything away from Raganwald, but there are other AOP JS projects (meld[1] would be an example).
class Glue
constructor: (@useCase, @gui, @storage)->
@useCase.on
askForName : @gui.showAskForName
nameProvided : @gui.hideAskForName
greetUser : @gui.showGreetMessage
restart : @gui.hideGreetMessage
@gui.on
restartClicked : @useCase.restart
confirmName : @useCase.nameProvidedThe name is an issue though, hexagonal.js doesn't seem to have to do anything with what this framework does. If it is a framework that applies AOP to MVC, why not pick a name that relates to that? There isn't even a mention of AOP anywhere in the introduction.
Because then it's not really MVC anymore. It's something else, perhaps inspired by MVC, but not MVC.
The web world really needs to get over its juvenile idea that MVC is the One True Architecture and if something isn't MVC it isn't good and therefore if we want to present a new library with a new design it is Mandatory to explain how "No, really, it's MVC! Even though it isn't, here's how it is!". It's not MVC. That's fine. It's probably better. Many designs are. MVC is fine in its niche but that niche doesn't cover Every Web Application Ever very well.
However...
> Because then it's not really MVC anymore. It's something else, perhaps inspired by MVC, but not MVC.
I fail to see why the example I gave does not follow MVC. You have MVC on the server (as people have been familiar with for a very long time. Nothing new here). In turn, that data produced by the view on the server (could be HTML, XML, JSON, whatever) can form the model of a second MVC architecture on the client side.
What exactly isn't MVC in either the client or server? The only thing I can thing you might take issue with is consuming the model from the data sent from the server, but I couldn't explain why. This is still in keeping with the MVC pattern, which in no way prescribes that the data has to come directly from a database (or whatever else the server's model's state is formed by).
Or is the problem with the server's view not generating output that is necessarily HTML to be looked at, but data to be further consumed? Again I don't see how that doesn't fit in with the MVC framework.
MVC makes sense for a pure Javascript app that uses the server only as a DB server (if that). It can at least be jammed into a classic old-style pure server application. But if your app actually spans the two, you haven't got MVC anymore... or you've got an app scoring 8 out of 8 on the network fallacies, probably by virtue of trying to wrap all network access behind an "RPC" interface, which tries to represent network interaction as local function calls, which one of the easiest ways to score an 8 out of 8 on the fallacies list.
Because of the way MVC tends to afford glossing over the network fallacies, I tend to consider it an inferior design for almost any web application. It's a lot of code busywork to try to sort of kind of (probably not actually, assuming the MVC one is starting with is even MVC in the first place and not just "vaguely MVCish in name only") conform to a particular architecture, requiring at least three moving pieces to do anything (one in each letter of the acronym, in practice, often a view on the server and on the client) mandating that your application be flung out all over the place, and it gives you... hardly anything in return, really. Certainly nothing that a direct application of DRY couldn't have given you. It isn't necessary for most web apps and it's a terrible default for a new web framework to impose on its users.
While I'm not a fan of the "hexagon" name (the number "six" doesn't seem to have any meaning, except this guy once drew a diagram in a hexagon), it's a much better way of looking at things. I tend to think of it as a celluar design; there are the cell innards, then surrounding it is a cell membrane that is responsible for cleaning up the innard's view of the outside world, and exposing well-defined capabilities to the outside world. (The metaphor is not perfect; biology is messy, and there's no compelling reason to copy that aspect. But the general idea of cells, or hexagons, is quite powerful.)
One of the interesting aspects of Haskell is that it tends to enable the creation of a lot of very fine-grained cells, where the type system is helping you build a very strong and very well-defined membrane; it allows you to see even things as simple as "map" as fitting in to this model, at the smallest level.
Sorry, but I can't trust my business with people who cannot even be bothered to write proper English for their introduction.
As someone else said, he was being a dick about it, and the implication that English skills are somehow related to coding skills is obviously nonsense. (And he still managed to make mistakes of his own while criticising your language)
To be a bit more constructive, here's a slightly rewritten introductory paragraph that I believe reads more natural (though English isn't my native language either):
"There's an idea we have been working on for more than one year so far. As backend developers we were thrown into the mysterious world of frontend (client-side) apps without any good pattern for creating Single Page Apps. So we (GameBoxed + Arkency) invented one - hexagonal.js."
But the most frequently occurring English mistake on your page appears to be missing "the"'s. This error is very common with speakers of slavic languages. Based on the admittedly limited example of your English on the linked page, I think one of the biggest improvements you can get with relatively little effort would be if you spend some time reading up on how to identify where/how to use "the".
It's a pitch from dedicated folks. Treat it as such?
On topic: Looks like an interesting collection of ideas, and as I've never heard of hexagonal architecture I'll definitely have to look into this. Always researching better ways of doing structure.
I have had many bad experiences with incompetently-written libraries. A bad library can cost you days/weeks of productivity lost in fighting its idiosyncrasies and/or straight up bugs. A really-good indicator of the quality of a lib is the attention to detail in "minor" details like documentation.
Obviously if the docs are littered with typos they will be less useful, but there's another layer to it. English isn't much of a problem for sufficiently-skilled programmers, even if they are of foreign descent.
So, when I see a lib written in broken english like this, I make my conclusions about the attentiveness and skill of whoever wrote it. I'm not saying it's always right, but in the long-term this has saved me a lot of headaches.
Sorry for raining on everyone's parade, though. This really isn't the proper way to start a conversation.
Strongly disagree. Flexibility in a language leads to flexibility of the mind. The English language's incredible variety, massive vocabulary, and huge range of idioms is of great benefit to those that speak it (while also making it difficult to learn). Subtlety in a language is a virtue, not a vice.
For maximum linguistic impact, people should also learn languages that read right-to-left.
If you really want a more-or-less linguistically "simple" language, Spanish is a decent choice (and is also the second most widely used language, after Mandarin).
Indeed, but I think we're talking about language in two different ways: all your points are completely correct, but mainly of value to those who understand the language fairly well; my points were implicitly from the POV of a foreign learner trying to pick the language up.
As a native Anglophone, I love our freaky language, orthography and all. However, I try to keep reminding myself how horrible it is for new learners.