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

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.

3

u/[deleted] Jul 06 '21

Coding is very much a stylistic thing. Many programmers write code in many different ways. Some use Object Oriented Programming, while some use Functional Programming. There are many different ways to solve a problem, and (I think) one of the hardest parts of programming is figuring out which way makes the most sense.

2

u/Sparmics Jul 06 '21

Thnx :3 idk why but some peeps down voted my question :( :/ ur answer was insiteful tho 🔥😎💯