Linux TLDR · @linuxtldr
525 followers · 274 posts · Server noc.social
finny · @finny
248 followers · 687 posts · Server plush.city

❌ INCORRECT:
catch (error) {
// swallow error
}

βœ… CORRECT:
catch (error) {
// vore error
}

#programmingtips #happyvoreday

Last updated 1 year ago

thezerobit · @thezerobit
554 followers · 1724 posts · Server anticapitalist.party

Here's a quick recipe for generating a copy of a list with duplicates removed while preserving order in O(n) time.

>>> input_list = ["a", "c", "a", "b"]
>>> list(dict.fromkeys(input_list))
['a', 'c', 'b']

This works because:

Python dictionaries preserve key insertion order (since 3.6).

dict.fromkeys(...) constructs a dictionary where the keys are the values returned from an iterable object.

Iterating over a dictionary returns the keys in order.

#python #programmingtips

Last updated 1 year ago

TechieChimp · @TechieChimp
1 followers · 26 posts · Server techhub.social

Recently, tackled 13 flaky integration tests 🎲. The culprit? 'os.kill(self.pid, signal.SIGTERM)' πŸ§Ÿβ€β™‚οΈ spawning zombies. The fix: just add 'os.wait()' βœ”οΈ. A reminder: sometimes, quirks hide at the OS level. Broaden your perspective to find solutions πŸŒ….

#python #softwareengineering #programmingtips

Last updated 1 year ago

FastRuby.io · @FastRuby
32 followers · 115 posts · Server ruby.social
eliza-ng · @elizang
8 followers · 143 posts · Server botsin.space

🌟 Get ready for a ! πŸš€ Our latest post delves into the vast universe of programming, optimization, and more. Join us as we navigate through this diverse realm! ✨
eliza-ng.me/post/thetwosfromth

#techblogbonanza #techgeeks #programmingtips #optimizeyourcode #blogging

Last updated 1 year ago

JTurtle · @jturtle
16 followers · 511 posts · Server kolektiva.social

avoid commenting your code in order to save up to multiple nanoseconds of compilation speed and several kilobytes of disk space 😎

#lifehack #programmingtips

Last updated 1 year ago

FastRuby.io · @FastRuby
24 followers · 56 posts · Server ruby.social
Bartosz WyspiaΕ„ski · @felislynx
8 followers · 90 posts · Server hachyderm.io

When I'm programming i have to use different cables (micro usb, type c or lightning), i like to use Baseus magnetic cable. Then i just use one to rule all my devices.

#programming #programmingtips #iOS #android

Last updated 2 years ago

Ignytis · @ignytis
7 followers · 119 posts · Server techhub.social

Move constants to separate files to make them reusable. Do NOT copy-paste definitions of constants across files. Import of constants from modules prevents from:
- typos
- inconsistencies if you eventually update a value.

The same about functions, classes and other types btw. Constants are just the simplest example

#programmingtips

Last updated 2 years ago

Rick Donato · @rickdonato
26 followers · 32 posts · Server hachyderm.io

Struggling with Git? If so, check out this comprehensive cheat sheet to help you master Git! gitkraken.com/pdfs/git-basics-

#CheatSheet #programmingtips #NetworkAutomation #git

Last updated 2 years ago

The Comment · @TheComment
4 followers · 7 posts · Server discuss.systems

**.NET Dependency Injection** It doesn't hurt.
When using dependency injection in .NET Core, choosing the right lifetime scope is key. Transient services are good for lightweight, stateless services that are created every time they are requested. Scoped services are suitable for services with limited lifetime that are shared within a single request. Singleton services are best for expensive, stateful services that are shared across the entire application. Choose the right scope for your service to ensure optimal performance and functionality. Here is more: learn.microsoft.com/en-us/aspn

#netcore #programmingtips #transientvsscopedvssingleton

Last updated 2 years ago

The Comment · @TheComment
4 followers · 5 posts · Server discuss.systems

**Different Ways of Mocking in Unit Testing**

Mocking is a crucial part of unit testing, and there are different ways to do it. You can use interfaces for loose coupling, such as mocking external services like a database. Delegates are great for flexibility when you need to pass behavior as a parameter, like sorting or filtering. Virtual methods are ideal for inheritance, like mocking abstract base classes or overwriting methods in a derived class. Each approach has its own pros and cons - which one you choose depends on your specific needs and preferences.

#mockinginunittesting #programmingtips #interfacesvsdelegatesvsvirtual #itexplainer

Last updated 2 years ago

Poda Black · @PodaBlack
4 followers · 24 posts · Server zbrx.org

Aside from the stated components, a framework also has others like API, toolsets, compilers, and support programs to function properly. Understanding the framework you're using helps you know if it suits your plan.

#programmingtips

Last updated 2 years ago

The Comment · @TheComment
0 followers · 1 posts · Server discuss.systems

- Explaining complex topics in computer science, coding, hardware and all tech in easy terms for a wide audience - that's our goal! From the latest scientific breakthroughs to intricate technological concepts, we'll break it down in a way that's accessible to all. Stay tuned for fascinating insights that anyone can understand.








#introduction #simplifyingcomplexity #expertexplanations #knowledgeforall #codelife #hardwarehacks #programmingtips #techtalks #codecommunity #hardwareupdates #codingskills #techsavvy #hardwaretech

Last updated 2 years ago

FastRuby.io · @FastRuby
1 followers · 1 posts · Server ruby.social

You might have extended classes or instances in , but do you know you can also extend Rails associations? go.fastruby.io/97h

#rails #rubydev #rubyonrails #programmingtips

Last updated 2 years ago

Sailesh Dahal · @saileshbro
1 followers · 2 posts · Server mastodon.social
Dev Leader · @devleader
0 followers · 10 posts · Server hachyderm.io

ChatGPT meta! Here's how we can access OpenAI endpoints.

Like, share, and remember to follow for more software engineering topics!

#openai #chatgpt #meta #programming #howto #tutorial #dotnet #dotnetcore #csharp #webapi #programmingtips

Last updated 2 years ago

Stian Øverbye · @stianoe
22 followers · 38 posts · Server snabelen.no

Did you know JDK is an acronym that means "Just Ducking Kidding"? :)

#programmingtips

Last updated 2 years ago