[go-nuts] Re: I am not in favor of generics.

2018-09-19 Thread prades . marq
Anyone who doesn't want some form of generics is in favor of a bad status quo. Now I'll be fine without user defined generics if Go provided a dozens of built-in compile time safe generic data structures like trees, sets, tuples, ordered maps, weakmaps perhaps WITH a complete set of methods

[go-nuts] Re: I am confused.

2018-05-28 Thread prades . marq
A 9 yo shouldn't be online talking to adult strangers, it's irresponsible for whoever is in charge of that group to let that thread open, let alone let a 9 y.o. in this group when the internet is full of child predators. Le lundi 28 mai 2018 02:31:42 UTC+2, John a écrit : > > Okay I will

Re: [go-nuts] Go license and fitness for purpose

2018-05-15 Thread prades . marq
If you really have legal concerns you should talk to a lawyer. Asking for anonymous opinion on a forum isn't legal advice. This should certainly not be the place to discuss legal matters such as the scope of a license. I don't think anybody who answered you is actually a lawyer. If you come

Re: [go-nuts] Implementing method overloading using first class functions

2018-05-04 Thread prades . marq
> Eliminating code duplication shrinks the base of code that must be changed Except go was designed a certain way that will make whatever you are attempting to do here burdensome. We've all been there at first trying to fit a square into a round hole, it doesn't work. Unless you start ignoring

[go-nuts] Re: Go could really use a while statement

2018-05-03 Thread prades . marq
Can anybody point me to a single discussion on golang-nuts that led to a significant syntax change? These threads are akin to bike shedding thus a waste of time. Adding while provide nothing of value in a language that supports basic looping. And for those who compare if and switch arguing it

[go-nuts] Re: Is there any way to define a struct member to hold a generic type channel?

2018-03-23 Thread prades . marq
No, go does not have generics. chan int is not the same type as chan string for instance and you cannot declare a type that hold all types of channel unless you resort to "interface {}" AND runtime reflection. Le jeudi 22 mars 2018 16:25:39 UTC-10, 刘焱 a écrit : > > I'm trying to define a

Re: [go-nuts] Re: infinite recursion in method lookup due to recursive embedded interface value: any way to statically catch this?

2018-03-14 Thread prades . marq
How is this a bug? I don't think Go compiler can guess the intent of the developer at compile time. I don't think that qualifies as bug. Le mardi 13 mars 2018 16:48:32 UTC-3:30, Christopher Sebastian a écrit : > > @prades.marq , The solution that you pointed out is already obvious to >

[go-nuts] Re: infinite recursion in method lookup due to recursive embedded interface value: any way to statically catch this?

2018-03-13 Thread prades . marq
> In the example, there is a "typo" in the spelling of a method name ("Bg" instead of "Bug"), and that typo caused the generate code to exhibit an infinite recursion in method lookup. No, it has nothing to do with a "typo". I removed the Bg() method and infinite recursion still occurs

[go-nuts] Re: Why should i use interface composistion

2018-03-13 Thread prades . marq
The answer is it depends on the context. There is no way to answer that question without looking at the full codebase and what method will call a type implementing the Store interface. In general, you should only put the methods in an interface the consumer of a value will use. given a

Re: [go-nuts] What major API change really is?

2018-03-10 Thread prades . marq
If (somehow) Go get Ada style package based generics then a lot of the language doesn't have to change. The consumer of the generic package will have to "instantiate" the package before using it. Therefore A codebase cannot be littered with parametric type variables. So generic functions

Re: [go-nuts] Go Programming Language Course

2018-02-21 Thread prades . marq
Wasn't Sqlite compiled to Go or something? I remember some news about it, using C to Go compiler. As for the C toolchain for Go, the easiest way to get started on Windows is to install MSYS2 and use pacman to install GCC 64 and then libs like sqlite2 . Le mercredi 21 février 2018 21:49:50

[go-nuts] Re: All Forms of Wishful Generics

2018-02-16 Thread prades . marq
Go is hot right now just like Rails or Node.js used to be hot. So people feel compelled to use the hip thing right now even when they hate it because of fear of missing out. There are better languages out there like Ada who do everything Go does, including concurrency but better and have

[go-nuts] Re: All Forms of Wishful Generics

2018-02-16 Thread prades . marq
Have a look at Rust, Ada or even C++, they all have some form of generic programming and are fast or faster than Go. Bonus, none of these use garbage collection. Don't hold your breath with Go getting any substantial changes in its type system. Move on. Developers should use tools that suit

[go-nuts] Re: Where to store custom error values?

2017-11-24 Thread prades . marq
It doesn't really matter, how many files you divide a single package into. What matters is not multiplying the number of nested packaged without a very good reason. Le samedi 25 novembre 2017 04:23:06 UTC+1, Denis Cosmin a écrit : > > I made an errors.go file containing all the error values for

[go-nuts] Re: How to mock things without having too big an impact on the source code?

2017-11-14 Thread prades . marq
Since functions are values you can just do that: var NewExternalService func()Service = pkg.NewExternalService and then mock NewExternalService or explicitely inject dependencies in your http.HandlerFunc func(Service) http.HandlerFunc{ return func(w http.ResponseWriter, r *http.Request){

[go-nuts] Re: How to send a POST request from http.Redirect?

2017-10-28 Thread prades . marq
It's the client which does the redirect, it's up to it to accept your request, most will not accept redirects with POST method, for obvious security reason. Le samedi 28 octobre 2017 21:12:16 UTC+2, Hui Kang a écrit : > > Hi, > I have a question about sending POST request through the

[go-nuts] Re: awesome-go project on golang github organization

2017-10-24 Thread prades . marq
I submitted several original projects i made to your list, they passed all the tests, they sat in the pull-request list for 6 month then when rejected for disingenuous or unspecified reasons.So I would prefer not your list becomes the official one. Le lundi 23 octobre 2017 17:20:00 UTC+2,

[go-nuts] Re: Make error handling less verbose with Zig %% operator and %return expression?

2017-10-17 Thread prades . marq
Personally it's not a verbosity issue but a readability issue 99% of the time. if go fmt would just keep the whole if statement on a single line it would already alleviate some of the pain of having to read a codebase ridden with error handling code. if foo,err = DoIO();err!=nil{return

Re: [go-nuts] Re: error handling needs syntactical sugar

2017-09-05 Thread prades . marq
Or you know, just panic ... errors as value are a convention, not a language construct. panic/defer ARE a language construct. I personally give the choice in my API, Must prefixed methods that panic or regular methods that return an error. The obvious advantage of panics is that the developer

Re: [go-nuts] Re: Generics and readability

2017-08-27 Thread prades . marq
> That's how C++ started. And that's also why C++ is the ugly monster than it is today; with a design that wasn't quite thought thoroughly. Talking about C++ like it's an example to follow is just preposterous. Le dimanche 27 août 2017 16:25:54 UTC+2, Jan Mercl a écrit : > > And there's

[go-nuts] Re: Generics and readability

2017-08-27 Thread prades . marq
> A lot of people consider code gen a second class solution when compared to a more traditional generics implementation. I don't think so. Code generation can be very effective. No major concerns about indecipherable error messages. When in doubt you can inspect the generated code to

[go-nuts] Re: Generics are overrated.

2017-07-29 Thread prades . marq
I love playing with package reflect, which is much more powerful than generics by the way (you can't implement gob or json with generics). You could absolutely do that without runtime reflection. It is called compile time type safe macros ... Oh wait, Rust has them, and generics and a correct

[go-nuts] Re: Generics are overrated.

2017-07-29 Thread prades . marq
What is overrated is the use of "interface { }" and reflection AKA runtime magics which has no place in a modern statically typed language. It's a cop-out, it's dirty and a direct consequence of the absence of generics in Go. > Please provide some best practices to achieve generic behavior for

[go-nuts] Re: "interface{} says nothing", lets consider it destroys information

2017-07-20 Thread prades . marq
Go could have least have parametric functions (ex : func Foo(value T)T { /.../ } bar := Foo(3) //types are verified at compile time, no need for reflection or interface {} on any runtime trick. ). But talking about this is kind of useless until Go rids itself of its over reliance on runtime

[go-nuts] Re: What is your favorite Go feature?

2017-06-26 Thread prades . marq
There was already an extensive survey published this year asking that kind of question : https://blog.golang.org/survey2016-results You'll already get more data than you want here. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To

[go-nuts] Re: RFC: Blog post: How to not use an HTTP router

2017-06-24 Thread prades . marq
The goal of a (proper) router is to decouple routes from handlers, thus making refactoring easier by adopting a declarative form rather than an imperative one. It's the good old builder pattern. By deeming it unnecessary you did nothing but couple your handlers with your routes. That's the

[go-nuts] Re: How to include unused functions into binary

2017-06-21 Thread prades . marq
Nowhere in the piece of code you pasted you are calling a function, you are trying to call a struct method on the other hand ( method.Call ). Your error comes from something else and not the fact Go removes unused functions. Furthermore, if the number of possible struct methods to call is

[go-nuts] Re: Go - language of the future!

2017-03-16 Thread prades . marq
A language with such a "simple" type system, which rely that much on runtime behavior is hardly a language of the future. But Go might be a blue print for what language of the futures will have to provide in terms of developer experience. Go is too divisive to get widely adopted or to replace

[go-nuts] Re: how to use go generate to generate generic code .

2017-03-10 Thread prades . marq
You might want to reconsider your use of Go if the lack of generics hinders your productivity. Code generation, IDE macros and other tricks do not solve this problem. Sometimes go is just not the right tool for the job. D has generics and solid concurrency primitives. Le vendredi 10 mars

Re: [go-nuts] Re: Trying to understand := and named return values

2017-02-21 Thread prades . marq
Named returns are actually quite useful with panics : https://play.golang.org/p/ZdoZJBN0T1 Le mardi 21 février 2017 23:13:11 UTC+1, Ian Lance Taylor a écrit : > > On Tue, Feb 21, 2017 at 1:46 PM, > wrote: > > Seems like named returns + if/for/switch initializers = a

[go-nuts] Re: Deleting the /r/golang subreddit

2016-11-25 Thread prades . marq
+1 , delete it. Or let some other group take care of it and remove any official connection / link to golang.org . That farce lasted long enough. Let's concentrate on promoting Go the right way, not on a forum full of toxicity and shoddy admins. Stackoverflow is a better way to ask focused

Re: [go-nuts] Re: Stalking people online for thought crimes! This is what the Go project has succumbed to!

2016-11-04 Thread prades . marq
All I see here is nothing is done to moderate /r/golang despite threads being reported for harassment. What good is a code of conduct if it isn't enforced ? and when enforced , moderators have to come here to apologize for doing their jobs, like Sarah ? If you don't want me to bring /r/golang

[go-nuts] Re: Stalking people online for thought crimes! This is what the Go project has succumbed to!

2016-11-04 Thread prades . marq
> then labeling someone's thread as "bullying" (a pretty serious charge in todays climate). Well now the target of the latest witch-hunt /u/gernest_ has responded on /r/golang, the previous thread that I linked I quote "broke his heart" , so you can't deny something is definitely wrong here :

[go-nuts] Re: Stalking people online for thought crimes! This is what the Go project has succumbed to!

2016-11-03 Thread prades . marq
That's not up to you to judge if some comment is "harmless" or not. Because you're not the person the comment has been directed at. Something that might seem "harmless" to you might be perceived as insulting to someone else. Aram's comment was unnecessary and insensitive to say the least, it

Re: [go-nuts] Re: Stalking people online for thought crimes! This is what the Go project has succumbed to!

2016-10-28 Thread prades . marq
This person is old enough to answer me himself, he doesn't need your help for that , I wasn't talking to you so mind your business. And how about you dump your patronizing tone and go back to your own business ? Your comment is useless. Le vendredi 28 octobre 2016 13:30:33 UTC+2, Manuel Amador

[go-nuts] Re: Stalking people online for thought crimes! This is what the Go project has succumbed to!

2016-10-27 Thread prades . marq
Sure you willfully participate on a forum often used for insults, character assassination, witch hunts and doxxing. This isn't the first time shit like this happens on /r/golang , and frankly it gives the whole Go community a bad name. Keep being embarrassed "on my behalf", Who the hell do you

Re: [go-nuts] Stalking people online for thought crimes! This is what the Go project has succumbed to!

2016-10-27 Thread prades . marq
> The actions of the Iris author are, in my opinion, pretty awful. But the only people that can take action against them are the people whose code he stole. This is completely irrelevant IMHO. Why are these witch hunts allowed in a go forum ? I'm not talking about the author of this thread

[go-nuts] Re: Stalking people online for thought crimes! This is what the Go project has succumbed to!

2016-10-27 Thread prades . marq
Frankly /r/golang is so toxic I stopped posting there, it should be either shut down or officially excluded from any official go forum. The code of conduct serves very little purpose given what happens there constantly, People like to target projects, insult their author and call them