Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

C# C# Basics C# Syntax Variables

Rachel Heneault
PLUS
Rachel Heneault
Courses Plus Student 12,155 Points

dom and quotes

I want to enhance my programming / dev skills and actually go beyond web. So I started researching c#. I LOVE that it has parallels with javascript! But I have some questions about the language / syntax and usage. I like writing my javascript with single quotes and when I reference html I use double quotes. Can you use single quotes when programming c#? Can you use c# for web dev, and manipulate dom elements? Just wondering if I could develop web applications that us c# and manipulate / add to the dom?

2 Answers

Steven Parker
Steven Parker
229,644 Points

In C#, quote types have special meanings and are not interchangeable. Double quotes are used for strings (like "this example"), but single quotes (apostrophes) are only for individual characters (like 'c' or 'x').

And JavaScript is the language for DOM manipulation because it's built into every browser. But C# is a good language for back-end development.