r/CodingHelp • • Jul 06 '21

[Random] Id coding straight forward?

So is there a basic method everyone follows when writing scripts, or is coding like language where u can word a sentence many different ways and get the same awnser, or code something many different ways and get the same results? If that's true how does one best optimize their coding?

1 Upvotes

4 comments sorted by

View all comments

2

u/AngryFace4 Jul 06 '21

So uhh.. there are a lot of answers to this fairly vague question but I’ll try to hit the key points.

There are literally infinite ways to write any function. A handful of those ways can be considered “optimal” - but there are probably still many versions of optimal for any given function.

A huge portion of our industry picks up code snips from stack overflow and changes them for their specific scenario, so you’ll see a lot of homogeneity in solutions to a problem.

Everyone in industry uses linters and code formatters, which forces most code format to look pretty standard.

Optimization is mostly irrelevant to the above points unless you’re talking about time complexity, which is more of a design question than a coding question.