Software efficiency – Telegram
Software efficiency
78 subscribers
10 photos
1 video
11 links
Welcome to Software Efficiency!
Download Telegram
Software efficiency pinned «The flexible way to set up collaboration between objects: 1. Determine what exactly one object needs from the other: which methods does it execute? 2. Describe these methods in a new interface or abstract class. 3. Make the class that is a dependency implement…»
Hey, nice to see you again after Ramadan. are you here?)
👍5
Later == Never
😎☝️
we'll continue.
🔥4
#advice
Don't try to remember stuff. Brain is bad at remembering. It's rather good at processing.
🔥3
today I'll tell you the truth)

How I make all this content:

1. I learn something small and new
2. I write it down on paper
3. I organize the thought
4. I publish it
5. Repeat
🔥3
#advice
Comments are an apology, not a requirement. Good code mostly documents itself.

@software_efficiency
#advice
Functions should only do one thing - this is by far the most important rule in software engineering. When you can isolate a function to just one action, they can be refactored easily and your code will read much cleaner.

@software_efficiency
👍3
Software efficiency pinned «Understanding the SOLID Principles: Building Better Software Design https://telegra.ph/SOLID-Principles-05-17»
#QA
What is the difference between a class and an object ?
- A class is a blueprint or template that defines the properties and behaviors of an object. An object, on the other hand, is an instance of a class. You can create multiple objects based on a single class definition.

@software_efficiency
🔥2
#QA
How does Automatic Reference Counting (ARC) work in iOS?
- ARC keeps track of the number of references pointing to an object. Each time a reference to an object is created, ARC increases the reference count. When a reference is no longer used or goes out of scope, ARC decreases the reference count. When the reference count reaches zero, ARC automatically deallocates the memory occupied by the object.

@software_efficiency
🔥2
#QA
When memory leaks may occur in Swift?

1. Strong reference cycles: When two objects hold strong references to each other, neither object can be deallocated because their reference counts never reach zero. This commonly happens when two objects have a property that holds a strong reference to each other.

2. Closures and capture lists: Closures capture and retain references to variables and objects they use within their body. If a closure captures a strong reference to an object that also holds a strong reference to the closure, a retain cycle can occur.

3. Delegate and callback patterns: If an object sets itself as the delegate or provides a callback closure to another object, and that object retains a strong reference back to the delegate or callback closure, a retain cycle can happen.

@software_efficiency
🔥2
#QA
To prevent memory leaks in Swift, you can use the following approaches:

1. Weak and unowned references: Use weak or unowned references instead of strong references when there is a possibility of a retain cycle. Weak references allow the object to be deallocated, while unowned references assume that the object will always exist.

2. Capture lists: Use capture lists in closures to specify the relationship between the closure and the captured values. By using [weak self] or [unowned self] in the capture list, you can break retain cycles in closures.

3. Weak delegates: Declare delegate properties as weak to avoid strong reference cycles between objects.

@software_efficiency
🔥2
Be not afraid of going slowly,
be afraid only of standing still.
1
#QA
Explain the concept of protocols in Swift.
- In Swift, protocols define a blueprint of methods, properties, and other requirements that a class, structure, or enumeration can conform to. They define a set of rules or contracts that specify what functionality should be provided. Protocols allow for defining reusable code, promoting code modularity, and enabling objects of different types to interact through a common interface.

@software_efficiency
👍3
maybe this is a transition period, I don't know, but now there is no time for anything, there are too many things to do at work. keep supporting me. I’ll be back soon In Shaa Allah
👍6
OOP 😅

by simple examples.
Please open Telegram to view this post
VIEW IN TELEGRAM
Please open Telegram to view this post
VIEW IN TELEGRAM
👍1