News for hackers. Stuff that matters.
Re:Gongular – A new web framework for Go by zalmoxes on Monday December 05, 2016 @03:09PM (#13108952)
I'm sorry, but does anyone even glance at the source of these frameworks before they're upvoted?
Re:Gongular – A new web framework for Go by alistproducer2 on Monday December 05, 2016 @03:20PM (#13109054)
I've said the exact thing on multiple occasions. For example, https://news.ycombinator.com/item?id=12892550. this dude created something that opened a port and listened for commands that would control your OS. He hadn't spent 5 minutes making even some basic form of authentication and came straight to HN for the high 5's. People tried to flame me for pointing out that it seemed irresponsible to be promoting software in such a state.
Re:Gongular – A new web framework for Go by BoorishBears on Monday December 05, 2016 @07:49PM (#13111328)
The current top comments all say what you said without the unwarranted snark.
Re:Gongular – A new web framework for Go by cyri on Monday December 05, 2016 @03:15PM (#13109000)
I've withdrawn my upvote after I saw this in the code:

  type Injector struct {
    values          map[reflect.Type]interface{}
    customProviders map[reflect.Type]CustomProvideFunction
  }
Re:Gongular – A new web framework for Go by bigblind on Monday December 05, 2016 @03:46PM (#13109368)
Comments like this could be extremely helpful to the author if you explain more clearly what you mean. Is it because they're using reflection so much? Or is it because a CustomProvideFunction could also be stored as interface{} or something completely different? I'm fairly new to Go as well, so I'm curious.
Re:Gongular – A new web framework for Go by komali2 on Monday December 05, 2016 @03:19PM (#13109049)
I don't understand, what's wrong with that? I've never used Go so I'm asking out of ignorance.
Re:Gongular – A new web framework for Go by CSDude on Monday December 05, 2016 @03:45PM (#13109351)
It is not type safe and relies on runtime reflection based checks to make it work correctly, it can crash easily. However, I believe I made all the checks correctly and it should work as intended, but of course it is only 600 LOC, there can arise some issues.
Re:Gongular – A new web framework for Go by adregan on Monday December 05, 2016 @03:44PM (#13109335)
Perhaps due to the fact that upvoting privately saves the story and doesn't forward you to another page as favoriting does (which isn't private), people are upvoting with the intention of browsing it later.

I mention it because it is something I do frequently, and I do this because the favoriting feature isn't quite right (I want to privately save stories for later and I don't want to be redirected).

Re:Gongular – A new web framework for Go by ben_jones on Monday December 05, 2016 @03:21PM (#13109067)
I'll always advocate learning projects like this, but you're absolutely right that if anyone pulls it for production they deserve what they get.

My personal litmus test for OSS is to read the test suite.

Re:Gongular – A new web framework for Go by CSDude on Monday December 05, 2016 @03:21PM (#13109055)
Unfortunately, to achieve the functionality I described, I must have used reflection like that, which is not really nice, but I really prefer it to context based methods type assuming and casting which is essentially the same. I know people do not like reflection that is used like this, but the performance is not a concern, and I really got tired of transforming user input and checking for errors in each handler.
Re:Gongular – A new web framework for Go by nemothekid on Monday December 05, 2016 @05:27PM (#13110363)
This feels very similar to Martini (https://github.com/go-martini/martini).

Martini had a similar sort of design (and IMO a cleaner source code), but the author decided that reflection and non-idoimatic design was too much of a cost for the HTTP framework in Go. I think 2 years ago when Martini was released people were more open to reflection, but now I'm interested/doubtful if something like this can be accepted.

Funnily enough, I think Gin-Gonic was inspired by Martini, but Gin-Gonic eschewed reflection in favor of performance/idiomatic design. The fact that this project considers Gin Gonic an inspiration is funny.

Re:Gongular – A new web framework for Go by nonsince on Monday December 05, 2016 @10:30PM (#13112022)
This thread is very negative, and I personally dislike runtime reflection so I wouldn't use this framework in its current design, but don't let the commentors get you down. I assume that you want to just show off something interesting you made, whereas they are looking for something high-enough quality to use in their next project - and a brand-new framework is never going to be that. It's just a mismatch in aims. Keep up the good work, I can appreciate that writing the kind of dependency injection framework often seen in large systems in such a small amount of code is an admirable feat.
Re:Gongular – A new web framework for Go by CSDude on Tuesday December 06, 2016 @04:21AM (#13113305)
Thank you, my thoughts precisely. It was just to show another approach.
Re:Gongular – A new web framework for Go by yumaikas on Monday December 05, 2016 @03:21PM (#13109062)
Looking at this, it looks like a very minimal, reflection heavy framework. While that's not necessarily the wrong set of choices to make, trying to turn Go into a DSL-type language always feels a little strange. Still, kudos to the authors for putting up something nifty in under 1kLoc (excluding tests).
Re:Gongular – A new web framework for Go by the_duke on Monday December 05, 2016 @03:30PM (#13109169)
Reflection is also notoriously slow in Go.
Re:Gongular – A new web framework for Go by yumaikas on Monday December 05, 2016 @03:17PM (#13109026)
Godoc link for those who want to look closer at it: https://godoc.org/github.com/mustafaakin/gongular
Re:Gongular – A new web framework for Go by neom on Monday December 05, 2016 @04:05PM (#13109559)
Related: https://github.com/go-martini/martini (NOTE: The martini framework is no longer maintained.)
Re:Gongular – A new web framework for Go by _ttg on Monday December 05, 2016 @04:16PM (#13109683)
also related - https://codegangsta.io/blog/2014/05/19/my-thoughts-on-martin...

Martini also relied heavily on DI and reflection for convenience and the author basically conceded that this was not idiomatic.

Re:Gongular – A new web framework for Go by camus2 on Monday December 05, 2016 @06:26PM (#13110867)
> Martini also relied heavily on DI and reflection for convenience and the author basically conceded that this was not idiomatic.

More like he was bullied into conceding that.

Re:Gongular – A new web framework for Go by jrs95 on Monday December 05, 2016 @03:23PM (#13109087)
>features Angular-like (or Spring like) dependency injection

closes tab

Re:Gongular – A new web framework for Go by camus2 on Monday December 05, 2016 @06:26PM (#13110858)
> haha...that name is hideous

> please.. make it stop..

> closes tab

Look at this sorry thread, the usual open source project bashing going on in the Go community, pathetic, but business as usual in the Go community. The Go community is truly irredeemable and one of the most mean spirited and hateful programming community out there.

Re:Gongular – A new web framework for Go by jrs95 on Tuesday December 06, 2016 @09:11AM (#13114645)
Because calling an entire programming language's community irredeemable, mean spirited, and hateful is reasonable.

There's a reason for the negative comments, and it's that the paradigm of this framework runs against what would be considered idiomatic Go. Spring/Angular style DI is one of the things people use Go to avoid. This is like someone making a library to do goto statements in Java (not as bad of course, just pointing out the conflicting paradigms).

Re:Gongular – A new web framework for Go by nonsince on Monday December 05, 2016 @10:24PM (#13111991)
Come on man, at least have the remotest sense of irony.
Re:Gongular – A new web framework for Go by choward on Monday December 05, 2016 @03:46PM (#13109367)
How is this even remotely related to Angular?
Re:Gongular – A new web framework for Go by d0lph on Monday December 05, 2016 @04:14PM (#13109658)
"It is like Gin Gonic, but it features Angular-like (or Spring like) dependency injection and better input handling."
Re:Gongular – A new web framework for Go by _ttg on Monday December 05, 2016 @02:54PM (#13108773)
haha...that name is hideous
Re:Gongular – A new web framework for Go by hitekker on Monday December 05, 2016 @03:03PM (#13108882)
Re:Gongular – A new web framework for Go by joeblau on Monday December 05, 2016 @03:04PM (#13108902)
Holy crap I can't. stop. laughing.
Re:Gongular – A new web framework for Go by komali2 on Monday December 05, 2016 @03:23PM (#13109086)
People in that thread are arguing about exclusion, sexism, etc, but a simple enough reason to change the name is "I can't say I'm using this library in front of the investors and keep a straight face."
Re:Gongular – A new web framework for Go by CSDude on Monday December 05, 2016 @03:03PM (#13108890)
I am really not good at coming up with names.
Re:Gongular – A new web framework for Go by bcook on Monday December 05, 2016 @03:03PM (#13108886)
At least when I Google it I get relevant results. It's even worse to have some generic name like "footpath" or "cake".
Re:Gongular – A new web framework for Go by jayd3e on Monday December 05, 2016 @04:40PM (#13109930)
My thoughts exactly.
Re:Gongular – A new web framework for Go by UseYrIllusion11 on Monday December 05, 2016 @03:02PM (#13108871)
in b4 stdlib is better than this framework.
Re:Gongular – A new web framework for Go by jrs95 on Tuesday December 06, 2016 @09:11AM (#13114650)
stdlib is better than this framework.