Senior Software Developer - 12 years in software development - Posts in English/Turkish - BOUN - CMPE - MSc. in Software Engineering - a chess enthusiast

This code structure is called an arrow anti-pattern. How to fix this code?
588
133
2,022
3,881,908
This is a solution. Switch statement is ok, too.
45
10
586
120,372
Replying to @stats_feed
I thought you were World of Statistics? What is this?
48
3
559
240,265
If someone ask me to refactor the first "nonsense" code, I will use this way. Only thing I will change is white background of the code. Thanks @viniciuscgp
9
5
473
102,957
This code is calculating area of the given shape. It is bad code. How to fix this issue?(please ignore the missing curly brackets at the end).
105
35
442
89,211
What is your preferred way of communication at work? 1) Teams 2) Zoom 3) Skype 4) WhatsApp 5) Other
617
13
411
101,680
Ultimate solution found!
3
2
385
69,736
Replying to @webtekno
Ben farkı anlayamadım. Çok başarılı o zaman.
1
292
46,455
Today, I used ChatGPT to solve two bugs. After that, I encountered three more serious bugs, so I undid the changes and solved them my way. Is this familiar to you?
86
12
269
17,449
Could you write a for loop that never terminates?
211
9
250
93,687
Assume that you couldn't solve a bug and 3 days have passed. What would you do? 1. Google it harder. Don't give up. 2. Ask AI. 3. Ask a team lead. 4. Create a Stack Overflow question. 5. Cry in silence. 6. Other.
270
12
246
43,565
Alternative solution: This ensures that you don't get surprised by unordered way of dictionaries. "Unordered: The order of elements in a dictionary is not guaranteed. The elements are stored in a way that optimizes lookup performance, rather than maintaining a specific order."
6
5
148
101,377
Replying to @KostjaPalovic
Age of empires 2 was a great game.
1
156
18,546
How would you consider an employee who posts on social media during working hours?
215
7
137
87,638
If a terrible production bug happens, who do you think should be the most responsible person and should be judged? 1. Developer who codes. 2. Code reviewer. 3. Tester.
258
9
137
38,378
Here is a poorly written code. How would you refactor this?
64
5
125
20,443
Replying to @webtekno
Burada çalışıp vergi verse daha mantıklı değil mi? Gerçekçi değil.
2
112
10,668
In this implementation, the User class is responsible for both managing user data (name, email, phone number) and sending emails to users. However, this violates the Single Responsibility Principle because the class has more than one reason to change. How do you fix this issue?
93
4
115
89,685
Replying to @ujjwalscript
It would be too bright to see the screen. Plus battery issues.
1
96
6,922
That's a good solution.
11
1
89
57,429
Assume that you are giving E grade from now on. Above 25 is E grade. How did your code change? Mine? Not much.
11
1
82
85,197
I saw a post like this. I couldn't repost it because timeline is changing fast. It is real, I didn't get this? Why netflix why?
42
3
67
17,943
I will use polymorphism to solve this issue. Here is a solution.
8
3
69
7,465
Replying to @alvinfoo
What happens if you need glasses in the first place? Do you put these glasses on top of the others?
9
1
59
48,353
Replying to @GM_Gabuzyan
Qg2+, if rook takes, Nh3# if queen takes Ne2#
1
55
3,220
Replying to @zeytinsever35
sadece yardımcı olmaya çalışmıştım. yazık.
2
49
7,392
Got my blue checkmark. Yeeey!
18
48
2,374
This is a program which calculates factorial for a big number such as 100.000. It creates a stackoverflow. It is a bad code. How to fix this code that way it will give a result for 100.000
23
2
41
8,383
Replying to @WillemJaap_
I hate else statements. There are rarely necessary.
5
44
37,005
In this scenario, the order processing logic is determined based on the order type using if-else if-else statements. This approach violates the open-closed principle, as adding a new order type requires modifying the existing code. How to fix this?
15
4
49
10,442
En passant. The opponent can only capture with an adjacent pawn.
1
42
12,632
Replying to @pallnandi
Telling mistakes publicly is the mistake. Don't do it. Share your mistakes with loved ones.
3
42
1,678
What would it be like if the Joker were a developer?
38
1
39
6,348
disabling notifications
34
5,983
Replying to @TheJackForge
So, are you suggesting that your environment is too toxic for a nice guy to fit in?
1
36
7,030
Replying to @Collin2997
Like this? I think there is a better way to solve the issue but this is a huge improvement.
3
36
14,757
Replying to @ZibbitVideos
Ne6 wins the queen.
35
3,220
Replying to @webtekno
paranın sahipleri de buna izin verecek, komik.
38
8,237
Marriage is great if you find the right person. I love my wife.
10
33
961
Replying to @webtekno
Bence yine de başarılı bir çalışma. Ne yaptı incelemek lazım detay var mı?
4
27
20,131
Hello there. Dictionary solution was wrong. It attracted more people so I didn't delete it. Sorry.
5
31
31,344
Considering both anemic domain model antipattern and Single Responsiblity Principle, this is the solution. What do you think?
16
33
6,355
Replying to @hernandoabella
No, they are not. In the worst-case scenario, AI works with regex.
5
1
25
5,571
Here is a poorly designed command pattern. How to fix this?
13
3
27
5,320
You need to omit the middle condition to do this. After i reaches int.MaxValue, it will overflow but it will not terminate. It is an infinite loop.
5
2
31
5,287
Assume that you are provided with following calculator code. It does the basic operations. But it is pretty wrong. How can this code be fixed?
4
4
28
3,177
AI can beat Magnus Carslen easily. Did AI replaced chess players? No. AI is just a tool for chess players to get better. AI will exceed limits of humans in software engineering too but can't replace them.
5
5
30
2,352
If you are a junior software developer and join a startup, you will face many responsibilities, such as deploying directly to the production environment. If you join a large company, you will probably start with tasks like working on Excel or other entry-level assignments. So, what I suggest is to start at a startup and later move to bigger companies.
7
26
1,379
Replying to @Furukoogazoz
Ciddi misin 2005'ten bu yana çalışıyor muydu?
1
23
10,198
Replying to @waq_r
Oh, they revealed the biggest scam among developers, what will we do now 😀
1
22
8,295
Here is an example visitor pattern. Explanations: 1. Interfaces and Classes: IEmployee: This interface represents the element interface for different types of employees. It declares a method Accept(IVisitor visitor) which allows visitors to visit employees. Developer and Manager: These are concrete elements that implement the IEmployee interface. They represent different types of employees with properties like Name (employee's name) and VacationDays (number of vacation days). IVisitor: This interface declares methods for visiting different types of employees (Visit(Developer developer) and Visit(Manager manager)). VacationCalculator: This is a concrete visitor that implements the IVisitor interface. It calculates vacation days for employees based on their roles. 2. Visitor Implementation: VacationCalculator implements the logic for calculating vacation days for developers and managers. Developers get 2 extra vacation days, while managers get 3 extra vacation days. 3.Object Structure: EmployeeSystem represents the object structure that holds a collection of employees. It provides methods to add employees (AddEmployee) and calculate vacation days for all employees (CalculateVacationDays). 4.Main Method: In the Main method: An EmployeeSystem object is created. Instances of Developer and Manager are created and added to the EmployeeSystem. An instance of VacationCalculator visitor is created. CalculateVacationDays method of EmployeeSystem is called with the VacationCalculator visitor, which calculates vacation days for each employee based on their roles. 5. Output: The program outputs the process of calculating vacation days for each employee, along with their updated vacation days.
5
22
1,298
Is singleton an anti-pattern? Do we need singletons?Here is an example singleton.
8
22
1,631
Replying to @HaberKupur
böyle pozitif videolar çok iyi oluyor :)
22
3,995
I would refactor with switch expression. Creating a function for each case. I would use a guard clause to get rid of else statement. I would use a tryparse method to avoid exceptions.
11
19
2,348
This code creates a race condition. Don't do this in reality. 1. We initialize a shared integer variable sharedCounter to 0. 2. We create an array of tasks, each representing a thread that will increment sharedCounter. 3. Inside each task, we increment sharedCounter. However, since this operation is not synchronized, it can lead to a race condition. 4. We wait for all tasks to complete using Task.WaitAll. 5. Finally, we display the final value of sharedCounter to see if a race condition occurred. 6. I added a do while loop so you can see it every time you run the code.
12
21
4,068
Replying to @peteohanlon
If I have asked for while(true); I would get 5 views.
3
1
18
2,354
Hello there. 2.5 M views for the main post. Thank you all, but please let it go?
4
19
13,372
Do you want tech related content in your timeline? Go to my profile page and follow the list of people that I follow. These are 99% developers, software engineers and tech related people. Their content is in English and Turkish. Thank you guys. You are creating an amazing feed.
1
2
21
2,260
Replying to @donbells
You are not serious, right?
1
18
861
Replying to @ChaoticDeeds
I believe, if a developer is an absolute beginner, then more explanation will help. They may even don't know what leetcode is. This is the url guys : leetcode.com/
2
3
19
5,332
Replying to @yanolacagidi
AI tool kullanıyor musun diye sorup yüzleşseniz daha iyi değil miydi?
1
17
12,002
Replying to @thornminis
And you will do all the work yourself, because you are the only one left?
2
17
1,534
If a cat doesn't like you, they usually ignore you like this one. They are smart. Stray cat number 3.
I am walking outside and capturing some good moments. This is another stray cat. It is lovely.
7
16
1,138
This code is bad. Don't invent the wheel. How to fix this code?
7
17
2,679
Hello world from Grok! I am a premium subscriber now.
2
17
1,454
Replying to @PuCCaa
Tek tuşla yemeğin en hassına erişebildiğimiz şu dönemde hala 'erkek' evine bakmazsa bla bla bla. Evliliğin yıkılması bile 'erkeğinin' gözünün açılmasına bağlanıyor. Az kaldı 'kadınları' sadece damızlık olarak kullanacağız, bunlar onun ayak sesleri. Böyle okuyunca nasıl bir his?
18
Replying to @LuckyGoodrich
That's a great solution. Thanks.
16
20,676
Do you shut down your laptops every day, or do you leave them on for weeks? If you don’t shut them down daily, it could lead to the mainboard burning out.
14
17
1,686
I decided to limit my X usage to 1 hour daily. I removed the app from my phone. I will use it from the web. Lately it was out of control. To manage this, i probably need to schedule my posts.
3
15
499
Are you searching for a developer job? DM me. I will try to help you. I am currently working in a company called Veripark. The company offers remote jobs around the globe. If you can't DM me, you can write a comment to this post.
7
1
17
1,290
Replying to @KevinNaughtonJr
I prefer using c# but java is a great language.
1
16
4,398
Do you set multiple alarms to wake up, or can you wake up with just one alarm?
10
15
893
Being a "reply guy" is the best strategy if you are a premium member to get impressions. Waiting for my blue check mark to become a reply guy. If you don't agree with me, please comment below.
13
1
17
2,358
Which platform do you prefer to improve your coding skills, learn new subjects? Udemy? Pluralsight? Youtube? Or another platform?
17
14
3,704
Today was a different day in case of follower gains. Thanks, all of you. I think, this is because I changed my AI generated picture to current one. People just want to see real people.
2
15
1,872
Replying to @a11smiles
This is good advice, thanks: "Use enum for shape type, not a string."
1
15
5,024
Assume that you have a microservices architecture in your project. You need a DTO, but it is in another API project. What will you do? 1. Add a reference to the other API. 2. Create a duplicate of that DTO in your project.
11
1
15
1,617
Happy spring to all! Here's a beautiful photo of wisteria to brighten your day.
3
16
1,502
I like this approach, thanks.
13
1,657
If you can't solve a bug, what do you do first? 1. More debugging 2. More Googling 3. Ask an AI 4. Ask a more senior developer 5. Open a Stack Overflow post 6. Ask people on X
12
14
1,063
What if Goku from Dragon Ball were a developer?
2
1
14
856
How many hours do you work in your jobs in a week? Me: 40 hours per week.
7
12
1,195
Replying to @CoderBora
That's a good idea Bora, but I think Strategy Pattern is such a complex way to solve this. Isn't this like overengineering? If I am wrong please correct me.
1
12
24,998
You need to suffer if you want to achieve something. No pain, no gain.
1
2
15
756
Replying to @zeytinsever35
yardımcı olabilirim chatgptye sorunuz neydi? 4o erişimim var.
1
11
17,150
Replying to @atademirer
F1 çok iyi bir koltuk mu F3 e göre ne farkı var?
33
10
46,039
This is a spagetti code. You can refactor it by breaking down the functionality into smaller, well-named functions, improving error handling, and adhering to best practices. How do you do it?
6
14
1,759
If you’re playing online games (except for chess), you’re wasting time. Gaming doesn’t give you anything in return; it only takes your precious time and turns it into entertainment, which ultimately doesn’t make sense.
13
14
1,475
Today, I detected a bug that is quite mysterious. If you can't detect a bug, add plenty of loggers to the relevant places.
12
606
Something is wrong with one of the following programming languages. Which one is it and why? 1. C# 2. Java 3. HTML 4. Javascript 5. Python 6. Brainfuck
9
14
998
You get this statistics if you are a premium member. I was clicking "beta" statistics and redirecting to home page before. Beta statistics are for premium members only. By the way, what do you think about my current results? This is because of that viral post.
3
11
775
I would like to share my favourite 5 accounts. I don't know them personally. A thread. 1. @RyanEls4 He creates good memes related to programming. I really enjoy his memes.
5
12
692
Really pretty cat. Stray cat number 10.
Another lovely cat waiting in front of a restaurant. Stray cat number 9.
3
13
1,032
Lovely cat in catception, stray cat number 7
Sleeping cat, so cute. There are a lot of cats like this one. Stray cat number 6
6
14
1,048
Who has this book besides me?
3
1
13
615
Is it better to use firstName and lastName in the UI or just fullName as one field?
10
13
1,111
Replying to @zeyngibii
Boğaz ağrısı ve grip için bazı doğal ve tıbbi çözümler: Doğal Yöntemler: Tuzlu su gargarası: Ilık suya bir çay kaşığı tuz ekleyip gargara yapabilirsiniz. Boğazdaki iltihabı azaltır. Bal ve limon: Ilık suya bal ve limon ekleyip içmek boğazınızı rahatlatır ve öksürüğe iyi gelir. Zencefil çayı: Zencefil, iltihap önleyici özellikleriyle boğaz ağrısını hafifletebilir. Adaçayı: Boğazı yumuşatır ve rahatlatır. Günde birkaç defa içebilirsiniz. Buhar soluma: Kaynamış suyun buharını solumak, boğazınızı nemlendirir ve rahatlatır. Tıbbi Yöntemler: Ağrı kesiciler: Parasetamol veya ibuprofen gibi ilaçlar ağrıyı hafifletebilir ve ateşi düşürebilir. Pastiller: Boğaz pastilleri, geçici bir rahatlama sağlayabilir. Bol sıvı tüketimi: Su, bitki çayları ve tavuk suyu çorbası boğazınızı yumuşatır ve vücudunuzun iyileşme sürecini hızlandırır. Dinlenme: Vücudun gripten iyileşmesi için dinlenmek çok önemlidir. Eğer semptomlar uzun süre devam ederse ya da kötüleşirse bir doktora danışman iyi olur. Allah şifa versin!
12
2,306
Can you solve this easy interview question? It is in top interview 150 from leetcode.
5
10
1,270
What do you think is wrong with this code? (I couldn't take a screenshot because Udemy doesn't allow it, so I used my phone.)
5
11
956
Assume that you are a 10x developer. This means you are probably below average when it comes to life-related issues. What I mean is this: If you are great in one field, then you are likely less proficient in most other fields.
6
1
12
846