this post was submitted on 29 Aug 2023
17 points (94.7% liked)

General Programming Discussion

7702 readers
10 users here now

A general programming discussion community.

Rules:

  1. Be civil.
  2. Please start discussions that spark conversation

Other communities

Systems

Functional Programming

Also related

founded 5 years ago
MODERATORS
 

I am beginner who thought before doing the String Methods section of the course "You know what, let's test my skills". And boy my skills were tested. After I completed the challenge my jaw dropped, with the solution.

Had/Have this happened to y'all. Where you make something complicated and found out that there was a simple solution?

Solution

My Code

you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 6 points 1 year ago (4 children)

All the time and I've been programming professionally for 10+ years.

You'll always find a better way to do something, however, there's nothing wrong with what you initially came up with as it's easy enough to understand because you've named your variables well and your logic is easy to follow along with. I would say that is far more important than coming up with technically clever solution that may be harder for someone else to understand!

[–] [email protected] 3 points 1 year ago (3 children)

so technically clever solution < long solution with good variable names?

[–] [email protected] 4 points 1 year ago (2 children)

From a maintainability standpoint, absolutely. Computers have gotten fast enough to let programmers optimize for developer time instead

[–] [email protected] 2 points 1 year ago (1 children)

Yep, this. The code we write is eventually used or extended by other developers. Or, more commonly, yourself after not touching it for 6 to 12 months, by which point you'll have forgotten all about your clever tricks. (Speaking from experience of course 😉)

[–] [email protected] 1 points 1 year ago

Maaan, I wanna be developer soo bad but where I live they want full-stack developers, not frontend developers.

I know why they want full-stack developers, but why hire a front end developer and back end developer when you can hire full stack developer.

The closest thing to a back end development is a DevOps Engineer.