Teiva Harsanyi Profile Banner
Teiva Harsanyi Profile
Teiva Harsanyi

@teivah

Followers
5,078
Following
181
Media
162
Statuses
3,514

💻 Software engineer @Google 📖 100 Go Mistakes author , blog at ❤️ Go, Distributed Systems & Reliability, 改善

Paris
Joined January 2010
Don't wanna be here? Send us removal request.
Explore trending content on Musk Viewer
Pinned Tweet
@teivah
Teiva Harsanyi
2 years
My book, 📖 100 Go Mistakes and How to Avoid Them, has finally been released 🎉 #golang It took me almost 3 years of work since I first thought about the concept and I'm delighted it finally came out. Thanks to @ManningBooks and all the people involved 🙏
26
127
607
@teivah
Teiva Harsanyi
1 year
Facebook uses the concept of adaptative LIFO for queues: - They use FIFO order under normal conditions - They switch over to LIFO order under high load The rationale? By keeping FIFO order under high load, users may have already abandoned their request. Therefore, processing
Tweet media one
22
170
1K
@teivah
Teiva Harsanyi
1 year
I wrote a book on Go and I didn't even know we could use switch without condition 🫣
Tweet media one
25
42
531
@teivah
Teiva Harsanyi
2 years
🧵 My top 10 list of the IT books that helped me the most during my career.
5
117
485
@teivah
Teiva Harsanyi
2 years
I've just added a bunch of improvements to #golang . I'll keep adding more and more content in the future. Happy to see that people learn from it without having to pay for the book.
3
60
210
@teivah
Teiva Harsanyi
11 months
I want to create a web version of that would be synchronized with the GitHub content. Any ideas about which platform I could use? I really want to spend a minimal amount of time :)
9
54
200
@teivah
Teiva Harsanyi
3 years
I've completed the first final draft of my book 100 Go Mistakes. I've also published a repo containing all the source code for anyone interested: #golang
1
31
183
@teivah
Teiva Harsanyi
4 months
I just released : a Go library for handling LFU cache operations in O(1). #golang How does it work? The cache stores: - Each item in a map - A linked list to store the frequencies (squares) - Each frequency references another linked list containing the
Tweet media one
4
27
158
@teivah
Teiva Harsanyi
3 months
Thanks for copying all the content of my book into a talk, including some code snippets. Of course, the minimum could have been to reference my book but well... 🤷 @conf42com
Tweet media one
Tweet media two
7
12
160
@teivah
Teiva Harsanyi
2 years
Got my first Go PR accepted 🥳 Not a big one, but it still feels good nonetheless.
Tweet media one
11
5
157
@teivah
Teiva Harsanyi
10 months
I have just released the web version of the 100 Go Mistakes repo: #golang In the meantime, I also enriched the common mistakes with more content (still WIP, though). Shout-out to: - @github for the pages feature but also the seamless integration with
2
40
153
@teivah
Teiva Harsanyi
1 year
Memory Allocation
4
28
133
@teivah
Teiva Harsanyi
1 year
A wonderful resource that describes some anti-patterns that increase the cognitive load for developers 🧠 The best one I read so far Cognitive Load Developer's Handbook
1
23
105
@teivah
Teiva Harsanyi
3 months
Stable map iteration in Go.
Tweet media one
4
8
100
@teivah
Teiva Harsanyi
1 year
A great post on the concept of WAL (Write Ahead Log)
1
13
94
@teivah
Teiva Harsanyi
1 year
An attempt: I opened sponsorships on #golang If your company is hiring and you want to let Go developers know about it, you can sponsor the repo (audience: +1.2k every 2w). Let's give it a try; if that doesn't work out, I'll remove it 😄
1
15
69
@teivah
Teiva Harsanyi
1 year
TIL: The Helper() method in Go unit-tests: #golang Consider the first example that uses an `unmarshal` helper function. Running TestFoo, will print the following: === RUN TestFoo main_test.go:27: invalid character '"' after object key:value pair
Tweet media one
Tweet media two
1
13
59
@teivah
Teiva Harsanyi
2 years
❌ Can you spot what's *wrong* with this worker pool implementation in Go? #golang #concurrency
Tweet media one
13
14
57
@teivah
Teiva Harsanyi
1 year
Yesterday was my last day @Docker 🐳. I had a fantastic experience. Sure, the company and the products are great, but, imo, the company's main asset is its people - skilled, open, and, more importantly, humble. One of the rare times I've seen a company's virtue applied tangibly.
6
1
56
@teivah
Teiva Harsanyi
1 year
Book Review: 100 Go Mistakes and How to Avoid Them by @jhall_io #golang Even if my book was released a year ago, I'm still thrilled to read such comments.
1
10
52
@teivah
Teiva Harsanyi
3 months
How Complex Systems Fail
1
12
49
@teivah
Teiva Harsanyi
5 months
#4 On , that's pretty cool. Of course, this is because of @ThePrimeagen 's react . Thank you for that 🙏.
Tweet media one
5
4
48
@teivah
Teiva Harsanyi
2 years
#1 new release on for the software testing category. Well, my book isn’t solely about testing obviously, but why not? 🤷🏻‍♂️
Tweet media one
5
6
43
@teivah
Teiva Harsanyi
7 months
I rarely tweet about my book, 100 Go Mistakes. Indeed, I'm afraid to look boring to my followers if I keep promoting my own content. Yet, this is the end of the year, so let's do it for once. Reviews First, I'm thrilled with how well it was received by the Go community. Looking
Tweet media one
Tweet media two
6
2
44
@teivah
Teiva Harsanyi
4 months
Interestingly enough, only 11% got it right. When you see a defer, you should know that only the latest set of parenthesis is executed as a deferred expression; the rest is executed immediately. - In this example: defer s.add(1).add(2).add(3) add(1) and add(2) are executed
Tweet media one
@teivah
Teiva Harsanyi
4 months
What's the output of this code? #golang --- type slice []int func (s *slice) add(v int) *slice { *s = append(*s, v) return s } func main() { s := &slice{} run(s) fmt.Println(*s) } func run(s *slice) { s.add(1) defer s.add(2).add(3) s.add(4) }
8
3
14
3
2
41
@teivah
Teiva Harsanyi
2 years
When to create an interface in #golang
Tweet media one
6
12
37
@teivah
Teiva Harsanyi
2 years
I'm looking for new ways to help engineers, and I was wondering if some people here would be interested in the form of a free & long-term mentorship. It wouldn't be to "format" people the same way I work but more to help (juniors or mid-level) in different areas such as...
12
9
37
@teivah
Teiva Harsanyi
2 years
📢 My book 100 Go Mistakes is now available on all Amazon platforms (paper and Kindle): #golang If you enjoyed it and you feel like writing a review, that would be really awesome 🙏 (Have I bought my own book to have it on my Kindle? Absolutely ☺️)
Tweet media one
3
7
37
@teivah
Teiva Harsanyi
2 years
I've made this diagram to help me in having an accurate mental model of the virtual memory concept. Remarks are welcome.
Tweet media one
0
3
35
@teivah
Teiva Harsanyi
4 months
I have just ported my RISC-V virtual processor project from Rust to Go: #golang The goal of this project is to delve into how processors work and try to implement the fastest architecture possible. - MVM-1: Classic architecture, no optimization -
Tweet media one
2
2
36
@teivah
Teiva Harsanyi
1 year
First week as a Noogler 🥳
5
0
34
@teivah
Teiva Harsanyi
1 year
In Go, runtime.LockOSThread() to reduce the number of cache misses in some very specific conditions Last thought before to go to sleep
3
2
32
@teivah
Teiva Harsanyi
1 year
I started working on Gossip Glomers: I find it... absolutely fantastic! For example, in challenge 3, we have to build a broadcast protocol with some constraints in terms of latency and the number of messages exchanged. It's really challenging and fun!
0
5
31
@teivah
Teiva Harsanyi
11 months
A trick to enforce that a generic parameter is passed as a pointer #golang
Tweet media one
2
1
31
@teivah
Teiva Harsanyi
1 year
I completed the Gossip Glomers challenge (). Here's my repo where I explain the solutions I took: Frankly, it was a great experience. Thanks @flydotio 🙇🏻‍♂️
3
2
31
@teivah
Teiva Harsanyi
2 years
Production Ready Go Concurrency #golang Lots of valuable information from @egonelbre 👍
0
7
30
@teivah
Teiva Harsanyi
2 years
If you're interested, my book 100 Go Mistakes (alongside other Go books) is part of Manning's deal of the day:
3
7
29
@teivah
Teiva Harsanyi
1 year
If your public API takes a string as a parameter, you should be prepared to receive the integral of Shakspeare translated into 52 languages. Said differently, when you expose something, you should be prepared for users to try your API in unexpected ways (purposely or not).
1
8
29
@teivah
Teiva Harsanyi
3 months
First time I really experienced the need of coroutines in Go.
7
0
28
@teivah
Teiva Harsanyi
1 year
Reminder: no one is obliged to do some extra personal stuff (e.g., open-source projects, watching conferences, reading tech books) outside work. Don't feel bad if you go through periods like that. What matters, in the end, is managing your own energy.
0
4
26
@teivah
Teiva Harsanyi
2 years
Today's my last day in my current job. Next one: @Docker in three weeks. Can't wait :)
6
0
28
@teivah
Teiva Harsanyi
1 year
I'm delighted to share that we've sold over 5,000 physical copies of my book! While my main goal was to create some good content (not to reach some target), seeing so many readers finding value in it is truly amazing. Thank you very much 🙏.
@teivah
Teiva Harsanyi
2 years
My book, 📖 100 Go Mistakes and How to Avoid Them, has finally been released 🎉 #golang It took me almost 3 years of work since I first thought about the concept and I'm delighted it finally came out. Thanks to @ManningBooks and all the people involved 🙏
26
127
607
3
1
28
@teivah
Teiva Harsanyi
1 year
Coroutines for Go by @_rsc : #golang
1
4
26
@teivah
Teiva Harsanyi
2 years
2. How Linux Works by @bricsuc #linux The best book, in my opinion, on Linux. A must-read as Linux today is absolutely everywhere. It provides most of the content every developer should be aware of.
1
2
26
@teivah
Teiva Harsanyi
11 months
I can read here and there so much confusion on TDD. For example, some people state that TDD allows one to get full confidence in some code. I strongly disagree with that. Practicing TDD leads to a significant code coverage, true. Yet, I can practice TDD but write tests that
7
1
24
@teivah
Teiva Harsanyi
4 months
Humans are Hooked. Machines are Learning.
Tweet media one
0
8
24
@teivah
Teiva Harsanyi
4 years
Glad to announce that I signed with @ManningBooks to write a book about Go 🥳 More coming soon.
4
2
23
@teivah
Teiva Harsanyi
7 months
What We Got Right, What We Got Wrong Rob Pike's retrospective on 14 years of Go.
0
12
23
@teivah
Teiva Harsanyi
1 year
I'm starting to think about writing a blog post that would try demystifying non-straightforward database concepts like serializability, linearizability, etc. 🤔
1
1
23
@teivah
Teiva Harsanyi
4 years
Go and CPU Caches
1
4
24
@teivah
Teiva Harsanyi
1 year
A great post about load balancing by @samwhoo
3
2
23
@teivah
Teiva Harsanyi
2 years
Truth be told, I'm tired of having to implement my own function in Go to return the max between two ints 😒
3
1
23
@teivah
Teiva Harsanyi
2 years
A book is never finished; it's abandoned ― Gene Fowler After almost 2 years of writing, I've just abandoned my book. Release date: end of August for the print version and beginning of October for the electronic version. #golang
1
6
22
@teivah
Teiva Harsanyi
1 year
I recently got a very nice comment on my book. Yet, after reading it carefully...
Tweet media one
2
1
22
@teivah
Teiva Harsanyi
1 year
I don't want to sound picky couldn't an editor be consistent across the books it publishes regarding the name of a language?
Tweet media one
6
0
21
@teivah
Teiva Harsanyi
6 years
A 100 line gRPC proto file translated in Java: 10649 lines. The same file in Golang: 657 lines #gRPC #Java #Golang
1
7
21
@teivah
Teiva Harsanyi
4 months
Do you want to delete elements while iterating on a slice in #golang ? Here's a trick I learned today from @val_deleplace . I still can't decide whether I love it or I hate it 😂
Tweet media one
2
2
21
@teivah
Teiva Harsanyi
1 year
Look at the picture I just got from @goinggodotnet . How cool is the fact that he printed the inside cover of my book? 😁 #proud
Tweet media one
2
2
20
@teivah
Teiva Harsanyi
2 years
Tips: Use sync.Pool to reuse data buffers. I made such a change today, and I had visible impacts on: - The frequency of GC cycles - The average CPU consumption - And even the latency (especially from p90) #golang
0
2
17
@teivah
Teiva Harsanyi
1 year
It was genuinely inspiring meeting @BhosalePratim . She is passionate, curious, and likes sharing her knowledge with others. People like her drive our industry forward. Thanks for the visit; see you next time!
@BhosalePratim
Pratim🥑
1 year
Google Office in Paris is exquisite ✨🥐 Yesterday I had lunch with @teivah and I asked him how in his 12+ years of workX with leading Tech companies, freelancing and being an established author he learnt new concepts. And this is what he had to say
Tweet media one
Tweet media two
11
13
598
1
0
19
@teivah
Teiva Harsanyi
5 years
Multithreaded programming
Tweet media one
0
5
18
@teivah
Teiva Harsanyi
2 years
🧵 10 things I learned about technical writing and teaching in general while writing my first book.
2
1
18
@teivah
Teiva Harsanyi
2 years
10. Kubernetes Patterns by @bibryam @ro14nd #k8s Probably not the first book you need to read on k8s as this one is more for advanced readers. Yet, the amount of information that is useful to operate a system is amazing. A must-read as well, in my opinion.
1
3
19
@teivah
Teiva Harsanyi
3 years
Just published: When to Use Generics in Go? #golang
1
4
18
@teivah
Teiva Harsanyi
4 months
I just remembered the time when, in a previous company, I managed to push to production a service that was logging my face at startup. How cool is that?
Tweet media one
2
1
16
@teivah
Teiva Harsanyi
2 years
4. Understanding Distributed Systems by @RaVitillo #distributedsystems In my opinion, the first book to read when starting to study distributed systems. It provides an outstanding entry point on many crucial topics, even for experienced engineers.
1
2
18
@teivah
Teiva Harsanyi
1 year
Coming with Go 1.21 🎉
@teivah
Teiva Harsanyi
2 years
You have to use a function that returns the max value between two ints in Go; how do you handle it?
1
1
4
4
1
18
@teivah
Teiva Harsanyi
1 year
@valyala I get your point, but that wouldn't be the fairest approach in regular conditions I guess.
1
0
18
@teivah
Teiva Harsanyi
7 months
One handy pattern I discovered today in #Golang when we want to make sure our function receives a string literal (i.e., string constant). For example, to prevent SQL injection, we want to make sure the client uses SQL binding instead of `fmt.Sprintf("select ... where clientID =
3
1
18
@teivah
Teiva Harsanyi
2 years
🧵 Here's the process I _usually_ follow when doing a new dev in Go 🧵 What do you think about it? 👇 #golang
2
5
17
@teivah
Teiva Harsanyi
9 months
I'll be giving a talk at @P99CONF today at 6:20 pm CET Running a Go App in Kubernetes: CPU Impacts
Tweet media one
1
5
17
@teivah
Teiva Harsanyi
2 years
I'm seriously getting exhausted with @GoLandIDE ... Having a feature as simple as a Ctrl+Z that doesn't work from time to time, it's really depressing. I think it's time to start migrating to VSCode...
Tweet media one
13
0
16
@teivah
Teiva Harsanyi
2 years
Here's a pattern that I enjoy in Go but I don't really assume it 😅 In Go, you can't pass multiple variadic argument types. One way to overcome this is by returning a function. In the end, it looks somehow similar to currying in FP languages. #golang
Tweet media one
1
4
16
@teivah
Teiva Harsanyi
1 year
[New Blog Post] I Completed All 8 Advents of Code in One Go: Here Are the Lessons I Learned 🚀 #AdventOfCode
1
4
14
@teivah
Teiva Harsanyi
1 year
For the context, here's the original version. If you look closely, there might be references to the folks who inspired me the most in the Go community.
Tweet media one
1
2
15
@teivah
Teiva Harsanyi
6 years
With the Scala Kafka Streams wrapper made by @lightbend included! 😁
@rmoff
Robin Moffatt 🍻🏃🥓
6 years
🎆What a nice start to the week: Apache Kafka 2.0 has been released 🎇 Check out the release notes here: Stay tuned for Confluent Platform 5.0…
2
63
92
0
3
15
@teivah
Teiva Harsanyi
2 years
5. Designing Data-Intensive Applications by @martinkl #distributedsystems No IT top list without this one. Pure gold. Perhaps more in-depth than the previous one so I think these two books complement each other perfectly well.
1
1
15
@teivah
Teiva Harsanyi
7 months
Go’s CompareAndSwap is not always Compare-and-swap
1
0
15
@teivah
Teiva Harsanyi
2 years
When it comes to choosing a DB, there are tradeoffs we have to make: - Latency vs. consistency - Availability vs. consistency - ACID vs. non-ACID - Read vs. write heavy Here's a framework that one could use during system design interviews.
Tweet media one
0
5
15