🔵 How Are Best Practices Relevant in Software Engineering?🔵
1. Enhance Code Readability
2. Ensure Your Code Works Efficiently
3. Refactor Your Code
4. Develop A Professional Coding Style
5. Use Version Control
6. Test Your Code
7. The KISS Principle
8. The YAGNI Principle
9. The DRY Principle
➖➖➖➖➖➖➖➖➖
🔰 @gopher_academy
1. Enhance Code Readability
2. Ensure Your Code Works Efficiently
3. Refactor Your Code
4. Develop A Professional Coding Style
5. Use Version Control
6. Test Your Code
7. The KISS Principle
8. The YAGNI Principle
9. The DRY Principle
➖➖➖➖➖➖➖➖➖
🔰 @gopher_academy
👍3❤1
🔵 Best practices using context in golang 🔵
1- context.Background should be used only at the highest level, as the root of all derived contexts
2- context.TODO should be used where not sure what to use or if the current function will be updated to use context in future
3- context cancelations are advisory, the functions may take time to clean up and exit
4- context.Value should be used very rarely, it should never be used to pass in optional parameters. This makes the API implicit and can introduce bugs. Instead, such values should be passed in as arguments.
5- Don’t store contexts in a struct, pass them explicitly in functions, preferably, as the first argument.
6- Never pass nil context, instead, use a TODO if you are not sure what to use.
7- The Context struct does not have a cancel method because only the function that derives the context should cancel it.
➖➖➖➖➖➖➖➖➖
🔰 @gopher_academy
1- context.Background should be used only at the highest level, as the root of all derived contexts
2- context.TODO should be used where not sure what to use or if the current function will be updated to use context in future
3- context cancelations are advisory, the functions may take time to clean up and exit
4- context.Value should be used very rarely, it should never be used to pass in optional parameters. This makes the API implicit and can introduce bugs. Instead, such values should be passed in as arguments.
5- Don’t store contexts in a struct, pass them explicitly in functions, preferably, as the first argument.
6- Never pass nil context, instead, use a TODO if you are not sure what to use.
7- The Context struct does not have a cancel method because only the function that derives the context should cancel it.
➖➖➖➖➖➖➖➖➖
🔰 @gopher_academy
👍5
🔵 part-1:Go Best Practices: Optimize Golang Code For Better Performance🔵
🔴 Syntax and Folder Structure
1-Define data types of variables
2-Use comments
3-Maintain naming conventions
You can keep the following things in mind:
3-1-Avoid using underscores.
3-2-Use Mixed Case Capital acronyms
3-3-Short local variables or single letters for loop argument or index
4-Modularization
5-Splitting up projects
🔴 Package
1-Take care of documentation
2-Managing multiple files in the same package
Should you break a specific package into numerous files?
2-1-Prevent long files: Standard library’s net/http package comprises 15734 lines in 47 files.
2-2-Divide code and tests: net/http/cookie_test.go and net/http/cookie.go, both are parts of the http package. Ideally, test code is only compiled at test time.
2-3-Divided package documentation: When the package has more than one file, it is an agreement to create a doc.go comprising the package documentation.
3-Pack your packages properly
🔴 Code Practices to maintain readability
1-Avoid Nesting
2-Do not repeat unnecessary code
3-Prioritize essential code
🔴 Handling Go errors
1-Using multiple return values
2-Wrap Golang errors
For wrapping errors, fmt.Errorf provides %w verb to inspect and unwrap errors. Functions like
2-1-errors.Unwrap: For inspecting and exposing the underlying errors in the code.
2-2-errors.Is: For comparing every error value of the error chain against the sentinel value. The Is method implemented on the error is used to post the error itself as the sentinel value in case we don’t have a sentinel value.
2-3-errors.As: The function is used to cast a particular error type. For that, it looks for the very first error encountered in the error chain and sets that specific error as a sentinel value, and returns true.
🔴State Management With Goroutines
1-Avoid Goroutine Leaks
1-1-The goroutine is blocked on chan write
1-2-The goroutine carries a source to the chan
1-3-The chan will never be accumulated with garbage.
🔴Golang CI/CD
1-Use Go Modules
2-Use Artifactory Repository Layouts
🔴Testing in Go App
1-Keep your tests in a different package
2-A different file for internal tests
3-Write table-driven tests
🔴 Syntax and Folder Structure
1-Define data types of variables
2-Use comments
3-Maintain naming conventions
You can keep the following things in mind:
3-1-Avoid using underscores.
3-2-Use Mixed Case Capital acronyms
3-3-Short local variables or single letters for loop argument or index
4-Modularization
5-Splitting up projects
🔴 Package
1-Take care of documentation
2-Managing multiple files in the same package
Should you break a specific package into numerous files?
2-1-Prevent long files: Standard library’s net/http package comprises 15734 lines in 47 files.
2-2-Divide code and tests: net/http/cookie_test.go and net/http/cookie.go, both are parts of the http package. Ideally, test code is only compiled at test time.
2-3-Divided package documentation: When the package has more than one file, it is an agreement to create a doc.go comprising the package documentation.
3-Pack your packages properly
🔴 Code Practices to maintain readability
1-Avoid Nesting
2-Do not repeat unnecessary code
3-Prioritize essential code
🔴 Handling Go errors
1-Using multiple return values
2-Wrap Golang errors
For wrapping errors, fmt.Errorf provides %w verb to inspect and unwrap errors. Functions like
2-1-errors.Unwrap: For inspecting and exposing the underlying errors in the code.
2-2-errors.Is: For comparing every error value of the error chain against the sentinel value. The Is method implemented on the error is used to post the error itself as the sentinel value in case we don’t have a sentinel value.
2-3-errors.As: The function is used to cast a particular error type. For that, it looks for the very first error encountered in the error chain and sets that specific error as a sentinel value, and returns true.
🔴State Management With Goroutines
1-Avoid Goroutine Leaks
1-1-The goroutine is blocked on chan write
1-2-The goroutine carries a source to the chan
1-3-The chan will never be accumulated with garbage.
🔴Golang CI/CD
1-Use Go Modules
2-Use Artifactory Repository Layouts
🔴Testing in Go App
1-Keep your tests in a different package
2-A different file for internal tests
3-Write table-driven tests
👍9
Forwarded from Gopher Academy
🔺نقشه یادگیری زبان برنامه نویسی گولنگ🔺
🔹️roadmap part 1
https://t.me/gopher_academy/7
🔹️roadmap part 2
https://t.me/gopher_academy/9
🔹️roadmap part 3
https://t.me/gopher_academy/11
✋ @gopher_academy
🔹️roadmap part 1
https://t.me/gopher_academy/7
🔹️roadmap part 2
https://t.me/gopher_academy/9
🔹️roadmap part 3
https://t.me/gopher_academy/11
✋ @gopher_academy
🤩6❤2🎉2👍1
یه سایت جالب که ۸ تا سوال مختلف در مورد SQL داره و بصورت عملی میتونید دانش SQL خودتون رو محک بزنید.
https://8weeksqlchallenge.com
➖➖➖➖➖➖➖➖➖
🔰 @gopher_academy
https://8weeksqlchallenge.com
➖➖➖➖➖➖➖➖➖
🔰 @gopher_academy
👍4❤1🎉1
A fully functional local AWS cloud stack
Develop and test your cloud and serverless apps offline!
بصورت local و کاملا عملی کل استک AWS را بالا بیارید و اپلیکیشنهای خود را قبل از deploy روی سرورهای اصلی AWS با localStack تست کنید.
#aws #local #stack #cloud #server #serverless #test #infrastructure #efficient
https://localstack.cloud
➖➖➖➖➖➖➖➖➖
🔰 @gopher_academy
Develop and test your cloud and serverless apps offline!
بصورت local و کاملا عملی کل استک AWS را بالا بیارید و اپلیکیشنهای خود را قبل از deploy روی سرورهای اصلی AWS با localStack تست کنید.
#aws #local #stack #cloud #server #serverless #test #infrastructure #efficient
https://localstack.cloud
➖➖➖➖➖➖➖➖➖
🔰 @gopher_academy
👍7🤩4🔥2❤1
۱۵ نکته برای طراحی بهتر RESTFul API ها که به هیچ زبان برنامهنویسیای ربط خاصی نداره.
https://r.bluethl.net/how-to-design-better-apis
➖➖➖➖➖➖➖➖➖
🔰 @gopher_academy
https://r.bluethl.net/how-to-design-better-apis
➖➖➖➖➖➖➖➖➖
🔰 @gopher_academy
👍5❤2🔥2
🔸استخدام برنامهنویس Golang #تهران
🔹پارهوقت 🔹کارآموز (Intern)
🔗 https://quera.org/r/tBT7aM
➖➖➖➖➖➖➖➖➖
🔰 @gopher_academy
🔹پارهوقت 🔹کارآموز (Intern)
🔗 https://quera.org/r/tBT7aM
➖➖➖➖➖➖➖➖➖
🔰 @gopher_academy
❤1👍1🔥1🎉1
🔸استخدام برنامهنویس Golang #مشهد
🔹تمام وقت
مهارت های مورد نیاز
- مسلط به زبان Go و انواع پارادایم ها
- مسلط به مفاهیم Concurrency، Goroutine و Channel
- مسلط به RESTful API
- آشنا به دیتابیس MongoDB
- آشنایی با معماری clean و اصول سالید
- آشنایی با Microservice
موارد زیر مزیت محسوب میشود
- آشنایی کامل با پروتکل بافر و gRPC
@Ja7adR
➖➖➖➖➖➖➖➖➖
🔰 @gopher_academy
🔹تمام وقت
مهارت های مورد نیاز
- مسلط به زبان Go و انواع پارادایم ها
- مسلط به مفاهیم Concurrency، Goroutine و Channel
- مسلط به RESTful API
- آشنا به دیتابیس MongoDB
- آشنایی با معماری clean و اصول سالید
- آشنایی با Microservice
موارد زیر مزیت محسوب میشود
- آشنایی کامل با پروتکل بافر و gRPC
@Ja7adR
➖➖➖➖➖➖➖➖➖
🔰 @gopher_academy
👍5❤2🔥1
Audio
جلسه پرسش و پاسخ «مشاوره شغلی»
تو این جلسه در مورد مسیری که به نظرم روتین هست و یه برنامه نویس خوب و معمولی طی می کنه صحبت کردم و در آخر هم پرسش و پاسخ داشتیم با دوستان عزیز
قطعا تجربه شخصی من در مسیر پیشنهادی دخیل بوده و تنها راه و مسیر شغلی، این مسیر پیشنهادی نیست، اما فکر می کنم نقاط اشتراک زیادی میتونید پیدا کنید.
#career_qa
@gocasts
عضویت در خبرنامه Hey Mate 👇
heymate.ir
➖➖➖➖➖➖➖➖➖
🔰 @gopher_academy
تو این جلسه در مورد مسیری که به نظرم روتین هست و یه برنامه نویس خوب و معمولی طی می کنه صحبت کردم و در آخر هم پرسش و پاسخ داشتیم با دوستان عزیز
قطعا تجربه شخصی من در مسیر پیشنهادی دخیل بوده و تنها راه و مسیر شغلی، این مسیر پیشنهادی نیست، اما فکر می کنم نقاط اشتراک زیادی میتونید پیدا کنید.
#career_qa
@gocasts
عضویت در خبرنامه Hey Mate 👇
heymate.ir
➖➖➖➖➖➖➖➖➖
🔰 @gopher_academy
❤1👍1🔥1🎉1
لیستی از سوالات الگوریتمی به همراه اموزش که از leetcode انتخاب شدن و برای مصاحبه عالین
#algorithm #interview #leetcode #practice
https://neetcode.io
➖➖➖➖➖➖➖➖➖
🔰 @gopher_academy
#algorithm #interview #leetcode #practice
https://neetcode.io
➖➖➖➖➖➖➖➖➖
🔰 @gopher_academy
👍7🔥3
بعد یکسال تجربه داخل اسنپ بودن واقعا پیشنهاد می کنم اقدام کردن برای این موقعیت کاری 💯
https://www.linkedin.com/posts/activity-6946775482575040512-aYpZ?utm_source=linkedin_share&utm_medium=android_app
➖➖➖➖➖➖➖➖➖
🔰 @gopher_academy
https://www.linkedin.com/posts/activity-6946775482575040512-aYpZ?utm_source=linkedin_share&utm_medium=android_app
➖➖➖➖➖➖➖➖➖
🔰 @gopher_academy
Linkedin
Shima Pourkhodabakhsh on LinkedIn: Software Engineer (Golang/Python) - Map Snapp | 21 comments
The Maps Team at Snapp is looking for experienced Backend Software Engineers to join our growing technology team and help propel the company into the next... 21 comments on LinkedIn
👍7
🎉4🤩3👍1
👍4