Post number #594062, ID: 8a6940
|
Hey, I'm the guy from >>thread/593580, currently writing an add-on to the guide that tells newbies how to write clean and well-structured code.
I'm hitting a wall, so I'm asking you, the good people of /tech/, what does good code look like?
For me as long as it a) works, b) readable, c) not a dumb resource hog, it's good.
Post number #594063, ID: 8a6940
|
Whoops messed up the link. >>tech/thread/593580
Post number #594064, ID: 8a6940
|
lol ok I messed up again https://boards.dangeru.us/tech/thread/593580
Here's the guide in question: https://nononsensebasicjs.rtfd.io/
Post number #594137, ID: 7adf43
|
https://en.wikipedia.org/wiki/Indentation_style#K&R_style speaks for itself
Post number #594160, ID: b99c23
|
It depends on many things. Usually, it's a maintainable code. But there are various visions. For example, in Python the idea is that code should be readable, even if it's more tedious. In other languages, maintainability is about comments, or code structure before the rest. Also, code needs to be adapted to the language, and a good C code will be crap if translated directly into Python for example. So I'd say good code is adapted to the language, and maintainable,whatever it means.
Post number #594161, ID: 63c879
|
Well first of all. Organization. When I make my websites I put a few enters between the diffrent sets of code. Other then that idk.
>1 error bad, no error 250 warning COMPILE
Post number #594171, ID: 8cdbfd
|
Comments for everything that can't be understood from code, or sections that are critical for code that is far away from said section. If your code tells it, comments shouldn't repeat. Optimization always comes last, so code should be readable at first.
It really depends on the scale you will cooperate at, and the overall scale of the project, what level of abstraction we're at, if the code actually has to be maintained at all...
In the end, there's no universally great code.
Post number #594184, ID: 7cee5a
|
Comments, understandable variable names, indentation and optimization etc. etc.
Post number #594186, ID: ab3be7
|
If it works and is easy to maintain it's good enough There are factors that turn good enough into excellent but good enough is what you should do first and foremost, all else can be enhanced later
Post number #594314, ID: 6f3eda
|
When only the original coder understands what thr fuck it does. P.S. Short "if"
Post number #594511, ID: 953154
|
^ this is called job security
Post number #594517, ID: 4f8006
|
>>594511 nope, it's called old fart mentality The collaborative approach not only helps others but it also makes you get a good reputation and gives you better chances of getting a promotion or a new job, unless you work at a shitty mega corporation such as IBM, then you MUST male cryptic code to protect your position
Post number #594581, ID: ca06b1
|
>>594511 We have a policy where if you are basically the only one who can maintain your own code, you get fired. Now good luck securing something. That's quite a debatable policy, but it works. We've yet to fire someone.
Post number #594583, ID: ab3be7
|
>>594581 in my workplace we have something a little less radical, no code goes to production without passing on the code review by at least two peers, it works pretty well
Post number #594585, ID: ca06b1
|
>>594583 That's probably why we haven't fired anyone yet... no one really works alone.
Post number #594608, ID: 6c461d
|
>>594517 wait you mean you dont comment your code?
Post number #594609, ID: 8b388f
|
>>594608 I do comment my code, but comments aren't always enough, gotta keep that code nice and understandable too
Post number #594627, ID: df5490
|
Readable code that can be parsed by a human easily, inline comments about what particular blocks of code are are doing, explainations for anything that looks like garbage code, and documentation.
Good code vs bad code is generally a non-technical issue, Unity3D (for example) is a good game engine plagued by incomplete documentation.
Total number of posts: 21,
last modified on:
Tue Jan 1 00:00:00 1567796357
| Hey, I'm the guy from >>thread/593580, currently writing an add-on to the guide that tells newbies how to write clean and well-structured code.
I'm hitting a wall, so I'm asking you, the good people of /tech/, what does good code look like?
For me as long as it a) works, b) readable, c) not a dumb resource hog, it's good.