Thankful for alot of things

I have solved many tasks on codewars so far, in more lines of code than almost half of other coders, but i feel like i can solve 40 to 50% of the tasks that i accept and get into.
Happy eid al_fitr and happy end of ramadan, thank you.

Sometimes, more is better. Concise code is fine, but overly concise code can be harder to read. Less code is not better, it’s just less code.

People read code, computers just run it. Make the code legible and maintainable, then optimize it without sacrificing the former two.

2 Likes

A valid solution is a valid solution whether it takes 2 or 3 lines or 15 lines.

I think the getting the concepts down and really understanding the problem and how to solve it is way more valuable than # of lines. You might later find out there was a method to do something in less lines which you can now use.

You can always streamline and refactor the code as your knowledge, understanding and exposure continues to grow. :+1:

1 Like

i just read this quote on the fcc website, from those ones you see before getting on your next challenge?, and it says that lazy programmers are better, or smarter or something, so i felt bad everytime i found out there is a solution in less lines of code, but you have a point, it should be readable by others if you are working in teams.
thank you.

1 Like

Not a programmer by trade but have read a lot about it and have interfaced with devs in past jobs (from an IT guy perspective)… but to your point, that’s one reason corporate likes things like Java?

To enforce standards/certain way of writing code in a big project with bigger teams?.. Not necessarily having to do with # of lines, but adherence to some company standard way of doing things?

For personal projects, my code is probably laughable to a professional, but it works and makes sense to me. That kind of thing?

(mostly rhetorical questions)

That’s my understanding of it anyways.

i like how i used a question mark then you used like 3 times in response.
lol

lol… well I used it as a punctuation device for effect as it was mostly a rhetorical questions (a question not really needing an answer, but for effect) :smiley:

Lazy as in go over the fence instead of around it. Take the shortest path of least resistance, don’t make it harder than it has to be, and don’t reinvent the wheel.

And yourself, in 6 months. Never underestimate your ability to forget how your own code works.


My point is, don’t get so caught up in the execution part of the code (i.e. optimization), or its length (i.e. brevity), to the point where you start to deprioritize the overall legibility of the code.

A lot of time is spent reading code. The time spent reading code is time not used for writing code.

3 Likes

so out of 100+ tests on my code , i got like 97 passed, that’s good right? i’m sure if i look at others’ solutions i will find less lines and 100% passed test.
i mean in the fcc progress i have passed es5, es6, regex and debugging so far, this is my knowledge to date that i use to solve these problems.
i’m loving it any way.

Fewer lines is not a useful measure of code quality. The job of your code is to meet the requirements and pass the tests. The second job of the cde is to be clear and readable so future changes are easier.

Fewer lines is not a useful requirement unless you are hand writing assembly for a piece of hardware with extremely limited space to store the compiled code. Shorter is just not a useful metric.

2 Likes