Recommended way to answer a coding question? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

Recommended way to answer a coding question?

I'm pretty new here and I haven't found any 'howto' on this. Is there any recommended way (best practise) to answer programming related questions here in the discussion forum? Pasting the code directly has the advantage of making it visible immediately. The downside is, at least to me, that - it looks incredibly awful with a proportional font - has no syntax highlighting - cannot be executed and/or modified directly Consequently, I'd rather prefer to link to code examples in the code playground. The downside here obviously is that it requires an additional step/click to see the answer. What's the preference of the regulars concerning theses two options?

13th Apr 2017, 4:17 PM
Klaus-Dieter Warzecha
Klaus-Dieter Warzecha - avatar
5 Answers
+ 6
I think that linking is better. Linking to the code enables syntax highlighting as you have mentioned. Also, linking enables anyone reading the code to read any additional comments already associated with that code. For example, link: https://code.sololearn.com/c0lpZaYGnfZQ/?ref=app
13th Apr 2017, 4:37 PM
Bryan Boyett
Bryan Boyett - avatar
+ 12
I type in short code snippets here and write codes and link to it, if it is useful to explain things that take more lines. There are no rules how long a code snippet should be to be posted as an answer directly without a link to a code at the playground. I've seen walls of code here in Q&A in answers AND in questions ^^ I'm sure you will do the right things, don't be afraid to make mistakes here. This is not stackoverflow ^^
13th Apr 2017, 4:42 PM
Tashi N
Tashi N - avatar
+ 6
@Klaus-Dieter Regarding formalities in the Q&A section, very few people here are as nitpicky as the computers which run our code. In my observations people here are more focused on encouraging anyone with can do attitude to take their programming to the next step. Furthermore, there are plenty of non-native English speakers posting questions which further distracts from criticizing the formalities of a Q&A discussion. A key thing to remember is that we're all on the same team!
13th Apr 2017, 5:31 PM
Bryan Boyett
Bryan Boyett - avatar
+ 5
Great point Tashi, I agree that short code snippets could easily be written inside Q&A discussions and longer codes could be linked to. Although, just like you said you could write long codes inside the Q&A and it wouldn't be a problem because everyone in the Sololearn community seems to be friendly and genuinely helpful!
13th Apr 2017, 4:51 PM
Bryan Boyett
Bryan Boyett - avatar
+ 2
I hope that misusing the answer field for comments doesn't get me in the clink ;-) @Bryan Boyett I couldn't agree more! Code is pretty difficult to read with this font. Honestly, I had a hard time in my first challenge just due to that. Well, I guess I have to get used to it. Others also did... @Tashi N Thanks for your encouraging welcome :) I'm not so much afraid of SO and even less so when it comes to their sister site on chemistry.
13th Apr 2017, 4:53 PM
Klaus-Dieter Warzecha
Klaus-Dieter Warzecha - avatar