Frequently Asked Questions
This is a list of some of the questions we get in Discord most often. Before posting your own question, look through this list and see if there’s already an answer for it here.
How do I make the code I post on Discord look good?
For inline code, surround the code with a single backtick mark (
`) like this:
For a code block, use the following:
```cs int x = 3; ```
The triple backticks make it a code block.
cs gives it C# syntax highlighting.
csharp also works, and there are other labels you can use for other languages, though we mostly use C#.)
What if my code is too big to fit in a single message?
You’ve got some options:
- Put it in a couple of messages. Only do this if you’re just a bit over the limit. Don’t flood chat with sixty messages to contain your entire codebase.
- Narrow it down. Usually, if you want to show something off or want feedback, you don’t need your whole program, just a small slice. Just share only the parts that are relevant to your question or that you want feedback on.
- Upload a file to Discord. Discord supports file uploads. That could be a whole .cs file or it could even be a .zip containing your whole solution. But fair warning: most people won’t download a ZIP file, unpack it, and review all the files in it. Even downloading a single .cs file is a relatively high burden, and not everybody will open it. On most days, you’re better off with Option #2.
- Upload the code to some other file sharing site. There’s a lot of them out there. We prefer ones where we can click the link and see the code immediately, rather than downloads from a site we’re not familiar with.
- GitHub. If you know Git, you can put your solutions on GitHub. A link to a folder in GitHub is quite convenient. We generally trust GitHub, it gives syntax highlighting, and a bunch of other nice features. If you don’t know Git or version control, use one of the other options. But some day, it will be worth your time to get comfortable with Git or some other distributed version control system.
Is it better to share a screenshot of my code or copy/paste the text itself?
We prefer text to pictures. The exception is if you need the surrounding context of what’s going on in the IDE to understand what is happening. Text lets us copy the code and run it ourselves without retyping it all.
How different is 5th Edition from 4th?
What’s up with all of the samples on the Internet always having
static void Main?
That’s the traditional approach. Modern C# doesn’t require that anymore. C# is evolving as a language extremely fast, which is surprising, given its age.
This article covers some of the ways C# has been changing, but it includes not needing to write out
class Program and
public static void Main(string args).
The book does cover that style, though, in Level 33 (in both 4th and 5th Editions).
Is there a place I can see solutions to all the challenges?
Yes, it is right here.
What guidelines are there for asking questions in Discord?
This blog post describes what you can do to be the most effective at asking questions on Discord.