Islombe dev
69 subscribers
118 photos
26 videos
80 links
Here I share thoughts, news, memes.
Topic: IT and more :)

My website: https://islombe-dev.uz

My soc. networks:
- youtube.com/@islombe_dev
- instagram.com/islombe_dev
Download Telegram
Why is the Developer Doing Everything? 🤔

Ever feel like you’re the team’s Swiss Army knife, doing everything from coding to setting up the coffee machine?

1. Developer = Jack of All Trades
We code, we test, we even do a bit of design! With a skill set like ours, it’s no wonder tasks keep landing on our plate. 😓

2. Small Team, Big Expectations
In startups, there’s no budget for specialists, so who’s going to handle it all? Yep, you guessed it—us. 💪

3. “Just Give It to the Dev” Syndrome
Without clear roles, everything from bug fixes to Friday night pizza orders ends up being a developer’s responsibility. 🍕

4. Communication Struggles
Sometimes it feels like “the dev will figure it out” is the team’s unofficial motto. 😅

5. Expectations Galore
When you’re a key player, it’s like there’s a neon sign over your head saying “Dump Tasks Here.” 🛑

#DeveloperLife #TechHumor
Please open Telegram to view this post
VIEW IN TELEGRAM
Don't Overthink, Start Solving! 💡

When faced with a complex task, it's easy to overthink and get lost in endless solutions. But here's the key: just start solving!

Once you get the correct result, it's time to optimize.
Bit by bit, refine your code—make it more readable, maintainable, and sometimes even faster (but not always 😉).

Here is an example:

Task is
Implement a function that receives two IPv4 addresses, and returns the number of addresses between them (including the first one, excluding the last one).

All inputs will be valid IPv4 addresses in the form of strings. The last address will always be greater than the first one.


Solution optimizing evolution

First version, which works, but its a big unreadable code
// first version
export function ipsBetweenV1(start: string, end: string): number {
const reversedStart = start
.split(".")
.reverse()
.map((segment) => parseInt(segment, 10)) as number[]
const reversedEnd = end
.split(".")
.reverse()
.map((segment) => parseInt(segment, 10)) as number[]

const amountInStart = reversedStart.reduce((acc, curr, index) => {
acc += curr * Math.pow(256, index) + 1
return acc
})
const amountInEnd = reversedEnd.reduce((acc, curr, index) => {
acc += curr * Math.pow(256, index) + 1
return acc
})

return amountInEnd - amountInStart
}

Nasty...

Implementing DRY and Divide-and-conquer:
// second version
export function ipsBetweenV2(start: string, end: string): number {
const getReversedSegments = (ip: string) => {
return ip
.split(".")
.reverse()
.map((segment) => parseInt(segment, 10)) as number[]
}
const calcAmountInIps = (ips: string) => {
return getReversedSegments(ips).reduce((acc, curr, index) => {
acc += curr * Math.pow(256, index) + 1
return acc
}) as number
}

return calcAmountInIps(end) - calcAmountInIps(start)
}

Looks much better. But something is missing, and looks like we overdoing something...

Removing unneeded reverse(), and simplifying functions into one with readable structure:
export function ipsBetween(start: string, end: string): number {
const ipToNumber = (ip: string): number =>
ip.split(".").reduce((acc, curr, index) => acc * 256 + parseInt(curr, 10), 0);

return ipToNumber(end) - ipToNumber(start);
}

Final solution looks 10 times better, much more readable and well structured 🗣

#CodingTips #ProblemSolving #DeveloperLife
Please open Telegram to view this post
VIEW IN TELEGRAM
31
1 week - 1 small project

Planning to implement several small, yet problem-solving, ideas over the next few months. So, stay tuned – I will need all your feedback!

Do not know with what this is going to end, but excited to try building something useful for users 😎


#challege #startup #DeveloperLife
Please open Telegram to view this post
VIEW IN TELEGRAM
3