views:

664

answers:

10

Or plain old C. I have a sneaking suspicion that it may be more efficient in terms of resources. I know nothing of C or C#, this may be a completely stupid question but I've always wanted to get into programming proper.

Does anyone here code websites in C? Does anyone know of any tutorials or books on the subject?

UPDATE: I'm a web designer/developer at the moment. HTML/CSS/Jacvascript/jQuery PHP/MySQL. I have about ten years experience with web development.

+1  A: 

The benefit of C# over C will be the ASP.NET framework when it comes to building web sites.

This framework will provide all the necessary runtime worker processes and server side context objects needed for handling page requests and responses.

Andy Rose
+15  A: 

You should learn HTML, JavaScript and CSS first,

then you should choose you platform to build your websites.

C# is good for ASP.NET development. but, IMHO first learn HTML then learn C# and .NET framework. until then it will be very easy to learn and understand ASP.NET.

Resources :

For Web Development (skip as an experienced developer) :

http://www.w3schools.com/ is a very good resource for beginning Web Development.

For C# :

I recommend you to buy a good reference book, and here are some questions on topic : http://stackoverflow.com/questions/46048/what-is-the-best-book-to-learn-c

http://stackoverflow.com/questions/477748/what-are-the-best-c-net-books

For starting ASP.NET Web Development :

ASP.NET QuickStart Tutorials is good for beginning ASP.NET with C# or VB.NET

Canavar
even though I know the HTML/CSS stuff, I accepted this answer because I think it is of benefit to more people.
gargantaun
+1 web developers need to know their HTML/CSS first before learning a web framework. Also you need to know javascript if you want to do some AJAX (and JSON).
Spoike
+1  A: 

If the question is between C and C# and their suitability for web development, I don't think it's unreasonable to say that C# would be the clear winner.

This isn't to say that there aren't uses for C in web development or situations where C is most appropriate, or even that you shouldn't learn C (you probably should).

Just that C# is a more appropriate language for general web development, in the sense that a higher-level language with pre-existing decent web framework is.

thomasrutter
+1  A: 

Yes Learn C#, it has lots of "stuff" (i.e. pre rolled, pre packaged libraries like ADO.Net and ASP.Net) that will get you up and running very quickly compared to C).

There really is no contest, C is a very poor language to learn how to write web sites with (web sites didn't exist when c was defined), C# was defined with the internet and web sites in mind.

Binary Worrier
+1  A: 

C is not a good language for web development.

I wouldn't use C for any real project unless I have to talk directly to the hardware or this is some strange environment with no other compilers available.

Nir
+4  A: 

I would definitely go for C# over C for web site development:

  • There are far more web frameworks designed for .NET than for C. Obviously ASP.NET is the biggest one, but there are others as well.
  • There's more experience of web design using C# as it's so much more widely used for web development than C.
  • I personally find C# a far more productive language than C for various reasons. That doesn't make it universally applicable, but for web development I think you'll go far faster with C# than C.

Personally I wouldn't learn C# via web development though - I'd start with simple console apps, learn the basics of the language and the core .NET framework, and then start looking at a web framework.

Jon Skeet
Wondering what your reasoning behind recommending consoles before web apps is? Personally I recommend the other way around on the grounds that delivery to a browser has "fewer" complications than working with the OS, but thinking about it that's probably just my personal background bias.
annakata
Assuming you know the ins and outs of HTML (and maybe CSS too) I would agree with annakata. If not, console apps will take away one source of complexity.
borisCallens
Console apps have almost no "baggage". A complete console app can be very, *very* short - much shorter than a complete web app. You can see *all* of the code, and there's no "magic" to do with postbacks, server-side translations of web controls into HTML etc.
Jon Skeet
Obviously it's harder to get *pretty* results, but when your focus is "can I write code to sort a list of strings by length" (for example) the appearance is irrelevant.
Jon Skeet
Furthermore, you can build and run a console app pretty much anywhere. If you've got the framework (or Mono) installed, you're ready to go. Compile in one line, run in another. Very simple. No need for a web server or cassini, firing up a browser etc.
Jon Skeet
+1  A: 

A very important technonolgy to understand and often overlooked by web developers is the HTTP protocol itself. When learning to "Web program" understanding this protocol and how it impacts design/performance decisions is vital.

A long with HTML, CSS and Javascript this really forms the universal set of fundementals. Then move of to specifics such as which server framework and language to use.

AnthonyWJones
+1  A: 

to learn C#, knowing C is a of great help, they virtually use the same notation and they even look alike. As for what to use for Web Development, i believe C# is more appropriate, especially if you will go the Microsoft Way, because MS is trying to push C# on the programmers, thus, many tutorials, projects, and resources are available and free out there. Don't forget about VB.net, it is very easy, and basically you can do with VB.net what ever you can do with C#, so you might want to take a look on VB.net and learn it, it is much much easier than C# and a great start for a junior web developer...

Again, if you wanna go the MS way, try THIS, all resources are available in both C# and VB.net

I hope that helped answering your question.

Maen
I have to disagree with you about VB.net being easier than C#. I think this will largely depend on his background and what else he has done, but I find C# much easier to use (less cumbersome). That being said the first language I learned was C.
Caleb Vear
+1  A: 

I started with HTML and CSS, after that I choose PHP, because of the many tutorials and documentations.

When I started at my current education I began to use C# and ASP.NET which blew my mind, and still does to day.

The time you safe is beyond any other language that I've expirenced. So I would recommend C# and ASP.NET if you want to develop web applications.

Eibx
+1  A: 

It's not so much about whether you would use C# for web development, but rather, if you were using C#, you'd be using the .NET Framework, and from a web perspective, you'd be using ASP.NET.

You could also use ASP.NET, and all of the features of the .NET Framework, but "tie it all together" with VB.NET code if you wanted to.

So, it's not really so much about the "back-end" programming language that you use, you would probably pick whichever is most comfortable to you (especially in the .NET world where you effectively have a good choice), it's really more about the "front-end" scripts/languages that you would use.

For these, you really need (x)HTML, CSS & JavaScript. These 3 languages/scripts can be "laid on top of" virtually every other "back-end" technology that you would care to use (these are basically the things sent to the client's browser, so run locally on the client machine, rather than on your web server). Your back-end can now be ASP.NET, Java or any other platform you care to use, with the most "popular" ones being ASP.NET, Java (JSP) and PHP. (I'm sure I've missed many others out!)

Of course, on the server side of things, if you do need to run some intensive computations in response to user interaction, running pure C/C++ on the server will give you the best performance, you could even invoke these programs on the server using CGI, however, that's getting a bit old now and possibly has more security implications that other mechanisms.

One of the beauties of web development is that it's generally a "stack" of technologies working together to create the overall application, and in some cases you're free to pick and choose amongst technologies for each of the "layers" of the application. Stuff like ASP.NET (and the whole of the .NET world) attempts to "unify" these layers somewhat and give the developer a sort of "one-stop-shop" for creating web based applications.

Whilst writing web-based applications in C or C++ is (I think) relatively rare, it is certainly possible. I think you would have to play around with some different technologies for different layers of your stack to see what you're most comfortable with.

There doesn't seem to be a whole lot out there, tutorial-wise, for web based development with C/C++, but you could start by taking a look here:

C++ web development framework

CraigTP