👍10🌭3❤1
✅ اشاره گر (pointer) چیست؟
فرض کنید یک متغیری به نام tweet دارید مانند زیر:
آدرس حافظه فرضا: 0x0001
این متغیر به همراه مقدارش در خانه ای از حافظه اصلی (RAM) قرار میگیرد.
حال اگر شما با استفاده از & قبل از نام متغیر tweet داخل متغیر p قرار دهید، یعنی دارید به آدرس خانه حافظه tweet اشاره می کنید و مقدار خانه حافظه متغیر p هم 0x0001 خواهد بود که به متغیر tweet اشاره می کند.
اصولاً به اینکار reference می گویند.
حال اگر قبل از متغیر p یک * بزارید می توانید به مقدار اشاره شده داخل متغیر p که همان متغیر tweet هست دسترسی پیدا کنید.
اصولاً به اینکار deference میگویند.
حتی شما می توانید p* را مجدد مقدار دهی کنید و مقدار tweet هم تغییر خواهد کرد.
➖➖➖➖➖➖➖➖➖
🕊 @gopher_academy
فرض کنید یک متغیری به نام tweet دارید مانند زیر:
tweet := "...content..."
آدرس حافظه فرضا: 0x0001
این متغیر به همراه مقدارش در خانه ای از حافظه اصلی (RAM) قرار میگیرد.
p := &tweet
حال اگر شما با استفاده از & قبل از نام متغیر tweet داخل متغیر p قرار دهید، یعنی دارید به آدرس خانه حافظه tweet اشاره می کنید و مقدار خانه حافظه متغیر p هم 0x0001 خواهد بود که به متغیر tweet اشاره می کند.
اصولاً به اینکار reference می گویند.
*p
حال اگر قبل از متغیر p یک * بزارید می توانید به مقدار اشاره شده داخل متغیر p که همان متغیر tweet هست دسترسی پیدا کنید.
اصولاً به اینکار deference میگویند.
حتی شما می توانید p* را مجدد مقدار دهی کنید و مقدار tweet هم تغییر خواهد کرد.
"...content..."
➖➖➖➖➖➖➖➖➖
🕊 @gopher_academy
👍13👎4
✅ When to use what?
Go ↓
Infrastructural programming and servers. Less is more. Simplicity.
Rust ↓
Resource-constrained environments. Every byte and CPU cycle matters. Safety is critical. Can’t say simple.
Pick your poison ☠️ 😂
#Tweet by inanc
➖➖➖➖➖➖➖➖➖
🕊 @gopher_academy
Go ↓
Infrastructural programming and servers. Less is more. Simplicity.
Rust ↓
Resource-constrained environments. Every byte and CPU cycle matters. Safety is critical. Can’t say simple.
Pick your poison ☠️ 😂
#Tweet by inanc
➖➖➖➖➖➖➖➖➖
🕊 @gopher_academy
👍12💊3
The UNIX philosophy is often quoted as “everything is a file”, but that really means “everything is a stream of bytes”.
— Linus Torvalds
➖➖➖➖➖➖➖➖➖
🕊 @gopher_academy
— Linus Torvalds
➖➖➖➖➖➖➖➖➖
🕊 @gopher_academy
👍8💯3💊3
👍5❤4🎉1
📕 Strategic Monoliths and Microservices
Driving Innovation Using Purposeful Architecture
➖Edited by: Vaughn Vernon, Tomasz Jaskuła
➖Paperback : 348 pages (B5)
➖Edition : 1
➖Year : 2022
➖Publisher : Addison-Wesley
➖Code:
🛒 🌐 https://skybooks.ir
➖➖➖➖➖➖➖➖➖
🕊 @gopher_academy
Driving Innovation Using Purposeful Architecture
➖Edited by: Vaughn Vernon, Tomasz Jaskuła
➖Paperback : 348 pages (B5)
➖Edition : 1
➖Year : 2022
➖Publisher : Addison-Wesley
➖Code:
A2783
➖ See in Amazon🛒 🌐 https://skybooks.ir
➖➖➖➖➖➖➖➖➖
🕊 @gopher_academy
👍7
🤔5👍2
🔥 Go is unconventional yet versatile.
🔥 Go isn't just OOP, functional, or procedural.
🚀 It's a unique blend of all and beyond.
✅ If you aim for idiomatic code, don't confine it to any one style.
#Tweet by inanc
➖➖➖➖➖➖➖➖➖
🕊 @gopher_academy
🔥 Go isn't just OOP, functional, or procedural.
🚀 It's a unique blend of all and beyond.
✅ If you aim for idiomatic code, don't confine it to any one style.
#Tweet by inanc
➖➖➖➖➖➖➖➖➖
🕊 @gopher_academy
👍4👎1🍌1💊1
اولین آمارها از اخراج افراد به خاطر هوش مصنوعی منتشر شد
طبق گزارش ماه May چلنجر در آمریکا حدود ۸۰ هزار نفر از کار اخراج شدن که ۴ هزار نفرشون به خاطر هوش مصنوعی بوده
در کنار این گفتن تازه خیلی از شرکتها نمیگن دلیل اصلیشون برای اخراج AI بوده که میتونه عدد بیشتر از اینها باشه
#DevTwitter | <Soroush Ahmadi/>
➖➖➖➖➖➖➖➖➖
🕊 @gopher_academy
طبق گزارش ماه May چلنجر در آمریکا حدود ۸۰ هزار نفر از کار اخراج شدن که ۴ هزار نفرشون به خاطر هوش مصنوعی بوده
در کنار این گفتن تازه خیلی از شرکتها نمیگن دلیل اصلیشون برای اخراج AI بوده که میتونه عدد بیشتر از اینها باشه
#DevTwitter | <Soroush Ahmadi/>
➖➖➖➖➖➖➖➖➖
🕊 @gopher_academy
👀9👎3🔥1🌭1🍓1👨💻1
In golang, we "expect" errors, but we don't "expect" panics.
😊 Errors are our sane behavior
😱 Panics are our manic behavior
#Tweet by inanc
➖➖➖➖➖➖➖➖➖
🕊 @gopher_academy
😊 Errors are our sane behavior
😱 Panics are our manic behavior
#Tweet by inanc
➖➖➖➖➖➖➖➖➖
🕊 @gopher_academy
👍3🌭2🍾1💊1
🔵Logging in Go: Choosing a System and Using it
🔴https://www.honeybadger.io/blog/golang-logging/
➖➖➖➖➖➖➖➖➖
🕊 @gopher_academy
🔴https://www.honeybadger.io/blog/golang-logging/
➖➖➖➖➖➖➖➖➖
🕊 @gopher_academy
👍3🔥1🐳1
👍3🕊1🏆1
👍6🍓1
A few golang tips for writing effective Go code:
1. Make it easy to read from top to bottom
2. Do not hide the cost of doing something
3. Do not prematurely abstract
These are not rules, just advice.
#Tweet by inanc
➖➖➖➖➖➖➖➖➖
🕊 @gopher_academy
1. Make it easy to read from top to bottom
2. Do not hide the cost of doing something
3. Do not prematurely abstract
These are not rules, just advice.
#Tweet by inanc
➖➖➖➖➖➖➖➖➖
🕊 @gopher_academy
🍌2👍1🕊1
🔵Finding The Best Go Project Structure - Part 1
🔻Structuring Approach
🔻Single Package Approach
🔻Coupled Packages Approach
🔻Independent Packages Approach
🔻Retrospective Analysis
🔻Reusability Issues
🔻Undeclared Dependencies
🟢https://avivcarmi.com/finding-the-best-go-project-structure-part-1/
➖➖➖➖➖➖➖➖➖
🕊 @gopher_academy
🔻Structuring Approach
🔻Single Package Approach
🔻Coupled Packages Approach
🔻Independent Packages Approach
🔻Retrospective Analysis
🔻Reusability Issues
🔻Undeclared Dependencies
🟢https://avivcarmi.com/finding-the-best-go-project-structure-part-1/
➖➖➖➖➖➖➖➖➖
🕊 @gopher_academy
👍3🍾2👎1👏1
🚀 golang Optimization Tip:
Convert string to []byte without allocation.
Only do this in a hot spot after careful consideration.
#Tweet by inanc
➖➖➖➖➖➖➖➖➖
🕊 @gopher_academy
Convert string to []byte without allocation.
Only do this in a hot spot after careful consideration.
#Tweet by inanc
➖➖➖➖➖➖➖➖➖
🕊 @gopher_academy
👍3👀2💊1
🚀 golang Optimization Tip:
Convert []byte to string without allocation.
Only do this in a hot spot after careful consideration.
#Tweet by inanc
➖➖➖➖➖➖➖➖➖
🕊 @gopher_academy
Convert []byte to string without allocation.
Only do this in a hot spot after careful consideration.
#Tweet by inanc
➖➖➖➖➖➖➖➖➖
🕊 @gopher_academy
👍6
🔵Implementing a distributed key-value store on top of implementing Raft in Go
🟢https://notes.eatonphil.com/2023-05-25-raft.html
➖➖➖➖➖➖➖➖➖
🕊 @gopher_academy
🟢https://notes.eatonphil.com/2023-05-25-raft.html
➖➖➖➖➖➖➖➖➖
🕊 @gopher_academy
👍1💊1
موضوع دورهمی هفته یازدهم؟
Final Results
27%
بحث و گفتگو در خصوص Clean Architecture
9%
بحث و گفتگو در خصوص Hexagonal
35%
بحث و گفتگو در خصوص GRPC, Protocol buffers, google API design, transcoding
12%
بحث و گفتگو در خصوص الگوریتم و ساختار داده
5%
بحث و گفتگو در خصوص بهینه سازی و Tip & Tricks
10%
بحث و گفتگو در خصوص ماژول نویسی استاندارد
2%
بحث و گفتگو در خصوص پکیج های استاندارد
👍4👎2💊1