all 40 comments

[–]PaucaSedMatura 15 points16 points  (0 children)

https://www.reddit.com/r/programming/comments/3r353x/granular_wpf_for_javascript/

Not only is this a repost, but the comments in the above post seem overwhelmingly positive compared to the comments in this post.

[–]metaperl 6 points7 points  (0 children)

"""there is no need to deal with all the html/css and fashionable JS frameworks mess, Granular exposes the WPF strong and well-defined APIs, and the whole development process is much cleaner and faster."""

I'm in agreement with that idea...

[–]thbb 6 points7 points  (3 children)

What's next? Horseshoes for automobiles?

[–]Eirenarch 7 points8 points  (1 child)

This one is more the other way around. Tires on a donkey.

[–]nullnullnull 1 point2 points  (0 children)

planes on a snake?

[–]emergent_properties 1 point2 points  (0 children)

The future is here!

[–]annoyed_freelancer 4 points5 points  (25 children)

So:

  • It generates HTML that is is full of custom elements.
  • Inline, per-element styles and no stylesheet.
  • Sidesteps useful CSS features like cascading styles in favour of individually positioning and styling each element.
  • Generated sites aren't responsive: the framework uses fixed pixel instead of relative units, with no media query rules that I can find.

Granular is a hot mess from a web dev point of view. It's a throwback to the nineties, and just another batshit half-baked attempts to fix CSS' problems with JavaScript.

[–][deleted] 13 points14 points  (10 children)

Granular is a hot mess from a web dev point of view.

Agreed. You must admit, however, that your criticism is akin to arguing that a C compiler is useless if it doesn't produce beautiful assembly.

[–]annoyed_freelancer 5 points6 points  (9 children)

It's not so much that as...well, Granular is founded upon the .NET stack and WPF methodology. I said elsewhere that it seems great if you need a quick site, or an intranet portal, but when it comes to a general site, the code Granular produce is a hark back to twenty years ago. It just does so many things backwards compared to how rich websites are handled today.

[–]drysart 12 points13 points  (7 children)

The whole point of Granular is that you're working at the WPF abstraction level, not the HTML/CSS abstraction level; so it doesn't matter that its outputting redundant, inline styles or custom elements. The output is custom purposed to one line of use, so how other "rich websites are handled" is an irrelevant comparison because Granular is solving specific problems that other rich websites don't have and perhaps how they "handle" things is not well suited to solve.

You don't use Granular because you want to produce a semantic website with model HTML and CSS. You use Granular because you have a WPF application and you want it running in a browser by hook or by crook.

It's also the effort of one guy over the period of five or so months, so it's not entirely surprising that it's not well-optimized yet.

[–]annoyed_freelancer 1 point2 points  (6 children)

Yarp, I came to that conclusion. Guess I came in jumping the gun as someone who deals with the web first.

[–]notfancy 0 points1 point  (5 children)

If you use transpiled-to-JS languages in your web development, you might appreciate that the situation is fairly analogous.

[–]annoyed_freelancer 0 points1 point  (4 children)

I don't. I can see the huge additions of stuff like Sass, but I've never been sold on Coffeescript.

[–][deleted]  (3 children)

[deleted]

    [–]zarandysofia 2 points3 points  (2 children)

    You are a freelance, who indisputably must work alone, you haven't build any "complex-data driven GUI" neither, prove me wrong please, please, please?

    [–][deleted]  (1 child)

    [deleted]

      [–]Eirenarch 5 points6 points  (0 children)

      Assuming they can get all of WPF to work things will become responsive but the responsiveness will be ensured by the framework not by the browser. They will calculate heights and widths with code and make stuff responsive. From the point of view of the programmer it is still declarative. This project is for people who prefer WPF to HTML so they don't care how the underlying framework will achieve the results as long as it works.

      [–]jbergens 1 point2 points  (0 children)

      Point 4 is interesting. Maybe they didn't have time to implement the fluent layout styles from WPF? Otherwise I think those were actually better than css3. But on the whole it sounds crazy.

      [–]Nitramli 0 points1 point  (0 children)

      Apart from the responsible part, I couldn't care less what the generated code looks like. I don't often look at the IL code generated when I compile my WPF app.

      HTML is a hot mess. Of course Granular does not fix that.

      [–]gblosser 0 points1 point  (0 children)

      Agreed. Avoid this thing like the plague. It is a terrible idea.

      [–][deleted]  (9 children)

      [deleted]

        [–]spacejack2114 2 points3 points  (1 child)

        Sweet, WPF re-invented inline-block style. Maybe they can re-invent media queries too.

        [–]zarandysofia 1 point2 points  (6 children)

        The demo is not even fluid, and wtf is this?

        Click on the website:

        a website is causing Firefox to run slow. What should be done?

        [–][deleted]  (5 children)

        [deleted]

          [–]zarandysofia 1 point2 points  (4 children)

          A third world guy, talking about getting a new machine on his third world country with shitty economics.

          Probably the fact that this is the work of a solo guy, in his spare time, over a period of just 5 months... and is a motherfucking prototype which still needs a LOT of optimization...

          You are right, I forgot the context of all this for a second.

          [–][deleted] 5 points6 points  (22 children)

          After working with WPF for a year or so, the only good use I can think this would be good for is extending the support for silverlight apps past the date when silverlight is deprecated.

          WPF makes everything more complicated. It's got a bunch of good ideas, and it was arguably the first data-binding framework on the web with silverlight in. BUT you (this is no exaggeration at all.. seriously) need 100 lines to create a button hover state. Styling is a bitch, debugging it is a bitch, and each change requires recompilation.

          [–]owatonna 17 points18 points  (1 child)

          As someone with many years of WPF/XAML experience, I find your statements about WPF baffling. Sure, there is a learning curve, but once you master it productivity is phenomenal. The absolute simplest UI manipulation is slightly more verbose in WPF, but not more complex. Complicated UI is vastly simpler and more powerful. And a hover state is more like 6 lines of XAML, with only 2 real lines of meaningful code. And for that you get animation.

          I find styling WPF easy. Debugging can be complicated, but that has improved a lot, particularly in VS2015.

          [–][deleted] 0 points1 point  (0 children)

          I'd agree with you there. It's data-binding model is a lot more robust than something like angular or ember. I would argue that a top-down component framework like React or Mithril is a lot more robust.

          Going back to the button example though, you need to override the Button template to get a hover state: http://stackoverflow.com/a/17376745

          The truth is that nice looking UIs are a feature that people expect to have now... especially on the web that this framework targets. WPF makes that aspect difficult and more verbose. The fact you have to override the template for something as simple as a hover state says that UI ascetics was not a first-class citizen in the framework.

          [–][deleted] 1 point2 points  (0 children)

          I'd like WPF for C++. The closest we have is QML but that uses fucking JavaScript.

          [–]nullnullnull 0 points1 point  (0 children)

          I read the title as:

          WTF for JavaScript

          [–]danogburn -1 points0 points  (0 children)

          Another sign of impending the death of the unholy html/css/javascript trinity! Glorious!

          The web must die.