tags:

views:

567

answers:

12

Would it be better to learn C before learning any type of WEB and desktop programming?

I don't know how to program, I want to learn Javascript and my friends suggested to me that I should learn C first.

+11  A: 

No.

JavaScript may be one of the klunkiest languages ever, but it has one huge advantage over C: You can play with it. (I spent 10+ years coding in C. I had some fun, but I'd never call what I did "playing".)

My suggestion: Open up your favorite Web page, save it to disk, open up the JavaScript (or download it, if need be), and play. You'll learn a lot that way.

EDIT: Downvoters: Yes, there is a lot to like about JavaScript. But there's also a lot not to like.

Dan Breslau
some extra tips: 1: don't start with your favorite web page, better one with just a couple effects or data checks. 2: w3schools.org 3:douglas crockford
Javier
@Javier: I second your Douglas Crockford call. JavaScript isn't necessarily "one of the klunkiest languages ever" - you just have to use The Good Parts (see Crockford book)
harto
Actually, we need someone else to enthrone beside Mr. Crockford; some (not all) of his programming skills are quite mediocre.
staticsan
FWIW, Crockford warns that The Good Parts book is not for beginners or the faint-of-heart...
Dan Breslau
+1  A: 

No absolutely not. Learn an easy to learn language such as Python or Ruby that come with an interactive interpreter/shell that you can play around in. You wont have to save any files or refresh any browser, just execute right there on the command line. Best way to learn in my opinion.

apphacker
Javascript has numerous REPLs of its own (firebug, rhino, spidermonkey all have consoles, along with chrome, safari, the address bar of ANY WEB BROWSER etc) so this on its own is no reason to try and learn ruby to learn javascript. Doesn't make any sense.
Breton
I'd also suggest starting with Python. "How To Think Like A Computer Scientist" is a great free book that will teach you how to become a programmer using the Python language: http://www.greenteapress.com/thinkpython/thinkCSpy/thinkCSpy.pdf
splicer
+1  A: 

C is a difficult language, especially for a beginner, as it is much "closer to the machine" than many other languages, and has little bearing on the web-development framework/model

now, if you do learn C, everything else will seem easy ;-)

i would start with python or C# or something with more guardrails

good luck!

Steven A. Lowe
A: 

No. Although C contains the raw power and flexibility which surpasses most modern languages, learning C would not give you much of an edge when transitioning to other languages. I worked with C#, ASP.net and javascript before I started programming in C++. Starting with a language like C# or java might be better for a beginner since it saves you the pain of having to worry about most of the core functioanality of your programs (s.a. memory management, data structures etc.) But it would certainly be a great advantage if you could learn C and C++ (even assembly) as you move along.

Gayan
A: 

Definitely not.

C is a great language that can be used for a lot of things, but it operates at too-low a level for many of the needs of web and desktop software. When you are writing code, you want to focus on what makes your application unique among other applications in its domain. You don't want to deal with a lot of details that are not directly relevant. There are great (and bad) languages for writing web and desktop applications that will let you accomplish what you need faster. They may not be as elegant, but they'll get you where you want first.

C is important to understand how things work under the surface, but it shouldn't be a first priority.

Uri
+6  A: 

If your intent is to learn Javascript, start with Javascript now. The C language brings you a lot of general knowledge, but for Web programming it's better to start with HTML and Javascript. You need to answer yourself this question: 'how much time I can spend before be able to make money with programming?'

GogaRieger
A: 

Not at all.

If you already do HTML, and want to take it to the next level with JavaScript, then just do it. read w3schools, Douglas Crockford essays, lot of sample code. That, should be enough to get you rolling.

On the side, but without any hurry, do experiments with PHP, Python and maybe Java or C. maybe you won't use any of them, but it would really make you a better programmer.

If, OTOH, you want to be a real developer, you do have to know C; but you don't have to start there. i'd say start with one or two 'easy' languages (JavaScript, Lua, Python), then C/C++ heavily, then go for other ways, according to your chosen path. the best three paths from there would be (subjectively, in my own opinion, etc):

  1. scripting: Python, Lua, Scheme
  2. web: 'deep' JavaScript, Java, PHP, Python
  3. hardcore programming: more C++, LISP, Haskell
Javier
+1  A: 

Since you don't know how to program, I agree with recommendations here that you start with Python or Ruby, etc. First learn some basic concepts or programming and see if you like it. If you don't like it much, then learn only what you feel you need. If you love to write programs, then continue playing with Python/Ruby but at the very least make yourself familiar with C. Be comfortable enough in C to write moderate programs and definitely good enough to read someone else's C code. There is a lot of C code out there, and more being written all the time.

dwc
+2  A: 

I think it depends on your motives - are you aiming to become a professional programmer? If so, there could be some value in learning C first.

Most entry-level programming subjects at University are taught in terms of C; it can give you a deeper insight into how software works. Also, K&R is a valuable programming manual in its own right.

If your aim is to create a simple set of DHTML pages, then by all means, jump straight into JavaScript. However, I think C can offer you a lot, if you're serious about programming.

harto
+3  A: 

I actually think that JavaScript is one of the best languages to start programming with. Later, when you you really get it and you want to go deeper, C is something great to know. It gives you a much deeper understanding of how computers really work.

JavaScript really lets you get started fast, see immediate results, and ramp up to more complex concepts very fluidly.

The rest of my answer assumes you know practically nothing about programming - web or otherwise. Maybe you know a little html basics.

Open up a text editor. You can even just start with notepad or something. And put in the following:

<html>
    <head>
        <script>
            alert("Hello, World!");
        </script>
    </head>
    <body></body>
 </html>

Save the file as hello.html and open it in a browser. Poof! You've written a program. Doesn't get easier than that. No need to get into the command line or download or build anything. I remember when I first started being frustrated trying to get PHP running on my machine and wishing it was as simple as getting started with JavaScript.

The next step is just to read and explore. Documentation is freely available all over for learning more. I highly recommend anything from Douglas Crockford and JavaScript:The Definitive Guide.

A pretty good basic project would be a calculator program, but there's lots of fun things you can do. When you've gotten your feet wet, and you feel a little more confident, explore some other languages. Ruby is a pretty good step from JavaScript. By that point you'll probably know where to go yourself. You may never take the road to learning C. Even if you learn it, you will likely never really have to use it.

Russell Leggett
+1  A: 

Don't pick a language to start learning.

Pick a project that solves a simple problem, then choose an appropriate language to solve that problem.

If you want to start a simple web application, then learning Javascript instead of C is a fine approach.

If you want to learn to write a desktop app, then Javascript is absolutely the wrong way to go about this.

BTW, if you're learning web applications, then you'll need to learn HTML, & some kind of web application backend language (which won't be C!). Javascript will be the least of your issues in this case too.

Tim
A: 

if you have any intent to create something useful, that is, something more than a hobby, yes learn C first, or even better spend some time learning how modern computer architectures actually work before spending any time telling them what to do.

it can be argued that javascript has little to nothing to do with C but C will force you to learn how things really work and therefore provide invaluable insight into performance, data storage and teach you what actually happens when you call some random library call that may be taking many orders of magnitude more time to execute than it needed to.