GothamGo 2018 - Things in Go I Never Use by Mat Ryer

  Рет қаралды 86,224

Nation Confrences

Nation Confrences

Күн бұрын

Пікірлер: 71
@manikanth2166
@manikanth2166 5 жыл бұрын
Very nice and useful stuff. But jump to 07:30 where the actual presentation starts.
@terragame5836
@terragame5836 Жыл бұрын
The part about line of sight is by no means unique to Go. I've picked it up from the Zen of Python (#5, "Flat is better than nested"), and have been using that principle ever since
@WorstDeveloper
@WorstDeveloper 6 жыл бұрын
Really great and fun video to watch. Good speaker.
@mishasawangwan6652
@mishasawangwan6652 6 жыл бұрын
i can relate.. since i started using go i don’t use else nearly as much
@TBButtSmoothy
@TBButtSmoothy 5 жыл бұрын
using else is a situational thing, it goes across most languages.
@parlor3115
@parlor3115 3 жыл бұрын
Especially that you can't write it in a separate line
@a_maxed_out_handle_of_30_chars
@a_maxed_out_handle_of_30_chars 2 жыл бұрын
good talk
@1889990
@1889990 4 жыл бұрын
gotta disagree with 10:39 ...being able to lable such a jump is actually way more readable then creating an extra new bool just to trigger such a behaviour. It adds unnecessary if's and variables and convolutes the actual loop logic. I think this is one of the very few places where a labeled jump can be very beneficial.
@barzontus
@barzontus 3 жыл бұрын
yeah i think breaking out of an outer loop is essential. sometimes you can structure your code in such a way that it's unnecessary but often a loop in a loop will have to exit early, and using some "done" variable to annotate that that gets checked on every loop is far worse.
@charlesmartel7255
@charlesmartel7255 5 жыл бұрын
Your ethos is great. Glance-abilty sums it up well. I’m just starting to look at Go, and I like what I see so far, largely due to this sensibility manifest in the language. I started on C in college then worked in Basic, then dBase and VB (and now PHP and Javascript) and I missed the clarity of Basic. I tried to miss out on Java and OOP as the amount of work needed to manage objects ( rather than just solve problems) struck me as inefficient to the point of silly. Am I right in thinking Go suggests the tide has changed against OOP?
@TheMrKeksLp
@TheMrKeksLp 4 жыл бұрын
It has but not because of Go. In fact Go relies on the equally as outdated and bad structural typing idea
@TakekazuOmi
@TakekazuOmi 6 ай бұрын
Very nice
@ninja-vm8uf
@ninja-vm8uf 6 жыл бұрын
He did a Ricky Gervais at 18:08
@cryptk
@cryptk 5 жыл бұрын
This is a great talk, but the camera angle changing every 15 seconds is painful if you are actually trying to read what's on the slides...
@TurtleCoin
@TurtleCoin 3 жыл бұрын
I want to see Mat from all angles to best absorb his intellect.
@bronzekoala9141
@bronzekoala9141 4 жыл бұрын
I think there are plenty use case for structs without field names. There are some data structs like Vector3, Vector3 or ColorRGB where the order and fieldnames are obvious.
@daleowens7695
@daleowens7695 2 жыл бұрын
I pass unexported empty structs as exported interfaces across the package boundary all the time. "Code to the interface" and all that.
@Sergeeeek
@Sergeeeek 2 жыл бұрын
Single field structs come to mind also, like color.Gray
@kf5268
@kf5268 6 ай бұрын
Love the else part
@W00PIE
@W00PIE 4 жыл бұрын
I've just started with Go some weeks ago and I already passed the point where I use "else" - it's simply not neccessary. Go makes you implement things correctly, the compiler is like a strict governess. You'll hate it at first, but once you get used to it, your coding style will adapt. One thing that bugs me once in a while is using channels as a callback substitute, it still feels a bit clumsy. But to be honest: I already love this language!
@TheMrKeksLp
@TheMrKeksLp 4 жыл бұрын
Oh boy do I have news for you. Go ain't memory safe (with non-nil interface nil pointers and sharing data structures across goroutines) and I highly disagree that the idiomatic way of returning a value AND an error -- where one is supposed to be nil -- can even remotely be considered "correct". Of course the correct way would be using an algebraic data type like Rus't `Result` which is either the value OR the error
@Sergeeeek
@Sergeeeek 2 жыл бұрын
@@TheMrKeksLp I don't think it tries to be memory safe
@Arwahanoth
@Arwahanoth 4 жыл бұрын
I would add this: does not allow return parameters with named return arguments. Bad experience...
@barzontus
@barzontus 3 жыл бұрын
this
@AleksandrPodyachev
@AleksandrPodyachev 3 жыл бұрын
The issue that I have with go is that I had a problem with importing modules that are within your project
@PetrGladkikh
@PetrGladkikh 4 жыл бұрын
4:36 - think Clojure maybe? If we're _measuring_ here :) Or at least Go is not alone with this approach.
@LaPingvino
@LaPingvino 4 жыл бұрын
I basically got from Clojure to Go -- they share a lot of similar philosophy, and Rob Pike referred back to Rich Hickey's consideration of simplicity
@barzontus
@barzontus 3 жыл бұрын
yeah clojure and go have a lot in common. there aren't too many different ways to do the same thing in clojure either. it really feels like what would happen if the go team had decided to make a functional jvm language lol
@pevenphoon7359
@pevenphoon7359 6 жыл бұрын
The laughter at 0:59 made me laugh too.
@tango2olo
@tango2olo 4 жыл бұрын
goto statement from C/assembly, is really powerful.. but only gods can handle that power.
@k1ngjulien_
@k1ngjulien_ 4 жыл бұрын
Its too powerful. If someone has to use goto in their code these days it says to me that something is wrong about that code and it should probably be restructured.
@tango2olo
@tango2olo 4 жыл бұрын
@@k1ngjulien_ you don't believe in "god" it seems. ;)
@TheMrKeksLp
@TheMrKeksLp 4 жыл бұрын
Rust doesnt have goto for this exact reason. It's too powerful and fucks up assumptions about object lifetime and scopes
@lhpl
@lhpl 2 жыл бұрын
I only looked at these comments (being 4minutes smth into the video) to check if someone had made a "Go2 considered harmful" joke. Of couse... As fo goto: it "serves" two purposes: - continue execution by skipping further down in the code sequence - continue execution by jumping futher up (back) in the sequence. We have names for this now: the first is an 'if' statement, the second a 'loop' statement. Goto is not needed.
@PetrGladkikh
@PetrGladkikh 4 жыл бұрын
22:13 - what if I want to pass a reference to that method? Without it I could not do that without making a closure, which is unnecessary burden.
@packagemain
@packagemain 6 жыл бұрын
Please add the subject into the video title, so it will be searchable.
@pohjoisenvanhus
@pohjoisenvanhus 6 жыл бұрын
No spaghetti but how about lasagna and ravioli?
@dragoran149
@dragoran149 3 жыл бұрын
Mat, Mat, Mat... never prototyped, huh? I've used every keywords of Go. Don't take them from me, I need it.
@barzontus
@barzontus 3 жыл бұрын
i think all of them are strictly necessary besides goto. the only valid use for labels in well structured code is breaking outer loops imo. else is maybe overused by novices but it feels like it's there for hyperbolic shock value. unless i missed it, fallthrough i don't think he explicitly talks about, he just lists it as one of the ones he never uses, but it really really really helps dry up code if you have a number of cases that are equivalent. i can envision his argument for why it's evil, which is probably that it's less clear having to follow your eye down the switch into another case block than to just restructure the switch or whatever but it's the default behavior in every other language for a reason imho. go has already improved the readability by forcing it to be explicit.
@dawnrazor
@dawnrazor 6 ай бұрын
The section about not using else statements is terrible. Whilst I do agree that they can be avoided when error checking, there are more reasons to use an else other than for error checking. How did you make such a blunder by not addressing non error checking else statements?
@PetrGladkikh
@PetrGladkikh 4 жыл бұрын
The talk starts at 2:20 You're welcome.
@TruongHoang-du9if
@TruongHoang-du9if 4 жыл бұрын
He's a fun guy)
@sergeywhite8897
@sergeywhite8897 5 жыл бұрын
fire!!!)thanks1
@mysticaltech
@mysticaltech 5 жыл бұрын
Haha.. Hilarious, thanks Mat!
@blacky7801
@blacky7801 Жыл бұрын
go couldn't exclude goto, afterall it has the word "go" in it
@umeshmalhotra4617
@umeshmalhotra4617 4 жыл бұрын
Can someone explain me subliminal joke at 10:56 ?
@psl101
@psl101 4 жыл бұрын
He’s trying to get you to buy his book
@benfranklin7526
@benfranklin7526 6 жыл бұрын
What is the font used in this presentation?
@suic86
@suic86 5 жыл бұрын
Looks like Courier New (en.wikipedia.org/wiki/Courier_(typeface))
@pengdu7751
@pengdu7751 4 жыл бұрын
organiser?
@davidguo3995
@davidguo3995 6 жыл бұрын
Really Nice, but have slides?
@killerhz
@killerhz 5 жыл бұрын
I didn't know David Brent was a gopher
@bronzekoala9141
@bronzekoala9141 4 жыл бұрын
I think I see why else isn't needed, but the example given really isn't nearly enough to show the idea.
@nicolasparada
@nicolasparada 6 жыл бұрын
👏👏👏👏👏
@jvpdek
@jvpdek 4 жыл бұрын
Hi, Matt. Would you please simplify the Greeter.Greet slide. It has code parts that are not relevant to your point and actually distract the viewer. For example, the function doesn't use the receiver, and the struct field name looks too much like an important type name. Instead, make the field name Greeting and the func use Println(g.Greeting,... [the func actually uses g]. Then your example will focus on the point you're trying to make.
@jacobschmidt
@jacobschmidt 3 жыл бұрын
I think the example was fine
@jacobschmidt
@jacobschmidt 3 жыл бұрын
it was very simple and demonstrated the point
@halfwit2
@halfwit2 5 жыл бұрын
Weird, I use goto quite a bit :/
@01kaskasero
@01kaskasero 2 жыл бұрын
This isn't useful for real work. Great for talks though.
@manigandand
@manigandand 6 жыл бұрын
goto is useful for command line scripts,
@vectorhacker-r2
@vectorhacker-r2 6 жыл бұрын
You should never use goto, ever.
@ulissemini5492
@ulissemini5492 6 жыл бұрын
@@vectorhacker-r2 then why is it in go ( ͡° ͜ʖ ͡°)
@ulissemini5492
@ulissemini5492 6 жыл бұрын
@@vectorhacker-r2 stackoverflow.com/questions/11064981/why-does-go-have-a-goto-statement you should read this, i agree you should not use goto, except in very specific situations (i've never used it but someday i might need to)
@vectorhacker-r2
@vectorhacker-r2 6 жыл бұрын
@@ulissemini5492 just because it's in the language doesn't mean you should use it.
@glxxyz
@glxxyz 4 жыл бұрын
Victor Martínez someone should do a video on that
@alexkfridges
@alexkfridges 5 жыл бұрын
Garbo
@andytheodorko9874
@andytheodorko9874 2 жыл бұрын
I'm surprised to see `goto` in go? Dijkstra proved a long time ago that we don't need it.
Golang UK Conference 2016 - Mat Ryer - Idiomatic Go Tricks
27:57
GopherCon UK
Рет қаралды 69 М.
BAYGUYSTAN | 1 СЕРИЯ | bayGUYS
36:55
bayGUYS
Рет қаралды 1,9 МЛН
Don’t Choose The Wrong Box 😱
00:41
Topper Guild
Рет қаралды 62 МЛН
dotGo 2015 - Rob Pike - Simplicity is Complicated
23:12
dotconferences
Рет қаралды 157 М.
GothamGo 2017 - Internals of the Go Linker by Jessie Frazelle
26:40
Nation Confrences
Рет қаралды 4,9 М.
Building a Bank with Go
53:22
InfoQ
Рет қаралды 119 М.
Understanding Allocations: the Stack and the Heap - GopherCon SG 2019
21:39
dotGo 2017 - Mat Ryer - The Art of Testing
19:33
dotconferences
Рет қаралды 8 М.
BAYGUYSTAN | 1 СЕРИЯ | bayGUYS
36:55
bayGUYS
Рет қаралды 1,9 МЛН