Live data from Hacker News

Introducing hexagonal.js

blog.arkency.com

31–40 of 43 posts

Re: Introducing hexagonal.js

#31

Earlier quoted context omitted.

That was an honest question more than a complaint. Why do CoffeeScript libraries not use the coffee extension? For broader appeal? Even if you had JavaScript documentation, I would see the source was written in CoffeeScript and realize I can't easily evaluate the quality of the source. Choosing CoffeeScript must mean you prefer it over JavaScript, so why use the extension of a language you do not prefer over one you…

You can look at the source just like any other js project. It might not look totally clean as a hand-written project, but there are absolutely worse things than looking at compiled coffeescript ( cough lodash https://github.com/bestiejs/lodash/blob/master/lodash.js#L38... )

To be fair, that's a template you linked...

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?

Re: Introducing hexagonal.js

#32

Why not call it hexagonal.coffee? Why do CoffeeScript libraries get a .js extension? Yes I realize it works for JavaScript too, but it's weird to go see a library with *.js in the name and then to find only CoffeeScript in the documentation.

Because it is javascript, to be used by javascript projects. Not having JS examples is just a problem in the docs, not the library.

No, it's not JS.

    > class UseCase
    SyntaxError: Unexpected reserved word

Re: Introducing hexagonal.js

#33
post #17

Hexagonal uses Raganwald's metaprogramming ideas. Follow the links from the dependency at https://github.com/gameboxed/YouAreDaBomb . This shows the beauty of Coffeescript syntax for functional programming. For a deep understanding read Raganwald's new book http://ristrettolo.gy .

Ok, I was thinking the idea behind this sounded a lot like the M.O. of Aspect-Oriented Programming, and it wasn't until I followed your github link that I saw that it was an "AOP library for JavaScript".

Not to take anything away from Raganwald, but there are other AOP JS projects (meld[1] would be an example).

1. https://github.com/cujojs/meld

Re: Introducing hexagonal.js

#34
post #21

Earlier quoted context omitted.

"Why can't MVC be compositional?" 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'…

I agree with your latter point. MVC isn't the last word in architectural patterns. 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 b…

MVC doesn't have anywhere in it for a client-server relationship. This is because MVC is actually a desktop app model, designed for things like CAD programs. Client-server connections are too important to gloss over, because you can't gloss over the Fallacies of Distributed Computing: http://www.rgoarchitects.com/Files/fallacies.pdf And your architecture must actually handle those issues, which means it's not going to be MVC.

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.

Re: Introducing hexagonal.js

#35
post #31

Earlier quoted context omitted.

You can look at the source just like any other js project. It might not look totally clean as a hand-written project, but there are absolutely worse things than looking at compiled coffeescript ( cough lodash https://github.com/bestiejs/lodash/blob/master/lodash.js#L38... )

To be fair, that's a template you linked... 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?

That template is source code for a function, it becomes the body of many lodash methods using eval. It's not out of my way, it sits right on top of my personal "ugly code" list; couldn't think of a better (worse?) example.

As I understand it there is no hexagonal source, it's just an architecture.

Re: Introducing hexagonal.js

#36
post #32

Earlier quoted context omitted.

Because it is javascript, to be used by javascript projects. Not having JS examples is just a problem in the docs, not the library.

No, it's not JS. > class UseCase SyntaxError: Unexpected reserved word

Of course CoffeeScript code won't run as javascript, it's not a superset. But it operates on the same global scope, the same object model, with similar semantics, so it "is" javascript, unlike other compile-to-js languages.

After 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.

Re: Introducing hexagonal.js

#37
post #29
post #4

There's far too many typos for me to have any amount of confidence in the code itself. Sorry, but I can't trust my business with people who cannot even be bothered to write proper English for their introduction.

I'm sorry for my angry comment. I guess I didn't hit the proper tone. I'm leaving it here for my eternal embarrassment, but here's what I meant to say: 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 "mino…

Although I broadly agree with your point about significant details, it's absolutely not the case that English 'isn't much of a problem'. English is an extraordinarily hard language for a foreign learner: the grammar is idiosyncratic and subtle, our use of prepositions is frankly bizarre, the orthography is about as difficult as they get, etc. etc. etc.. English is a dominant language for historical reasons, but it would be hard to choose a worse one on linguistic grounds.

Re: Introducing hexagonal.js

#38

How can it be a good thing to follow the MVC framework on both the client side and the server side, as it says in it's philosophy, when the client side is the V in MVC?

The OP likens the technique to DCI, which is contrasted to MVC by the inventor of both techniques in this article:

http://www.artima.com/articles/dci_vision.html

Re: Introducing hexagonal.js

#39
post #32

Earlier quoted context omitted.

Because it is javascript, to be used by javascript projects. Not having JS examples is just a problem in the docs, not the library.

No, it's not JS. > class UseCase SyntaxError: Unexpected reserved word

Of course the point is it's not clear what it means to "be JS". Is it more important for the name to express what syntax the source code is in or what platform the code can run on? I think for your average developer who just wants to consume a library, they care more that it is a javascript-based library that they can use.

Re: Introducing hexagonal.js

#40
This looks very cool, I've recently finished a Javascript application that used AOP for connecting the View to the Model and it rocked. I think I implemented up more or less this framework, but less generic.

The 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.

Post reply on HN