Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Search - "goroutines"
-
I dive in head first.
Some existing program annoys me, so I get this itch to write a selfhosted Spotify in Go, or a conky with 3D graphics in Rust.
I check the homepage of the language, download the tools, check which IDE is great for it.
Then I just start writing code, following the error corrections thrown by the IDE, doing web searches for all errors. Then when I run into a wall, I might check the reference docs or a udemy course.
Often I don't finish the project, because time is limited and I still have 4 million other things to do and learn, but at least I've learned a new language/tech.
Con: For tech which uses unique paradigms like Rust's memory management or Go's Goroutines, it can be frustrating to bash away at a problem using old assumptions.
Pro: By having a real demand for a product with requirements instead of a hello world or todo app, it's much easier to stay motivated, and you learn beyond what courses would teach you.5 -
I was talking to a friend of mine(more of an acquaintance really) about our shared interest in Go and how I am trying to see if I can implement it more and more into my daily activities(simple CLI utilities, maybe a web app or two) and he mentioned how much he likes it after being part of a Java shop for such a long time. He said that he got tired of the verbosity of Java and how Go was such a "breath of fresh air"
var i SomeShit
do.SomeShit(&i)
if do.Error != nil {
panic(do.Error)
}
fmt.Println("Could not agree at all")
On how bullshitty it is to say that one switched over to Golang because of the verbosity of other languages, specially when anything meaningful that you might do with the code requires constant checking.
And let us not
forget := lol.bullshit(); forget != nil {
about some of the other bs you get to do
oh look scoped errors
}
.....like I get it man. I like the language, no, It ain't replacing C or C++ for low level shit, not with a garbage collector are you fucking high?
But yes, I do like the language, they got a lot of shit right, the thing is, I feel like I know everything about it already since A) shit is way too simple, simple enough to be used by anyone really and B) other than goroutines this language does not really bring anything new to the table, far as I can tell.
I mean shit. I thought I was at odds with Python disliking syntactical whitespace enough to make me try and not use an otherwise perfectly good lang(Python I love you but hate syntactical whitespace) but Golang really puts me at odds. I love it but dislike it at the same time.8 -
In my current org we had a AWS SES event processor written in node js, it was struggling everytime we had more than 1000 messages in queue. It looped over every single message made some db calls then processed the next message. At one point we had to run 300 comatiners of this thing to clear out the queue.. It was still horribly slow.
I rewrote it in Golang with channels and goroutines now we need to run a single comatiner to handle upto 100k messages in queue. Used 10 goroutines to pull 10 messages constantly and put them in a channel, then spawned 1 goroutine per message to process them quickly. I'm so proud of this solution, we then brought this workflow to many other event processing services. 😎4 -
Does any of you know, what happens to Go-routines, when they are deadlocked by waiting on a channel and the channel isn't reachable anymore?
I'd assume they get garbage-collected since they'd just a few KB of memory when not in use but I can't find anything on it online.2 -
Started porting one application written in php to:
Golang(and some libraries to make certain sht simpler like GORM and Gorilla amongst a couple of others, most shit is STD shit already built in)
Java Spring(I know it well, but wanted to try this particular app in it, lots of boilerplate although the coded is solid AF)
.NET Core API, which I separated in a series of modules for the domain interface, the persistence logic, the actual api etc, I really dig it. It has a basic React frontend in Typescript whereas the other 2 versions are using the standard Go html/template package and the Twig interface for Spring.
My favorite thus far is Golang. I find it extremely easy to extend, the language reads good enough for a retard like myself to make sense of it fairly easy, really easy to test and experiment with it, any idea I get for something to add(say users and stuff) took me less than 30 mins to figure out while reading the actual documentation, as in the base documentation or just the source code.
I know the language is retard proof, and I am highly enjoying this. Not to say that the other two are bad, not at all, been using C# and Java for years now, but I highly appreciate being able to concentrate on functionality rather than all the fucking architectural boilerplate needed to run basic shit in the other two frameworks. Thus far Golang has been a breath of fresh air the likes Clojure gives me, while not even being a profound or mind blowing language in terms of features(since other than the interface{} and goroutines i can't think of shit) and have not reached a scenario in which I am stuck or dying to have generics one bit for the overall business logic.
The app is growing like crazy in terms of code since the original php application was huge to begin with, but dear me this shit is as simple as it can get without being too technical. Might move it to production once all usability tests pass and force the rest of the staff to learn it. I have one lead dev that damn near refuses to touch anything other than php, and a very eager to try shit out content administrator that comes from a Java and C# background.
all I want to say is how much I love go haha4