+ 18

Codes on Sololearn.

Do you like fancy codes or codes that are legible? Sometimes you only get one of those in the same code. I mean, I now saw a few codes that were made difficult to read with using dozens of custom functions from external scripts. There is nothing wrong about showing off! But when you do, why also make it unlegible on purpose? Sololearn is a platform where people come to learn about coding. My opinion is that people should be able to read the code and also be able to understand it.

14th May 2017, 1:35 PM
Tim G
Tim G - avatar
18 Answers
+ 13
It's a beginner app and it doesn't have a course about clean code. And coding on the mobile is a pain...
14th May 2017, 2:13 PM
Tashi N
Tashi N - avatar
+ 12
Well, I don't write dirty code because I want to prevent stealing ^^ I just write something, run it and don't ever look at it again ^^ It's not that I plan to extend the code to make a big project of it, that isn't possible here anyway. So I just write quick and dirty and don't refactor it.
14th May 2017, 2:49 PM
Tashi N
Tashi N - avatar
+ 12
@Tim G. Okay... compared to your example, my code is clean :D
14th May 2017, 2:51 PM
Tashi N
Tashi N - avatar
+ 12
@Tim G. Depends on the purpose... And if the code isn't good (or doesn't even compile) you have the option to downvote it. You can't force everyone (the pros) here to write good code. Nobody gets paid for it.
14th May 2017, 2:57 PM
Tashi N
Tashi N - avatar
+ 11
without proper planning it's very hard to keep a code readable (and boy do some of my codes lack planning xD ) it's always nice to see a well commented and readable code (meaningful variable names, correct re-use, indentations, breaking logic into functions, etc...) got to remember that many sololearners are new to programming, and constantly developing their programming habits. as for your question, i don't mind reading a fancy code even if there's a bit of a mess if anything, it could help you as a programmer to see a different approach/way of thinking (whether it's good or bad, it's still might give some experience)
14th May 2017, 2:05 PM
Burey
Burey - avatar
+ 11
@Burey, what you say is definetly​ right! I don't even mean bad planning. What I mean is, why would someone make it unreadable on purpose?(front end) Edit: @tashi. I don't mean beginners. I want to know if they do it because they are afraid of getting their code stolen.
14th May 2017, 2:14 PM
Tim G
Tim G - avatar
+ 11
@Burey I know that too. same with my tetris... :P This is what i mean for example: jhag(oab, 233, [true, true, false]); kab = { aaib:91, jah:81}; aaa(); I don't mean beginners!
14th May 2017, 2:46 PM
Tim G
Tim G - avatar
+ 11
@Tashi, so you would say that a good outcome matters more than how the code looks? (Here on the playground)
14th May 2017, 2:51 PM
Tim G
Tim G - avatar
+ 10
@Tashi. Just exchanging different views(: Everyone can do whatever they want.
14th May 2017, 3:00 PM
Tim G
Tim G - avatar
+ 10
@Tashi.Changed it.
14th May 2017, 3:03 PM
Tim G
Tim G - avatar
+ 10
@Tashi. The thing is, when they want to work with a team, bad written code won't be good. It's always good to code clean even if it is just for the playground. Again, no one is forced to^^
14th May 2017, 3:08 PM
Tim G
Tim G - avatar
+ 9
Exchange of views? Quite sure you mean that.
14th May 2017, 3:02 PM
Tashi N
Tashi N - avatar
+ 9
:)
14th May 2017, 3:03 PM
Tashi N
Tashi N - avatar
+ 9
If they are professionals they are forced to write clean code anyway (code reviews...). When they go on holidays and someone else has to fix a bug in the mess they made... well, team members will absolutely not be amused then.
14th May 2017, 3:11 PM
Tashi N
Tashi N - avatar
+ 8
@Tim i can only speak on my behalf on this many codes i written here were ideas that grew slowly, with no initial planning, just an idea that slowly rolled into something. so the proccess was simply: idea -> it's not working -> fix it somehow -> it works but looks terrible -> mehhh -> next! it's not the case for all of course, some ideas were planned a bit more, but still suffer from minor inefficency here or there that i will fix some day (yeah right... xD )
14th May 2017, 2:42 PM
Burey
Burey - avatar
+ 8
@Tim where did you see such code xD
14th May 2017, 2:51 PM
Burey
Burey - avatar
+ 6
especially on a 500+ lines web code @Tashi ~_~
14th May 2017, 2:14 PM
Burey
Burey - avatar