As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 12 years ago.
For scripting on web browsers, the only option now is using javascript.
I wonder if Ruby ever could make it to the web browsers?
It's highly unlikely cause MS doesn't have any reasons for letting Ruby to become first class citizen, wouldn't that be bad for their current platform? I don't know how Apple sees it.
If Ruby can't be first class citizen in the browsers, how likely is it that a add-on could be installed on the browser, letting the browser execute Ruby also. In that way, we programmers could just use Ruby instead.
Your best bet is probably a "language converter" like:
http://rb2js.rubyforge.org
Honestly though I would just bite the bullet and learn Javascript. A plug-in could be created, but it would never catch on: businesses won't inconvenience their customers just so that their programmers can use the language of their choice.
I don't like JS that much. For a scripting language its way too much verbose, it suffers from bad design decisions that got into the ECMA standard... It has however some nice features which make it unique and powerful.
I wish the web was more agnostic with client-side languages, but its very unlikely, sadly.
If you want something that feels like Ruby you may try CoffeeScript. You write your code in CoffeeScript which then gets turned into JavaScript. It borrows a lot of ideas from Ruby and Python which makes a great mix.
http://jashkenas.github.com/coffee-script/
I am personally enjoying it very much.
It may not be in the near future or it may never be implemented as the browser scripting language. But people are playing around with that idea. Check out rubyinside.com, they seem to have a working demo. The last time I checked the demo page crashed the browser :(
But don't loose hope yet ;)
It's not exactly using Ruby as a replacement for Javascript, but you can run Ruby on Silverlight (and Moonlight, the Linux implementation of Silverlight).
No one can tell the future, but I'd say it's incredibly unlikely. Browser vendors aren't likely going to want to support multiple client side scripting languages (see the death of VBScript in the browser). Javascript fills the client side niche already so there's no reason to vendors to introduce a new language just so that there is an alternative syntax. 3rd party plugins aren't really a good solution either because users get no benefit from installing it (unlike something like Flash which can offer functionality that HTML/Javascript can't).
There are some Javascript libraries that try to emulate a Ruby style of coding -- for instance, JS.Class.
Related
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I had asked a question previously regarding the use of Javascript or Ruby on Rails for the development of web apps and got some very good advice from maerics which basically boiled down to Javascript for Frontend/Smaller apps, RoR for service-side/larger apps (Groupon scope).
After a little digging however, I found out about Node.js and Express.js So my decision is basically back at square one.
I'm looking for a language I can use to take an idea to a functional stage (again, the scope is something like Groupon or Twitter). I am an absolute beginner. I know HTML/CSS and a little jquery, but that's about the extent of my knowledge on web technologies.
I've heard about RoR being very easy to learn, or at least pick up, and has a lot of community/support. But Javascript is everywhere, and can be useful for more than just large scale web apps (and I'd be using it anyway if I used RoR), though is far more complex. Seeing as I have no experience in either, I thought I should pick one now and stick to it for the next ~6 months and see how I go.
But can anyone recommend which one to go for?
When you asked about Javascript and RoR in your previous question, you effectively asked about Node.js and RoR.
If you are building a commercial/enterprise level application, stick with RoR. There are way more resources, bigger communities, relatively stable releases, and you can easily find good developers with RoR experience.
Express.js is like Sinatra for Ruby. Neither is as advanced as Rails, preferring to be more 'basic' and providing a minimal feature set rather than try to be an 'everything at once' framework that Rails is.
Right now, Node.js is rapidly changing its API, still has not hit version 1 and hard to find developers for(you often get people claiming they know node and have 1 year exp with it, when they actually mean they have 1 year exp with client side javascript). Besides, for 99% of the web's purposes, RoR will suffice. Most people only use Node for their pet projects, for testing out the next generation of super dynamic interfaces or websocket integration with Socket.io. If you just want to build an application for commercial purposes, use RoR.
As for difficulty, when you start out, Rails will be a bit magical, it does so many things under the hood, you'll have a little bit of difficulty doing something that doesn't already have a tutorial. But look through the source code of some popular gems or even rails itself, and you'll be up to speed in no time. Ruby is an amazingly simple and beautiful language, and you'll find it simpler and probably more fun than javascript.
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I know programming in general but always been doing either Delphi, VB 6 or C#.net! Now I must do web-dev and must do it fast! I haven't written a hello world in JavaScript yet and must learn jQuery because there are some charts that I must show in my web-app and looks like I must know JavaScript and jQuery to do that.
So I am looking for a jQuery resource that during its course or maybe at the first chapter gives us also a jump start on minimum JavaScript knowledge too. Some book or resource that I can hopefully sit and read through it in one day like 12 hours and after then learn enough to be able to use it and embed those darn charts and graphs into my web-app.
What do you suggest ?
The basics of Javascript as a language are actually fairly straightforward, particularly if you've got a background in several other languages as you have. You'll find it immediately familiar with curly braces and other syntax that you'll recognise from elsewhere.
If you've worked with C#, you will hopefully have been exposed to lambda functions or closures. These are very important in Javascript, where they are key for the event-driven code that drives most websites, and in particular if you're using a library like jQuery, where they are used for virtually everything. You need to get a strong handle on how these functions work if you're going to make head or tail of jQuery.
The other thing to be aware of is that Javascript's object handling works a bit differently to the other languages you's used to. There are similarities, but if you try to write your classes and objects in the way you're used to, you will get some unexpected results. See What type of language is JavaScript for more info on this.
Beyond that, I don't think you'll have a problem with the syntax.
The other thing to worry about is the DOM -- ie the browser's API which is accessed via Javascript. The DOM is not technically part of the Javascript language, but it is inextricably linked to it, and is as much part of the learning challenge as the language itself. jQuery abstracts a fair amount of the DOM away from you, but it still helps to know it.
Hope that helps get you started.
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I am .NET (do most of my work in ASP.NET WebForms) developer. But I am not limiting myself to that framework only and read and try to learn new stuff from time to time.
Lately I noticed a lot is happening in Javascript world. I'm familiar with jquery/UI and calling web services from client side. But lately I see a lot of new frameworks written in Javascript. I really don't know why so many are created lately. Can anyone enlighten me why is that happening? What are the differences between different frameworks. When should I use/not use them? For example node.js is something totally weird for me. Writing server side code in JS? Writing HTTP servers in JS (or maybe no one really does it?). Creating client side UI on JS only? I really don't get it. Add to this at least 5 templating frameworks and my head is about to explode :)
Atwood's law:
Any application that can be written in JavaScript, will eventually be written in JavaScript.
The real story is: nodejs (or v8) allows developers to write applications in Javascript that can be executed outside a browser. This makes Javascript as powerful as Python or Ruby. Nodejs was adopted faster than any language in history, because many developers already know Javascript. Suddenly it's possible to write applications in Javascript, so we are in a gold rush of development. Many from the Ruby community (who are early adopters) tried nodejs, so it inherited a culture of sharing libraries under permissive licences.
I don't use the client-side/server-side language because it's confusing and a false dichotomy.
I think all the javascript server side libraries are now coming out because of Google's V8; The highly efficient JS engine that Google made for Chrome. It compiles the JS codes and therefore runs its pretty fast.
It was not too long ago that V8 was released.
It makes it easy to run js without a browser efficiently.
The biggest downside of node.js is probably that a fatal error will crash the entire http daemon. So one visitor can bring the entire site down unless a lot of care has been taken.
I think the biggest advantage of js-server-side like node.js is that you can run the same code on server and on browser. This is particularly useful for form validations, for example.
As compared to PHP, node.js also provides the advantage of being able to make non-blocking calls. In fact with node.js its really hard to make any blocking calls.
I wouldn't call node.js a framework though, I see it more like an essential library for which a framework still has to be made (or does one exist already?).
Linkedin is built on node.js and they seem to be very pleased with it. However their site seems to be quite backward to me.
All the fuss about JS is because of the great UI experience the user can get. Instead of the user waiting for the page to refresh every single time they do something, the results are almost instantaneous. I agree with #Karoly Horvath's comment. JQuery may seem weird at first, but its because of the unknown, it's great to work with once you are used to the syntax. Getting back to the user experience, if your page takes forever to load/reload, the users will rather use another site. Your question is not really fit for Stack Overflow, but im sure you will find some additional answers and opinions in the chat sites available on SO. Good luck.
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I come from a C/Unix background, with a lot of experience in shell scripting, and some on Perl, elisp, etc. too. But now I'm getting into some work where I'll need to be developing interactive web-based interfaces, and I need to learn JavaScript. My problem is that all the resources I've found online for learning JavaScript seem to be targeted at an audience who's never programmed, and their authors don't seem much better. As soon as I see "validating user input to take the load off your server" as one of the great uses for JS, I want to scream and I feel like I can't trust anything else the author says. ;-)
Can anyone recommend good resources for an experienced programmer wanting to learn JS as a new language? Ideally I'd like to get started online, but dead tree recommendations would be welcome too, especially if I can preview them online.
A great JavaScript book for experienced programmers is Doug Crockford's JavaScript: The Good Parts. It's short, assumes you know what you're doing, is opinionated, and is not a tutorial.
My advice: Forget what you know about object oriented programming. Attempts to apply the inheritance paradigms from an OO language have repeatedly overcomplicated many, many chunks of JS code.
Prototyping is not Class construction. Object instantiation is not Class instantiation. "Classes" are not real.
There are ways to get what you want. You can even have something akin to privates - but they are not methods or members. They are merely locally scoped. Inheritance is often faked, but with mixed results, and universally at the expense of data hiding.
Javascript is prototyped. It is not object oriented. Keep that in mind every time you think something like, "Man, an interface here would be awesome..."
https://stackoverflow.com/questions/3655530/best-javascript-book-for-an-experienced-coder/3655693#3655693
https://stackoverflow.com/questions/1594159/best-book-to-learn-web-development-for-a-professional-developer
https://stackoverflow.com/questions/74884/good-javascript-books
but I will recommend these two fantastic books, which teach me a lot.
Take a look at Eloquent JavaScript. It doesn't cover everything, but it will move you towards idiomatic JavaScript programming -- things like functional programming, closures and prototypes. (The online version comes complete with a sandbox tutorial environment.) The rest, after all, is just knowing how to use references.
Javascript Guide from Mozilla Developer Network, a simple and yet informative guide, gives beginners a big picture of JS in a short time.
https://developer.mozilla.org/en/JavaScript/Guide
JavaScript: the definitive guide is one of my favorite programming books:
http://oreilly.com/catalog/9780596101992
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 11 years ago.
Which language will allow a beginner to get up to speed quicker?
Basically which language of the two is easier to learn
Python is more regular, and has not needed to keep supporting every old, redundant feature forever, as Javascript has been forced to do (in order to keep supporting existing sites): these are issues that can make Python easier to learn.
However, Javascript's not too bad, especially if you can choose a reasonably rigid, modular, clean framework such as dojo (if you have to learn about every popular JS framework, or even most of them, it will, however, be a nightmare -- as it will if you have to learn the subtle bugs and incompatibilities of various browsers' implementations of JS and the DOM, rather than getting them covered up by such frameworks as dojo, jquery, or closure).
For learning Javascript, I recommend supplementing whatever tutorial you choose with Crockford's Javascript: the good parts -- it's a very thin book (which sounds like a joke, but it's true!-), fast and easy to read, and stops you from wasting your time on language features that are misconceived, too badly designed to use, or counterproductive. Crockford is a real JS guru and is well worth reading and paying attention to.
Depends what you want to do. If you're just interested in learning a programming language, I would recommend Python because:
The interactive prompt is great for learning a language
It's simple and well-designed, whereas JavaScript has a number of design flaws that can be confusing to newbies
There is a particularly high amount of introductory materials for Python.
It allows you to do all kinds of programming (server, client, games, etc.), whereas JS will limit you a bit more.
They're both pretty straightforward to learn. They more differ in terms of their typical project space - Javascript is usually utilized more for the client-side portion of web applications, while Python is often utilized for the server side of web applications and also standalone non-web apps.
What do you want to make?
The two languages are used for two completely different purposes. JavaScript does work in the browser,1 Python does work everywhere else. Pick the language based on which you want; it's useless to learn a language if you can't even use it for your project. If you want to make a website, for example, you'll have to learn both--JavaScript for the client and Python for the server.
Regardless, to answer your question, both languages are great but I'd say Python is easier to start with. JavaScript's basics are fine, but it features a lot of advanced concepts that you shouldn't have to deal with when learning your first language, IMO.
1. Yes, I'm aware that you can use JavaScript on the server-side, but those implementations are not mature and certainly not for a beginner. Python is much more suited for that kind of thing.
PHP is my thing, but I've played with Python and worked with JS. Being only somewhat skilled in both languages, Python feels nice and clean (although a little wierd) with the forced tabbing conventions and lack of semicolons. JS, on the other hand makes me feel like I need a shower. Especially after debugging in IE.
But the only real answer is the question - What do you want to do with it? Want to make websites do cool things in the browser? Go with JS. Something else? Maybe Python is better suited, as #Amber said.
Edit: As for getting up to speed, here's how it works. Your first language takes you a longer time to learn. Your second takes much less time, and after that it's not long at all since you're mostly just learning new syntax for similar things. So the solution for getting up to speed faster is to jump in right now.
I would say JavaScript is easy to learn. I had to learn it to program the Karotz. It only took about 2 months of Youtube tutorials to learn most of it.