Is it worth learning C as a web developer? Will I ever use it? [closed]
As a web developer, is it worth me learning the programming language C? Will I ever need to use it? I am currently using PHP and Ruby on Rails.
The unending pain of getting C programs to actually work reliably will teach you a lot about why PHP is a more civilized way to write software.
And yes, you'll use it eventually.
Some day you'll run across a problem ill-suited to PHP or Ruby. You'll be able to fall back to C and look like a hero because you know something more than other folks.
Not really. If anything, learn C because it is fun, and a great language to help you learn more about system internals. Working on web development is very high-level, and you won't get much chance to really get in-depth with the system. Using C can help you better understand how instructions are executed at a low level, how memory management works, and how to create a lot of the things that PHP / Ruby have built in.
Joel Spolsky urges computer science students to learn C:
"Advice for Computer Science College Students" (January 2005)
Learning Latin has it's benefits for understanding the structure of modern derived languages; so in that vein, I say why not?
I've found it very useful knowing C as a web developer. For example, one web app I've written includes a photo gallery. It stores the photos outside of the webroot so that it can check the user's permissions before showing the actual images.
Eventually, I discovered that the overhead for displaying a page full of image thumbnails was incredibly high using the web app in PHP. So, I rewrote the actual photo display code in C as a cgi program, which reduced the overhead to almost nothing.
I don't think learning ANY new language is ever a "bad" idea. Specifically to C, it can only give you a better understanding of how the languages you are using run "underneath the hood".
As others have stated you may not use C, but there are still a number of important concepts relevant to computers and computer science. Some insights can be gained from such classic texts as C Programming Language, by Kernighan and Ritchie.
This includes
Example of very good documentation and writing style in explaining a language in a brief document. You'll find that the complete language is explained in a book not much more than 100 pages. Compare this with some of the tombs of books sold today which position themselves as teaching a language and yet are often more than rehashed API manuals.
Understanding pointers, memory management, arrays and character indexes. All good information which aligns with core computer subjects; albeit low level, but a worthy piece of information for an professional programmer.
Its an easy quick reference book. Again you won't break an arm lifting it and yet gain a lot of knowledge from it.
In general C is useful for those occasions when you really do have to get closer to the machine or need to extend a language through use of a C-API.
Firstly, you have to define "web developer." Are you building websites or web-based software? While both of these tasks easily can fall under the category of "web development," they are somewhat different in terms of the skills set you need to be successful at it.
You're more likely to run into background processing and file/operating system interaction with software than "just" a website, and thus increasing the probability of using a low-level language like C.
Having said that, will you ever use it? Unlikely. High-level languages have been introduced by the dozens to tackle web development. From a web development point of view, if you're having to resort to C, it's most likely because you don't have the necessary skills in more suitable languages. Remember the massive amount of sites and software solutions of varying sizes that run fine on PHP and Rails.
Is it worth learning? Maybe. If you feel like you need hardcore programming skills to complement your web development skills and you have time to spare; go for it. If not, don't. You're probably better off getting really good at Ruby/Rails instead.
Speaking from my own experience, insofar as going from Python to C (and back again, woo!): Yes - learn it.
If you haven't already, learn fundamental, low level data structures; learn them well.
Learn what really makes an HTTP post tick, maybe write some low level debugging tools for yourself and others. It's amazing at how "under the hood" you can get in web development, when you can write an apache module. (Huzzah, bucket brigade!)
Learn the in's and out's of setjmp/longjmp, and perhaps come out with a better understanding of exception handling - that is, how it really works under the hood - in higher level languages.
You might never find yourself writing a line of C code for web development, but if you learn the language well, you'll be giving yourself an edge, all the same. Just be sure not to cut your toes off with it. (:
You'll probably never have to use it, so if you just aim at "usability" just forget it. However, learning C is a good way to get a grasp on the fundamentals of programing. You'll probably gain a much deeper understanding of PHP and RoR for free.
Bug generally, if you feel confident in your languages, no -- it's not worth the price ;).
Although I don't use C anymore, I find it useful to be able to talk to other programmers in their language. You may not have the expertise to solve a particular problem yourself, but you can talk intelligently to someone who can.
The same goes the other way, of course.
And, as pointed out above, C is the foundation of just about every other language that has come after it.
Learning a new language is always a pleasant experience and have a positive impact on the way you program.
Are you going to use C in web development. The answer is, most likely, no. Unless you are going to code a PHP extension or a custom web server.
Its always good to learn a new language , since you are already using Ruby and Rails framework . Knowledge about C programming will come handy when you are trying to learn in depth about Ruby scripting language , Since Matz Ruby Interpreter or MRI is written in C . And also most of the Web servers are written in C and C++ programming language .
Once you have an Idea how Web Servers works , you have an edge in creating a scalable applications , and will also able to analyze plus and minus of the Web Servers above which you are deploying your application.
"Be Jack of all you can be Master at any programming language and at any point of time in your Career" ....:)
Learning more languages is always a good idea. C is great, because a ton of languages are officially or unofficially based on it, and knowing what happens at a lower level can only help.
OTOH, to really advance your knowledge, I'd suggest learning a language that is as drastically different from what you know as possible - Erlang, LISP, Haskell, Smalltalk...
I'll put it this way. C is nuts. It was written in a time before people thought in entirely object-oriented ways. It will frustrate the crap out of you. Its hard to understand AFTER learning things the way you know them now.
But it is immensely helpful in understanding how everything else runs. Its a great language to help you transition to other languages because most modern languages inherit from or are built on it (syntax, data constructs, etc).
Moreover, both Ruby/Rails and PHP are based heavily in C. A lot of supporting libraries are written in C for those languages. Its crazy fast because it's compiled and is quite a bit lower-level, has a much smaller API than either PHP or Ruby/Rails.
I would definitely recommend learning it, even if its just for the fun of learning a new language. My prof always told me: "If you can give me a manual and a project worth working on, and I'll learn any language." So if you can find those two things, go for it!
I say, I say, I say: Yes... but just a bit.
Just least some very basics: strings, pointer manipulation...
Even if you never actually use it, you'll get much better understanding about performance issues in higher lever languages. Consider strings we're working with all the time: links are hard by Joel Spolsky
If you learn there is a great chance of achieving success, otherwise there will be no doubt.
Learning languages is never a bad thing. But as a web developer I think your time would be better spent honing on another technology. I've delved in Rails, and Java, but think if I really wanted to learn something new as a web developer, I'd be all over Django, google app engine, javascript, silverlight, flash ... and a handful of other technologies before I even thought about c.
In my opinion, for someone who writes software that runs on a computer, learning C is like learning Latin or Greek for a scholar of anthropology or literary science.
A significant body of the work that has been achieved in software development today has been done in C and that is what you really want to learn: it's not so much about writing your software in C, it's about being able to understand. Both what is possible and what has been done. Were everything comes from and also why we are moving more and more away from C in many areas.
Happy Segfaults! ;-)
The opportunity cost of learning C is high - you can learn something practical instead.
If you are a web developer and wish to continue to be one, it would probably make more sense for you to learn something more applicable to your field: Ruby and figure out how Ruby On Rails works, Python and how Django works, C# and how the MSFT MVC works. Or Flex. Or JavaScript and mooTools/JQuery.
While you can get a lot of basic computer science concepts out of learning C, you will probably never have to touch it. When/if you do, you'll learn it then.
If you wish to learn computer science ( not just slightly lower-level programming ), you can try Project Euler or some algorithms, operating systems, etc literature.
精彩评论