JavaScript

#slider
#adsense

JavaScript - Yahoo News Search Results

119.88 ¥/$ (5 p.m.)

Sorry, but your browser needs Javascript to use this site. Pro-Russian fighters patrol Tuesday in in the village of Shirokine near the strategic port of Mariupol, Ukraine.

Popular JavaScript Package Manager Npm Raises $8M, Launches Private Modules

 Most JavaScript developers are familiar with the npm package manager, which was originally developed by Isaac Schlueter. What many probably don’t know is that npm is also a company co-founded by Schlueter to support the project. Today, npm announced that it has raised $8 million on top of the $2.6 million seed round led by True Ventures the company announced last February. The lead… Read More

120.13 ¥/$ (9 a.m.)

Sorry, but your browser needs Javascript to use this site. Four out of 7 patients, including foreign visitors, who had liver transplants died within one month after the surgery at a new hospital in Kobe established in November, the Yomiuri Shimbun said Tuesday.

SCENE AROUND Special Populations Prom, April 11

Javascript is Disabled! This slideshow viewer requires javascript. To view this slideshow either enable javascript and refresh the page or go to http://www.reflector.com/slideshow_basic/2843101/1

Cool tools for compiling to JavaScript

Every programmer has a favorite language or two. JavaScript lovers are the luckiest these days because their language is taking over the Internet and the Internet is taking over the world. Those whose hearts reside elsewhere in the programming language world, however, are stuck. They can either stay on the sidelines and curse the relentless juggernaut of HTML, CSS, JavaScript, and Node.js, or ...

Google refocuses Dart as a JavaScript helper

Backing down on ambitions to create a commercial grade Web programming language, Google is shifting work on its Dart programming language to make it an optimization aid for the pervasively popular JavaScript, which Dart was originally designed to supplant. The company no longer plans to incorporate Dart into its Chrome browser, the two creators behind Dart announced in a blog item posted ...

Instant feedback arrives for JavaScript code testing

Developers looking for quick results when testing JavaScript code could have a solution with the Wallaby.js test runner tool, a code coverage technology intended to offer nearly immediate reporting of results.

Delicious/tag/JavaScript

recent bookmarks tagged JavaScript

Javascript Replace All Hashtags w/ Links

Posted on 3 April 2015

Programmer: ASP.NET AJAX: Calling PageMethods Synchronously

Posted on 3 April 2015

Creating a downloadable text-file using blobs - JSFiddle

Posted on 3 April 2015

www.tutorialsavvy.com

Posted on 3 April 2015

Draft Countdown

Posted on 3 April 2015

jQuery.scrolling

Posted on 3 April 2015

www.tutorialsavvy.com

Posted on 2 April 2015

blog.servo.org

Posted on 2 April 2015

spmbt.github.io

Posted on 2 April 2015

github.com

Posted on 2 April 2015

Top Answers About JavaScript (programming language) on Quora

Top Answers About JavaScript (programming language) on Quora

Is Javascript Turing Complete?


JavaScript is absolutely Turing Complete. It's not a high bar for any modern language (if you assume a finite tape in the Turing Machine, but no one seems to be arguing about infinite tapes, so I'm ignoring that).
In order to not be Turing Complete, a language must not be able to do something that a Turing Machine can do. Because you can implement a Turing Machine in JavaScript, it's trivially Turing Complete.
Edit Below I've simplified and condensed the remainder of my answer to the key parts, and addressed objections brought up in another answer.
It doesn't matter if a task is harder to do in JavaScript than some other language. It doesn't matter if JavaScript is missing some key language feature that you like, or adds a feature (like setTimeout) that a Turing Machine can't compute.
More compellingly, take a look at the compile-to-JavaScript tool Emscripten: It can compile C and C++ (and probably anything else that LLVM can compile) directly to JavaScript source code. So for JavaScript to be not Turing Complete, C, C++, and all other languages compilable by LLVM would need to not be Turing Complete either. Again, it's not about how convenient a language or feature is. It's about whether the language can do the same computations.
Finally, even Java can be compiled to JavaScript with GWT Project. So again, if Java is Turing Complete, therefore JavaScript must be.
Addressing specific claims:
  • JavaScript is a PDA: No, it isn't. A PDA is very restricted in the ways it can store data. You can have arbitrary arrays -- as many as you like, each equivalent to a TM tape in its random access capability -- in JavaScript.
  • JavaScript fails to support tail recursion: Tail recursion is an optimization supported by some compilers. Anything that can be computed with tail recursion can be computed instead with iteration. Besides, C doesn't support tail recursion as a language feature either. Nor does Java. It's a common optimization, but it's not a language requirement, so any claim that tail recursion is a requirement for Turing Completeness would exclude both C and Java. Turing's paper where he defines a Turing Machine doesn't even talk about tail recursion, it just mentions that recursion should be possible. You can apparently even convert recursive JavaScript code to tail-recursion automatically: On-the-fly tail call optimization in Javascript without trampoline
  • Language Translation only requires a PDA: Sure, so EmScripten or GWT only need to be implemented as PDAs. This is orthogonal to the question as to whether JavaScript itself is turing complete.
  • The k-stack Theorem: Only applies to PDAs. JavaScript is not a PDA, and JavaScript has many ways to store state and is not restricted to "k stacks".
  • Broken JavaScript Examples: When you create something in "79 bytes!" you likely don't cover all corner cases. The existence of a broken example does not prove that it can't be fixed.
  • HALT: The original Turing paper doesn't talk about operating systems, just that there must be an instruction that, when called, indicates the process is complete. The Turing Completeness of a language doesn't hinge on whether the language can exit to the OS, or what the HALT instruction does, other than stop processing the algorithm. Printing HALT to the terminal (console.log) or just exiting a NodeJS process should be fine ways to indicate you've entered HALT state.
  • No Algorithm Has Been Presented That JavaScript Can't Calculate: This is really the killer point; the core definition of Turing Complete is that a system can calculate anything that a Turing Machine can calculate. We're seeing a lot of theoretical claims, but no actual example demonstrating a process, any process, that can't trivially be calculated in JavaScript.
Things that are not even intended to be Turing Complete have been discovered to be, like the template system in C++, and Conway's Game of Life. It's an incredibly low bar for a language to meet, and the claim that JavaScript is not Turing Complete is unsupportable.


See Questions On Quora

Posted on 28 December 2015

Whats the use of PHP and Javascript? Can someone explain differences of both by providing with real life examples like facebook or any other websites?


PHP is backend, though it can work with inline HTML (not recommended for large projects). You can post something using an HTML form, PHP can pick it up and write it to a file or a database or send it as an email. Or it could show a specific table of data that it pulls from a database given a specific search query. That sort of thing.
Traditionally JS has powered the front end. If you see a dynamic page with things that disappear, fancy sliding menus or buttons that change color when they hover etc. you're looking at JS in action.
The big deal that's blown up lately, though, is that JS has gained essentially mainstream acceptance in the backend as well. Node.js has powered much of this. In many ways, it's a better, more robust language than PHP. It's clean, it enables an all JS stack, and it's bleeding fast with multiple async processes (as opposed to PHP's default of a procedural, step by step run through).
So in terms of usage, you can use PHP in the backend, and JS for the backend and in the front end. PHP is thinner and easier to learn, however.


See Questions On Quora

Posted on 24 December 2015

Is Java to JavaScript as C is to C++?


No, JavaScript has little to do with Java other than the first four letters of its name.  It was originally called "LiveScript" and was developed by Netscape: JavaScript.
Netscape changed the name of the language to JavaScript when Java first started being "hot" in the mid 1990s.  Java itself had little influence on the development of JavaScript.
C is however a direct "linguistic" ancestor of C++, and early versions of C++ used a fancy preprocessor to directly generate C code and used C compilers before fully "standalone" C++ compilers appeared.


See Questions On Quora

Posted on 22 December 2015

What are ways to determine true Javascript developers from those who rely heavily on jQuery?


I've been interviewing JavaScript developers for the last few months. My company needs hard-core, senior developers who know the language really well, so I have to weed out the jQuery scripters. I have no contempt for them. Everyone needs to start at some level, but those folks simply don't suit our needs.
Here are some questions I ask, and they seem to give me a pretty good idea of the skill level of the person I'm talking to:
1. What is the difference between object-oriented and functional programming?
2. How prototypal inheritance different from classical inheritance?
3. If I create a new object with var newObject = Object.create(protoObject), what is the relationship between newObject and protoObject? If protoObject has a method called foo, does it get copied into newObject?
4. If the following code run in strict mode, what will I see in the console?
var obj = {
   foo: function() {
     console.log(this);
     function bar() {
         console.log(this);
    }
    bar();
  }
};
obj.foo();
5. What will this function return?
function foo() {
    return 
    {
        foo: 'bar'
    };
}
6. Then I give the the following problem to solve:
A candy store owner has entered the following transactions in a databased, which you have converted into a JavaScript array:
var transactions = [
 {candy: 'Snickers', amount: 'THREE', paid: true},
 {candy: 'Hershey', amount: 'ONE', paid: true},
 {candy: 'Snickers', amount: 'FIVE', paid: false},
 {candy: 'M&Ms', amount: 'TWO', paid: true},
 {candy: 'Gummi Bears', amount: 'ONE', paid: false},
 {candy: 'Gummi Bears', amount: 'FOUR', paid: true},
 {candy: 'Candy Corns', amount: 'ONE', paid: true},
 {candy: 'Three Musketeers', amount: 'FOUR', paid: true},
 {candy: 'Hershey', amount: 'THREE', paid: true}
];
When someone asks him to hold some candy at the register but hasn't yet paid, paid is false. Otherwise, if the candy is paid for, paid is true.
The assignment is to simply add up all the candy sold, e.g THREE + ONE + FIVE ... Unfortunately, the store owner entered the numbers as upper-case strings. Luckily, we have this map:
var digits = {one: 1, two: 2, three: 3, four: 4, five: 5, six: 6, seven: 7, eight: 8, nine: 9};
Finally, it's important that the unpaid transactions aren't included in the total.
The result should be THREE + ONE + TWO + FOUR + ONE + FOUR + THREE = 18.
Now, any programmer should be able to do this easily. What interests me is how interviewees solve the problem. I don't penalize them if they use for or while loops. But, if they do, I ask if they can think of a more functional solution.
And if they make prodigious use of the build-in functional array methods, I ask if they can think of another way to do it.
The various approaches they take tells me a lot about their skill level. Sometimes very skilled programmers--ones who aren't highly experienced JavaScript developers--only know how to solve it the way they'd do it in, say, Java or PHP. That may be good enough or it might not be, depending on your company's needs.
I also ask them to tell me about their experience with a major JavaScript framework (Angular, React, Ember, Backbone, etc), how they like to organize large projects, how they deal with complex asynchronous code, and their experience with testing.


See Questions On Quora

Posted on 20 December 2015

Is Javascript a good first programming language?


No.
Javascript is messy. It does weird things. It's hard to write clean code in. These are things that an experienced programmer can deal with, but are likely to cause confusion in a beginner or may even produce bad habits that are  very hard to unlearn.
A short response to some of the comments:
  • the question is not whether Javascript is a good programming language (though much can be said about that too), but a good first programming language. A Porsche 911 is a great car, but it's not a good first car. These are different questions;
  • the examples in the picture above are obviously for demonstrative purposes and are rather explicit. No one is going to write '5' + - + - - + ... - '-2' or something like that,  but it might certainly happen that one variable is a string, the other a number and that one tries to concatenate or add the two and gets a weird result but no error. That can be confusing to a beginner and is a lot less obvious than the examples above. As I said, something who is experienced might not run into these kinds of problems or may figure out what is going on soon enough, but for a beginner, it's much better to get explicit warnings or errors.


See Questions On Quora

Posted on 14 December 2015

What is the most efficient way to become a fullstack javascript developer? I am willing to dedicate one hour everyday.


Here's a quick roadmap:
  1. Learn HTML5
  2. Learn CSS3
  3. Learn Bootstrap 3+
  4. Learn Front-End Javascript (with or without JQuery)
  5. [Optional] Learn Angular
  6. Learn MongoDB
  7. Learn Backend Javascript (Node with Express)
  8. [Optional] Learn Meteor
Please note that it's an opinionated list. You could learn Backbone instead of Angular, you could learn MySQL instead of MongoDB.


See Questions On Quora

Posted on 22 September 2015

I would like to make a version of autocorrect kinda like a find and replace program. What system should I use? And how would I go about programing such a thing?


This kind of string searching and manipulation is a classic, core Computer Science field of research. It's not an especially hard problem, but it certainly has many subtleties. If you don't have any CS education, you are at a fairly serious disadvantage, because there is a lot to learn.

Just about any programming language can do this sort of thing. Whatever is easiest for you to learn is fine. The major script languages (Python, Perl, Ruby, etc) are especially well suited for these kinds of problems.

Beware that the line between "pretty easy" and "basically impossible" is pretty subtle sometimes, and that is true in this field. Without a more clear description of the problem, it's hard to say whether what you want is doable or crazy. This comic is accurate:


If your string algorithm requires any comprehension of the meaning of the text, for example, you're doomed.


See Questions On Quora

Posted on 17 September 2015

What are the javascript frameworks that are likely to be popular at least until the year 2017?


Angular 1.x is going to be around by then. I'm not at all confident that we'll actually see people migrate to Angular 2. Looking at how Python 3 still hasn't pushed out Python 2 even though it as released in 2008, this is a very real possibility.

The reason I can say that Angular 1.x will stay popular with such confidence is that it is being used in so many projects now. Due to how it is built, it embeds itself so firmly into your architecture that it completely unrealistic to factor it out, no matter how much you want to. Sharepoint and SAP are frameworks that have this survival strategy as well - once you are invested, you can't get out. Angular 1.x will give you work for years and years to come.

That said, you won't be working for the next Snapchat or anything, because they will stay away from these technologies that we now (in hindsight - I used to recommend Angular) know are software quicksand, and you'll be stuck on the sidelines of technology.

Instead, I recommend a completely different approach, which is to move your focus away from tooling and onto fundaments. I even made a video about it, because this question popped up so much:
https://www.youtube.com/watch?v=...


See Questions On Quora

Posted on 13 September 2015

Why is JavaScript such a pain to learn?


JavaScript as a language is not difficult to learn. The problem is that, few people who code JavaScript understand how JavaScript really works and behave behind the scene. A lot of people (even those who claim to have years of experience) write very bad and inefficient JavaScript code (because JavaScript does not prevent you from doing the wrong thing).
Most at times they bring what they have learnt from other programming languages into JavaScript and they think it is OK because it works. However, despite JavaScript similarity to c-like programming languages, it behaves different in most cases due to its design and implementation (coercion, precedence, scope, .... (if you do not understand any of these, then you have a lot to learn before you consider yourself a JavaScript programmer).
It is sad that most courses or books ignore these important details. Others may argue that such details are for advanced users, but how many of us master a programming language before we write code into the real-world?
Again, what most books(if not all that are out there) call JavaScript programming, is not entirely true. Imaging teaching about DOM, Ajax, templating, jQuery, and the like and calling it "JavaScript programming". This is so wrong because JavaScript as a programming language has nothing to do with any of those above.  JavaScript is the plain ECMAScript and nothing else. The browser environment is an implementation of JavaScript on the client-side.
If you want to learn JavaScript, try to understand and don't imitate what people do. Javascript: Understanding the Weird Parts - Udemy (the best resource I have ever come across). They even have a three hour sample on YouTube.
https://www.youtube.com/watch?v=...
.
Finality, just accept the fact that JavaScript is different from the others :)


See Questions On Quora

Posted on 7 August 2015

Are Javascript functions like map(), reduce() and filter() already optimized for traversing array?


I don't know what specific techniques are being referred to, but it smells like premature-optimization-thinking.

Strictly, a plain for loop is slightly faster if you run the two against eachother in direct comparison. However, it is generally silly to view performance in such a narrow way.    Your app is very unlikely to have performance problems due to stuff like that. In reality, your app FPS is going to tank because you're accessing offsetTop somewhere and causing a DOM reflow causing work equivalent to millions of filters and maps. Even if your problem can be helped by switching map to a for loop because you're iterating thousands of items per second, you could probably ask yourself if the problem is that you're... well, iterating thousands of items per second in the first place.

Fast applications are born by spending time in the profiler, not by speculating about tiny parts of ones software.

Oh, and if you like my writing, don't miss out on more of it - 
follow me on Quora and Twitter (http://twitter.com/mpjme)


See Questions On Quora

Posted on 26 July 2015

Why would Quora choose the Mean stack over the Python stack?


Quora isn't using the MEAN stack



As far as I can gather, Quora is still using the same Python stack they started with:

QUORA.COM Technology Profiler on BuiltWith

Quora's Tech Stack | StackShare

I examined their JavaScript and couldn't find any trace of AngularJS (the A in MEAN stack). I think they are just getting a lot of mileage out of jQuery on the client side (never underestimate jQuery!).

This article is 4 years old, but it does a great job of exploring Quora's tech stack: Quora’s Technology Examined


See Questions On Quora

Posted on 13 July 2015

How do I prevent the end-user of a web application from changing values in the JavaScript runtime?


There is really no way that you can prevent this. You are just sending JavaScript from the server to the client, and the client is providing the runtime. The runtime can be anything - theoretically it can be something custom-made by the user, in order to hack your site. You must always assume that anything sent from the client might have been tampered with.

See Questions On Quora

Posted on 25 June 2015

What are ways to determine true Javascript developers from those who rely heavily on jQuery?


It is generally very easy and doesn't take any special tricks. It is a very big difference between these two - a person that uses jQuery only is like a child with a plastic hammer next to a carpenter in comparison. You can just ask a couple of basic JavaScript questions about variable scoping and the this keywords to see it immediately.

See Questions On Quora

Posted on 21 June 2015

I really want to learn programming but I am having major issues with JavaScript. What should I do?


JavaScript is the lingua franca of the internet.


Here are the result of Stack Overflow's 2015 survey of 26,000 software developers.


That's right: JavaScript is more popular than SQL. That's how ubiquitous JavaScript has become. And this trend is accelerating.

Embrace JavaScript the way you've embraced another lingua franca - English.


Sure, JavaScript has flaws. But everyone - Google, Facebook, even Microsoft - has a vested interest in smoothing those flaws out. JavaScript is improving rapidly.

Don't switch to another high level scripting language (Python, Ruby, PHP) thinking it will make things easier. This will only postpone your eventual need to master JavaScript.


See Questions On Quora

Posted on 24 May 2015

Are there performance differences between using semi-colons and not using semi-colons in JavaScript?


The interpreter still has to go through your script and interpret if there are any semicolons or not. Using semicolons does not have any performance benefit (or, contrary to popular belief, much benefit at all, except just being stylish).

Edit: After looking a bit, I found that someone actually made a performance comparison of this. In some older versions of Chrome, code not making use of automatic semicolon insertion (ASI) is slightly slower, but in the most recent versions, ASI is actually faster:
ASI performance · jsPerf

It should be noted that this is a pretty silly, theoretical exercise. Script execution is what is generally interesting from a performance standpoint, not interpretation, as that is only done once, while execution might be done trillions of times.

If you're already following me on Quora - don't miss out on my twitter feed. I tweet juicy software nuggets that you won't see elsewhere.


See Questions On Quora

Posted on 6 May 2015

Why are IT systems in big enterprises usually built using Java, instead of Python or JavaScript?


1) You have consistent performance through the JVM.  The performance characteristics of the JVM are pretty well known, and you can pretty easily take legacy code and add hardware to make it work.

2) A terrible programmer can do a lot less damage with java than they can with python or javascript.  Python and javascript are written so that if you have a terrible programmer, they can do something to create hard to track bugs that crash the whole system.  If you have a terrible programmer in java, they can do less damage, and the thing is modular enough so that you can work around the bad programming.

If you have a 1000 programmers and 1 of them is totally incompetent, then they aren't going to be able to single-handedly destroy the system.  Whereas with javascript and python, one incompetent programmer can single-handedly destroy the system.


See Questions On Quora

Posted on 5 May 2015

Is Google actually using Angular for any of its top products like Facebook uses React or Microsoft uses Knockout?


As far as I can tell, the only places they're using Angular are on their Playstation YouTube Client, DoubleClick, and the Google Developers Console.

They don't seem to be using it in their flagship products like Gmail, Google Search, Google Analytics or Google Plus. Redoing an app like Gmail in Angular would be a lot of work, and doesn't seem to be necessary. My guess is they're only using it for new products.


See Questions On Quora

Posted on 27 March 2015

Why do a few of my co-workers argue that JavaScript isn't real programming?


Most-likely because they don't know what they're talking about. Or because they've made up some quirky, personal definition of "real programming."

Here's how I define "real programming:" writing code in a Turing complete language. People write code in Javascript, and Javascript is Turing complete, so by that definition, Javascript programmers are doing real programming, and Javascript is a real programming language.

I suppose you could define "real programming" as writing code of some arbitrary level of complexity. By that measure, Javascript also passes muster. Of course, there are people writing very simple applications, but there are also people writing very complex ones, such as gmail and google maps. It's not strange nowadays for client-side code to be massively more complex than whatever is happening on the server.


See Questions On Quora

Posted on 22 March 2015

Why do a few of my co-workers argue that JavaScript isn't real programming?


I'll argue with anybody about customer requirements, the best way to accomplish a particular goal, and the schedule.  However, I decided a long time ago that it's never worth the effort to get involved in arguments over who's really a programmer or which language/editor/OS is "the best."  George Bernard Shaw once wrote, "I learned long ago, never to wrestle with a pig.  You get dirty, and besides, the pig likes it it," and I can't help thinking he would have been a great programmer with that kind of attitude.

If they're not interested in learning, but (obviously) still need you to do the work, there's nothing you're going to say beyond asking them how you're getting your results.


See Questions On Quora

Posted on 20 March 2015

Why do a few of my co-workers argue that JavaScript isn't real programming?


I have a simple approach for dealing with this particular class of co-worker.

If they won't believe you when you say JavaScript is programming and that what you are doing is simple markup, agree with them.  Then offer to get them a workstation and inform them that if they understand this better than you, they must be able to do your job better than you, hand them the tools and say "Here you go!  Prove me wrong by being better than me!".

Then watch how fast they backpedal from their statements.  More often than not this is a situation of someone having a little knowledge or picked up something via osmosis and think they know a lot.  Very common among non-technical people who interact with technical staff or deal with procuring solutions.

But do not ignore them.  Challenge them and work to educate them.   As my "get them a workstation and do my job better than me" example illustrates.  Harsh but effective.  I've only had to do it a few times but it gets people who think they understand technology and implementation of it to think about what they are saying and make them "put up or shut up".

A less cruel way is to actually sit down with them and walk through the logic they believe to be missing.  Show them how the code works.  Ask them to even work with you to write it.  Either way, they'll get the message.

If you ignore them eventually they are going to make a promise to someone else, usually higher-up, that is impossible to meet but leave you holding the bag.  By not challenging their assumptions you are silently saying they are correct.  This can be a fatal, career-ending mistake. 

If you can't bring them around and show how yes, you are a programmer doing programming things, update your resume and start looking.  Such a toxic environment will eventually cause you to bear blame and outcomes that you didn't create out of their own naivete and uncorrected ignorance.


See Questions On Quora

Posted on 20 March 2015

I am Java developer who wants to learn JavaScript. Which technology, Angular, jQuery, or Node.js is better to learn nowadays?


Welcome to the front, Java developer! Good to have you.
In comparison to other languages, the JavaScript community changes methodologies, frameworks, build systems and even their virtual machines like most people change their socks. It is therefore much more important to have a fundamental understanding of the language itself, rather than learning a specific framework idiom. If you invest heavily in a certain technology, you'll be in for a world of hurt.
Luckily, JavaScript is also a very small language compared to other languages, so you'll be able to assimilate it quickly. I always recommend people to start with JavaScript: The Good Parts. It's a few years old, but since JavaScript is an open standard the language itself changes very slowly.
All that said, the things that are hot right now in the JavaScript community are (and this list is biased as hell):
  • React and Flux is the hot new thing (especially the just-released React Native. Developed and used by Facebook. It is really good.
  • Angular (the old but popular, big thing, developed by Google). Currently between two very different major versions so I'd stay away for a few months until the dust settles.
  • Backbone is a good-old MVC framework for use in the client side of things.
  • node.js and io.js. They are the same thing, where io.js is a recent fork. Think the hudson/jenkins split. Use node.js for now, but there is a good chance that io.js will win out, so be aware.
  • npm is the major package manager for JavaScript. It's has a module for goddamn everything. There is also jspm and bower. jspm is nice but too new, but Bower is stupid and should be avoided (See: Why use Bower when there is npm?
  • Browserify is the best thing since sliced bread - it allows you to use npm modules in the browser, not just the server.
  • Gulp and Grunt are build systems. Gulp is the newer one, but pretty mature. It's the one you should use.
  • express.js is what you want if you want to build stuff server-side.
  • Meteor is a super futuristic and cool full-stack framework that is awesome but does pretty much everything in a different way than everyone else. It's very popular, and you should definitely try it to get your mind blown.
  • jQuery is to JavaScript what Wordpress is to PHP. Everyone learns it and then tries to do everything with it. You should not do this. jQuery is a good tool for DOM manipulation, use it for that and nothing else.
  • Learn some functional programming. This is the best way for me to ensure that you can never go back to Java. See my answer to What is a simple explanation of higher order functions and callbacks in JavaScript?
I know, this all feels overwhelming. That feeling doesn't really go away, just embrace it. Breathe deep. Wooooo!

Shameless plug: If you like my ramblings about programming on Quora, you might enjoy my YouTube show: funfunfunction


See Questions On Quora

Posted on 12 February 2015

What is the best way to handle floating point problems with financial calculations in JavaScript?


Never use floating-point numbers for financial calculations. As you have observed, this leads to rounding problems because most decimal fractions like [math]0.1_{10} = 0.00011001100110011\dots_2[/math] have no exact finite representation in binary.

Instead, just represent all monetary values using an integer number of the smallest relevant units of the currency, e.g., cents. You don’t need a special library for this. Plain JavaScript numbers are guaranteed to be able to exactly represent every integer between [math]-2^{53}[/math] and [math]2^{53}[/math], and [math]2^{53}[/math] cents is about nine quintillion dollars.

(Don’t divide by 100 again and convert to dollars, like the example you gave. Just leave everything in cents.)


See Questions On Quora

Posted on 28 January 2015

How was JavaScript created?


Its a pretty well known story.  Netscape was trying to create a "glue language" for their browser.

We aimed to provide a “glue language” for the Web designers and part time programmers who were building Web content from components such as images, plugins, and Java applets. We saw Java as the “component language” used by higher-priced programmers, where the glue programmers—the Web page designers—would assemble components and automate their interactions using [a scripting language].

Initially they hired Brendan Eich with the intention of letting him implement Scheme into the browser.  Eventually it became apparent that Netscape's goal (who was in bed with Sun) was focused on creating a language to communicate with Java, therefore it made sense that the syntax would mirror Java's.  Eich was asked to create a proof of concept to support this approach, which he wrote in only 10 days in May of 1995 and was originally code named Mocha.

More of the the history can be found in these links:
Chapter 4. How JavaScript Was Created (o'reilly)
JavaScript (wikipedia)
A Short History of JavaScript (w3c)


See Questions On Quora

Posted on 23 January 2015

How many boring steps in programming were there for you, before it became exciting?


I got stuck playing Grand Theft Auto: San Andreas on my PC! I had to figure out a way to get rid of the update to unlock my old saves. I ended up messing with one piece of the source code that was open to modify, it was written in C (If I only had known what C is).

I went to buy this book (This exact copy) for $75. In North Iraq $75 is a lot of money:

My cousin, Misho, who was an actual Engineer at the time told me few things:

  1. First, that is C++, you wanted C, those are not that close. AND no the ++ doesn't mean a better version. (My logic back then :/ )
  2. Second, this is for someone who can understand at least College level English, wait do you even know what a TextBook is Yad?
  3. Third, why did you break the game again? It doesn't look like that you are going to be playing it anytime soon.


Hence, the journey started my friend! I went on an epic mission to fix the game back! Didn't know what was coming, it got dark really fast.



I ended up making a MOD on the game and never being able to fix it. I downloaded the free available 3D car models and added them to the game.
My first 101 programming project as a 16 years old (It was one of the most exciting things I have ever done in my life).

When I showed the game Mod to my friends, the reaction was something like this:

For those who are interested here is what the game ended up like:
Hitman: Blood Money MOD in GTA :):

I found a Forum that gave all the Car Models for free and I gave them my Mod for free. Back then startup tactics was such simple!

https://www.youtube.com/watch?v=...


See Questions On Quora

Posted on 14 January 2015

Are all dynamically typed languages as "liberal" as JavaScript?


Yes, most of them are pretty messed up, and this derives from the basic problem with: "On the left we have this thing which could be anything. On the right we have this thing that could be anything.  ¯\_(ツ)_/¯ Are they 'equal'?"

A lot of the time these "things" don't even behave like values. This kind of "flexibility" is not a virtue, and it causes innumerable bugs.

Here's PHP.



See Questions On Quora

Posted on 7 January 2015

I've been coding for some time now, and have developed several web applications entirely, two of which are largely used. To this point I haven't used any algorithms, or even much math. Why?


Jeff Darcy has hit the nail on the head. I would however like to elaborate a little more in detail. The thing which I would like to emphasize is that your understanding of algorithms helps you make a better design decisions.

I would like to give you an example of two guys Joe and Wee who are developing a search engine for wikipedia. 
Joe is a fresh programmer who recently learnt java and javascript to make a search engine. Wee is an experienced professional with good knowledge of algorithms and data structures.

Joe developing search engine.
1) Joe looks up at google "How to make a search engine" and finds top 10 results  refer to exsisting libraries like Apache Nutch™ -, Apache Lucene Core , The Xapian Project
2) Joe picks up a the first one lets Lucene goes through readme page and run an instance of it on a cloud machine.
3)He picks up pages of wikipedia and dumps it to remote server.
4) He quickly writes a javascript code to fetch data from the remote server.

Very little he know that his setup is only good till he get's the next bulk update from wikipedia.

Wee developing search engine.
1)Wee evaluates all three libraries and realizes that Lucene is not scalable for text based search and it's API's are restricted for a distributed architecture.
2) Wee know from his experience of data structures that every search engine has an inverted index table which requires consistent fetches from wikipedia whenever a document is updated.
3) In order to for the document to be updated the index must be built every time from the wikipedia. So if building index takes O(n^2) time then he can and I have roughly about 100,000 documents then building an index would take more time as compared to update frequency of a document. This means a document could take upto a month for lookup from the date it was added to wikipedia.
4) He has a checklist and quickly realizes that Open Source Distributed Real Time Search & Analytics | Elasticsearch will satisfy all of the above criteria. 
5) He builts a cloud server (using AWS instance) and runs an instance of elastic search and configures the index size and memory requirements depending on the corpus size.
6)Front end is always easy so he puts up an web based interface.

However, since he has been able to foresee better understanding of algorithms his decisions will be more long lasting in terms of selecting a tool and configuring to his own needs.


See Questions On Quora

Posted on 12 December 2014

Is it true that JavaScript is the future of programming?


There's no "future of programming" in the sense of any fixed end-point, so this question is like asking if some sort of outfit is the future of fashion.

Javascript is an extremely popular language, and its popularity is growing. The same was once true of C and C++. We can say that there's a strong Javascript trend right now, and we can't currently see an end to it. So if you are asking whether Javascript will likely be popular in five years, I'd bet yes.

The real future of programming is unknown.


See Questions On Quora

Posted on 10 December 2014

What types of jobs are available for those that know just HTML/CSS and JavaScript?


By being hired by companies that require front-end development. I don't only know JavaScript, CSS and HTML, but they're pretty much the only technologies I ever use at work, because there's so much front-end coding to do and so few other people on the team who know how to do it well. There are exceptions, but most of the server-side developers I know aren't JavaScript experts (and vice versa).

This is because the world of computing changes so quickly; there's only so much stuff one person can keep up with. To be a relevant JavaScript programmer, I have to study every single day. There are always new libraries, new frameworks, new techniques, etc. And my employers and co-workers expect me to know them. There aren't enough hours in the day for me to keep abreast of the front-end stuff and new developments in the PHP, Java, and Python worlds, too.

I've been a front-end developer for about ten years, and I've always been able to make a living at it. I imagine that, in the automotive world, there are people who specialize in building dashboards instead of engines.


See Questions On Quora

Posted on 10 December 2014

Being easier to understand and write, why hasn't CoffeeScript gained popularity over JavaScript?


I really like CoffeeScript and almost always use it whenever I can, but it it's not going to replace JavaScript. What is more likely is that JavaScript will pick up features from it over time.
1. CoffeeScript is really just very nice syntactic sugar on top of JavaScript. You have to know JavaScript to use it, and you have to know it pretty well too. Starting out as a programmer with just CoffeeScript seems like a big mindfuck for me.
2. CoffeeScript is easy to write and looks super sleek, but pretty hard to read unless you're experienced with it. The comprehensions and the fact that you can omit parenthesizes encourages writing code that is minimal, yet incredibly hard to skim for a human. One thing that I've learned from CoffeeScript that while parenthesizes are ugly, they do a lot for readability.
3. JavaScript is an OLD language. It's been around. To topple any product in any category with that kind of dominance, you need something that is not 20%, you need something that is at least 200% better. CoffeeScript is not.
4. CoffeeScript does not have any standalone interpreters - it depends on JavaScript interpreters, so there is not even the foundation in place so that it could replace JavaScript.

Shameless plug: If you like my writing about programming on Quora, you might enjoy my YouTube show: http://youtube.com/c/mpjmevideos


See Questions On Quora

Posted on 13 October 2014

Why should one use callback in JavaScript? What are its advantages?


Think about the word "callback" and how it's used in normal English: "Hey, Bob. Please call me back when you decide whether or not you're coming over for dinner."

The implication is that Bob can't answer yet. But when he's finally made a decision, I might not be around to ask him the question. So I say, "Please answer this question when you can." A callback is a way of asking a question (or requesting a task) in advance.

button.addEventListener('click', callback);

I don't know when the user will click the button. But whenever he does, I want a function called.

The whole point of functions is to set aside processing that can be done later, at any arbitrary time. When that time comes, we want the function to "call us back." Really, all functions are callbacks:

//When I ask you to call me back, here's what I want you to do:
function foo() {
  console.log('Hi. I'm calling you back');
}

//Request to be called back
foo();


Callbacks can also aid expressiveness by hiding some boring details. For instance, let's say I have an array of numbers, and I want to filter out all the ones that are less-than five. Here's a solution without callbacks:

var original = [1, 8, 7, 2, 14, 3, 5];
var filtered = [];
for (var i = 0; i < original.length; i++) {
  if (original[i] > 5) {
    filtered.push(original(i));
  }
}


It kind of sucks that I have to write out the loop mechanics, as that's a boring implementation detail. It's how the task needs to get done, but it's not what the task is. Why can't the computer take care of the how while I just worry about the what?

Here's a functional version, using a callback:

var original = [1, 8, 7, 2, 14, 3, 5];
var filtered = original.filter(function(num) {
  return num > 5;
});


There's still a loop occurring, but Javascript is taking care of it for me. I'm just worrying about what I want the loop to accomplish.

Since you can pass functions as values in Javascript, this allows you to easily defer all sorts of processing until run-time:

//assume a variable called userHatesBigNumbers
//has earlier been set to true or false.

function isSmallNumber(num) { return num < 5 }
function isBigNunber(num) { return num >=5 }

var filterFunction;
if (userHatesBigNumbers) {
  filterFunction = isSmallNumber;
} else {
  filterFunction = isBigNumber;
}

var original = [1, 8, 7, 2, 14, 3, 5];
var filtered = original.filter(filterFunction);


See Questions On Quora

Posted on 24 September 2014

What's the difference between a promise and a callback in Javascript?


I'm going to quote a blog post I wrote recently for my employer
http://engineering.onlive.com/20...


If you’ve done any serious work in JavaScript, you have probably had to face callbacks, nested inside of callbacks, nested inside of callbacks. This is especially true of code written in node.js, since every form of i/o, such as file reads, database reads and writes, and memcache access, is asynchronous, and most code needs a more than a single i/o call. You may end up with code that looks something like this:

function isUserTooYoung(id, callback) {
    openDatabase(function(db) {
        getCollection(db, 'users', function(col) {
            find(col, {'id': id},function(result) {
                result.filter(function(user) {
                    callback(user.age < cutoffAge)
                })
            })
        })
    })
}


Pretty difficult to follow. And it can get much worse. In our current node.js codebase we sometimes do as many as ten sequential, asynchronous calls. That would be a lot of nesting. Thankfully, there’s a much better way: promises.

What is a promise?

A promise is a proxy for a value not necessarily known at its creation time. With promises, rather than an asynchronous call accepting a callback, it instead returns a promise. The calling code can then wait until that promise is fulfilled before executing the next step. To do so, the promise has a method named then, which accepts a function that will be invoked when the promise has been fulfilled. As an example, the following is the above code rewritten using promises:

function isUserTooYoung(id) {
    return openDatabase(db)
        .then(getCollection)
        .then(find.bind(null, {'id': id}))
        .then(function(user) {
            return user.age < cutoffAge;
        });
}


Much easier to follow, no?

When then invokes the specified function, that function receives as a parameter the resolved value of the promise. So, for example, when getCollection is called, a handle to the database will be passed to it.

That's essentially it. If you have any questions, just leave them as comments.


See Questions On Quora

Posted on 11 August 2014

How do you program your game using Unity and JavaScript?


As a JavaScript developer, I just want to interject that you really don't. When I code for unity, I code in C#. C# is a really well-made language so it's not a pain at all.
I think "Unity does JavaScript" is a marketing lie by Unity3D and I think they should stop. The language that you write when you select "JavaScript" in the dropdown in Unity is not really JavaScript, it's some kind of weird adaptation of C# with JavaScript-like syntax. It won't accept normal JavaScript code and you won't be able to run JavaScript modules.

Shameless plug: If you like my ramblings about programming on Quora, you might enjoy my YouTube show: http://youtube.com/c/mpjmevideos


See Questions On Quora

Posted on 27 April 2014

Do most Haskell users think JavaScript sucks?


Yeah, pretty much.

Then again, it's hardly a unique position. Most people think JavaScript sucks. Some think it's a valid "worse is better" compromise, some don't, but hardly anyone holds JavaScript up as a paragon of language design.

The most famous book about it is JavaScript: The Good Parts. That characterizes it quite well, doesn't it?

Maybe they should just have left the bad parts out, eh?

Moreover, JavaScript is pretty much the antithesis of Haskell. It's dynamically typed, and even manages to get that wrong with its absolutely terrible system of coercions. This "weak typing" is, in my opinion, one of the single worst features in any programming language.

It's also staunchly imperative. Sure, it supports first-class functions, but good luck actually using functional programming! Pretty much everything is mutable, and idiomatic code uses mutation all over the place. Even if you use your own standard library functions, the DOM is still inescapably imperative—and quite easy to mess up.

Compared to Haskell, JavaScript is not very expressive. It's flexible in all the wrong ways: you can write code that does all sorts of nonsense behind the scenes, but you don't have much control over syntax. You can't write pretty code.

It's simply not a good language.

But! The platform it's attached to is worthwhile. The web makes distribution and deployment truly trivial. It also presents what I view as quite a good model for UI code with HTML and CSS, albeit rather poorly executed. Unlike JavaScript, the web as a platform at least has its heart in more or less the right place.

This is why there are so many solutions for taking decent languages to JavaScript: we want to take advantage of the web without dealing with the morass of normal web programming.

While I haven't used any of the Haskell-specific solutions, I have used
js_of_ocaml
for a couple of projects and found it to be an incredible improvement. It's just much better in almost every way. After a bit of hassle setting it up, the code was easier to write, the project was easier to maintain and everything was much easier to extend. I figure the up-front costs are O(1), but the benefits of not using JavaScript scale with, well, how much you don't use it :).

So yeah, I'd say most Haskellers think JavaScript sucks. More power to 'em!


See Questions On Quora

Posted on 26 April 2014

Is JavaScript used only for web development?


Nope! JavaScript can be used to solve a variety of problems, and the language isn't tied to the web. Here are a few examples:

  • JavaScript can be used to create Windows desktop applications or cross-platform applications via frameworks like Adobe Air.
  • Libraries like PhoneGap let you use JavaScript to create apps for iOS, Android, etc.
  • There are lots of open source JavaScript libraries that solve non-web problems. For example, Grunt (http://gruntjs.com/) is a popular automation framework, and Mocha (https://github.com/visionmedia/m...) can be used to write arbitrary unit tests.
  • Projects like Tessel (http://tessel.io) even use JavaScript to develop right on the hardware!


See Questions On Quora

Posted on 3 January 2014

Why do JavaScript programmers favor inheritance?


Honestly, I think it's because it's just what people know. They use classes because that is what they've been taught is good. 99% of the times where a programmer creates a class in JavaScript, they have not asked themselves "Is a class the best way to solve this problem?". No, they just created a class.

It's not JavaScript programmers specifically - the entire software development field has just gotten stuck at inheritance being the way you do things per default. Humans tend to find one okay-working thing that most people likes and stick with that way, because it's very beneficial if everyone does things in a similar way - you can trade knowledge and services much easier. I.e. people learn inheritance because lots of people learn inheritance. Classical OOP is what we've spent an enormous amount of time teaching people, so we know how to make it approachable, even though you need to learn words like "polymorphism". Functional programming, however, is still stuck in the academic domain.

My personal belief is that software development will use more and more functional programming during the next 10 years. Why? Because CPU core capacity will soon reach it's theoretical limit and we have to start adding more cores instead. We simply need software that can execute hundreds of processes in parallel. Most Object Oriented languages, where objects can mutate mid air, are simply not designed for this reality, but several functional languages are.

There are already quite a bit of tendencies for this already - Promises are pretty common in JS, with people using them without realizing that they are actually using Monads, one of the hardest things to grasp in functional programming. I think it will be extremely beneficial to be the kind of person that writes stuff like Q.js (https://github.com/kriskowal/q) - stuff that makes functional programming accessible to everyone, instead of just Haskell academics with beards.


See Questions On Quora

Posted on 28 December 2013

How can a developer find a technical co-founder in a week?


Don't.

Your mission is not to get accepted to TechStars. Your mission is to build a successful business.

To do so, you need to devote a great deal of time to finding your co-founder. You need to talk to lots of people, spend time with candidates, then do a trial run where you work together for a while before committing.

I'd also recommend reading the excellent "Founders Dilemmas" by Noam Wasserman. It will tell you everything about the structure and interpersonal dynamics of founder relationships that you need to know.

Spend time and get this right. TechStars isn't going anywhere.


See Questions On Quora

Posted on 23 December 2013

What companies are using Node.js in production?


We are moving every product & every site within PayPal to Node. We started the journey by using it as prototyping framework, then at start of this year we hardened it to work with all PayPal systems. We have several of our beta products out live on NodeJS and half dozen other products in flight. By end of 2014 we hope to have all major experiences redesigned, and rewritten on nodejs.

NodeJS is a forcing function to completely obliterate the old stack and the old experiences.

We are seeing big scale gains, performance boosts and big developer productivity. You can see a talk I did on this here:

http://www.youtube.com/watch?v=t...


See Questions On Quora

Posted on 31 October 2013

How would you explain objects in JavaScript to a child?


A Javascript Object is like a Mr Potato Head.

mrPotatoHead=new Object();


Every Mr. Potato Head has 'properties', or words that describe him. To assemble a Mr Potato Head out of all his properties, we can use literal notation:

var mrPotatoHead = {
     mrPotatoHead.height : "6 inches",
     mrPotatoHead.width : "3 inches",
     mrPotatoHead.isMarried : "true",
     mrPotatoHead.wife : "mrsPotatoHead"
}


Or we can use a constructor function:

function mrPotatoHead() {
     this.height = "6 inches";
     this.width = "3 inches";
     this.roasted = function(){
          var i;
          var slices;
          for (i=1,i<=mrPotatoHead.length;i++) {
               slices+=slices;
               }
          lunch = bake(slices,salt,pepper,oliveOil);
          return lunch;
     };
};


That last part is the beginning of a nice snack, but is a little advanced for children, and the bake(); method is beyond the scope of this tutorial.

Some properties describe things he has or is wearing:

mrPotatoHead.hasOwnEyes = true;
mrPotatoHead.hasOwnPants = false;




Methods are things we can do to Mr. Potato Head. Sometimes it's a simple action:

mrPotatoHead.addPants();


Sometimes we need to give him more information by adding a parameter inside the parentheses:

mrPotatoHead.replaceNose(theOneLikeAClown);





JavaScript isn't what's called 'typed', so if we put in the wrong type of variable, it will do its best even if it doesn't make sense to mix types.

mrPotatoHead.replaceRightEar(rightArm);




It will usually work anyway, but, yeah, it's best not to mix types.

Isn't that how everyone learned it? :-/


See Questions On Quora

Posted on 21 April 2013

Is it still worth learning JavaScript when HTML5 is just around the corner?


HTML5 and Javascript are not alternatives to each other. There's a small amount of overlap in functionality, meaning that there are fringe cases where you could achieve the same thing in either language, but, in general, they are complimentary languages with different features sets and use cases.

Roughly speaking, HTML5 allows you to define the initial content of the page while Javascript allows you to make changes to the page after its been displayed (e.g. when the user interacts with it). That's inexact, since JS can be used to define parts of the initial look and HTML5 can hold content that doesn't display initially, but it's one way the two languages work together, each doing its own job.

Think about how Quora displays new content when you get to the bottom of the screen. You can't do that with HTML by itself. You need JS (plus some back-end scripting) to help with that. When you're typing text in a rich text field, and you highlight it and make it bold, you need JS to turn the non-bold text into bold text.

This questions is similar to, "Since hammers are cheap, should I use them instead of screwdrivers?"


See Questions On Quora

Posted on 19 August 2012

What is the fastest scripting language on the server side?


Javascript (or more precisely ECMAScript). And it's a lot faster than the others. Surprised?

When in 2009 I heard about Node.js, I though that people had lost their mind to use Javascript on the server side.But I had to change my mind.

Node.js is lighting fast. Why? First of all because it is async but with V8, the open source engine of Google Chrome, even the Javascript language itself become incredibly fast. The war of the browsers brought us iper-optimized Javascript interpreters/compilers.

In intensive computational algorithms, it is more than one order of magnitude faster than PHP (programming language), Ruby, and Python. In fact with V8 (http://code.google.com/p/v8/ ), Javascript became the fastest scripting language on earth.

Does it sound too bold? Look at the benchmarks: http://shootout.alioth.debian.org/

Note: with regular expressions, V8 is even faster than C and C++! Impossible? The reason is that V8 compiles native machine code ad-hoc for the specific regular expressions (see http://blog.chromium.org/2009/02... )

If you are interested, you can learn how to use node: http://www.readwriteweb.com/hack... :-)

Regarding the language Javascript is not the most elegant language but it is definitely a lot better than what some people may think. The current version of Javascript (or better ECMAScript as specified in ECMA-262 5th edition) is good. If you adopt "use strict",  some strange and unwanted behaviors of the language are eliminated. Harmony, the codename for a future version, is going to be even better and add some extra syntactical sugar similar to some Python's constructs. 

If you want to learn Javascript (not just server side), the best book is Professional Javascript for Web Developers by Nicholas C. Zakas. But if you are cheap, you can still get a lot from http://eloquentjavascript.net/ and http://addyosmani.com/resources/...

Does Javascript still sound too archaic? Try Coffeescript (from the same author of Backbone.js) that compiles to Javascript. Coffescript makes cleaner, easier and more concise programming on environments that use Javascript (i.e. the browser and Node.js). It's a relatively new language that is not perfect yet but it is getting better: http://coffeescript.org/


See Questions On Quora

Posted on 10 May 2012

Does Light Table, the IDE proposed by Chris Granger in a current Kickstarter project, offer important new advances for programmers?


I'm extremely excited about Light Table.
Light Table is a completely new form of IDE, which (among other things) gives you immediate feedback when developing.
Light Table is inspired by Bret Victors absolutely genius talk "Inventing on Principle" - this talk is a MUST WATCH. Skip to 03:30 if you're strapped for time.
http://www.youtube.com/watch?v=P...

Bret's talk was just a concept, an idea, but Light Table is an actual project to bring it into reality. It's headed by Chris Granger, all around cool guy that has been coding since he was 10 years old, and has worked on developing Visual Studio at Microsoft.
But Light Table does not stop at just adding instant feedback to coding. It takes inspiration from Code Bubbles as well:
http://www.youtube.com/watch?v=P...

Whether or not it will actually be possible to create this, or if it will be practical, is impossible to tell up front. I consider Light Table to be a practical experiment to see if it can actually be done, and that is most certainly worthwhile.

Shameless plug: If you like my ramblings about programming on Quora, you might enjoy my YouTube show: funfunfunction


See Questions On Quora

Posted on 27 April 2012

How will mobile carriers react to iMessage?


AT&T responded by eliminating all of their metered SMS plans. Before the change you could pay for a certain number of SMS messages sent/received per month (500/1500 I believe).

They changed their rate plans to only have two options:

  • $0.20/message sent/received, no monthly fee
  • $20/mo, unlimited messages sent/received.

For people that receive or send over 100 SMSes per month the unlimited plan is now a better deal, and new customers are unlikely to choose al-la-carte prices when signing up for service. AT&T forces everybody into an extremely lucrative unlimited plan, leading to customers ignoring their SMS usage as iMessage/Facebook Messages/etc begin to take away their traffic.

Most users will never elect to remove the unlimited package from their monthly bill and SMS charges will become even more profitable in the long run as their overall volume decreases to zero.


See Questions On Quora

Posted on 20 October 2011

What are the most important JavaScript concepts to know for a job interview?


You will want to understand, or at least have a passing familiarity with:

  • Closures (seconding Kevin Dangoor)
  • Prototype Inheritance (ibid.)
  • The Module Pattern
  • Aspect Oriented Programming (aka "Duck Punching")
    SEE: http://paulirish.com/2010/duck-p...
  • Asynchronous Programming
  • Function Expressions vs. Function Declarations
    SEE: http://kangax.github.com/nfe/
  • For client-side development -- the major inconsistencies between various implementations of the Document Object Model (the infamous DOM).


See Questions On Quora

Posted on 11 February 2011

What is the best JavaScript library?


Echoing the other answers here, there is no "best" library -- too much of the conversation surrounding JavaScript libraries has tried to identify some mythical One True Answer, rather than taking time to analyze the problem you're trying to solve.

jQuery is lovely for DOM manipulation, Ajax, and simple event management, and it's frighteningly simple to learn, but it doesn't provide tools for developing larger applications, which may or may not be important in your particular case. YUI, Dojo, and Closure are not aimed at novices, and therefore may be more difficult to come up to speed on, but they also answer a vastly different (and larger) set of questions than jQuery intends to. Which one is "best" depends entirely on the problem you're trying to solve, and you do well to analyze a library from that standpoint, not an arbitrary, one-size-fits-all assessment.


See Questions On Quora

Posted on 5 September 2010

What companies have the best team of JavaScript programmers?


Google.  One thing not mentioned yet is that Google Maps is incredibly impressive, and it was truly groundbreaking when it came out.  Between GMail, Google Maps, and other crazy projects like Wave, the Closure Compiler, GWT, v8, etc., I think Google probably needs to be near the top of the list.

280 North.  Objective-J is a little bit crazy but also kind of brilliant.  The handful of applications I've seen made with it are all really well done.

Asana.  Lunascript looks really promising, and the people I know who work there are really excellent programmers, and I know they've been pushing the limits of what current browsers can do with JS.

I agree with Yahoo and Facebook and Mozilla.  Microsoft probably has a bunch of very good people as well just because they are so large.  I would mention Lala too but they were acquired.


See Questions On Quora

Posted on 5 May 2010

reddit.com: search results

JavaScript Fatigue?

This may be a controversial post, but I feel like people are missing something... (This is a highly opinionated post)

I see postings on here and around the internet about bloat in JavaScript, JavaScript Fatigue, etc.. With people basically saying there are so many options and ways to do something that it is confusing.

While I agree that there is a lot of libraries, frameworks, and paradigms out there for JavaScript, I don't personally find it fatiguing...

I think that the options are a good thing, it means that you can build an app that fits your personality, your coding style, your ways of doing things. All of these options also give you a way to learn in and of itself. You can't just go and use the single router library because there are tons... You have to research and make informed decisions which educates you, and builds your experience.

Just because it isn't easy, straightforward, or simple doesn't make it bad.

Pick your paradigm, pick your libraries, put a stake in it, and have fun!

Getting highly involved in JavaScript and the communities have made me a better developer over the past 6 months than my years of programming in other languages following the "norm".

Just my $0.02...

tl:dr; Enjoy the community, enjoy the awesomeness...

EDIT: Wow, thanks for the awesome conversations. I can see both sides of this situation on positive and negative notes now. This is such a complex situation, more so than I initially thought. Thank you again everyone for this awesome conversation.

submitted by /u/ShadowCodex to /r/javascript
[link] [comments]

Posted on 5 January 2016

Ten questions I’ve been asked, most more than once, over six technical JavaScript / Front-end Engineer job interviews.

I've been interviewing for JS positions over the past few months and have noticed the same questions pop up in the technical parts of the interview. There have been similar posts to this but I really received a benefit from them and thought I'd echo my experience. Two of these "interviews" were online assessments, two were in person, and two were over Skype. The positions I've applied for are mainly at start ups and not for any specified Jr / Mid / Sr level.

I know that a lot of people disagree with this type of interview, like them or not, in my experience they've been a reality. When you're self-taught and haven't had your first job, I guess you have to prove yourself somehow. An assessment of Github / portfolio links would be a more ideal measure of progress but doesn't seem to count for everything.

The good news: These were the hardest questions. More good news - everyone was completely chill in the times when I got stuck (of these questions, I got flustered on both the event loop + Pascal's triangle), more than once someone else at the table admitted they didn't know the answer, and this led to a relaxed discussion environment. The bad news - it's been really difficult to get any kind of feedback afterwards...radio silence from three of the companies. It really knocks your confidence and makes you feel like your time wasn't respected. The mental gymnastics starts..."did I actually completely bomb that interview"..."did they just not like me" etc. If you're an employer, please make sure to get back to the candidates you've interviewed. Even an automated reply is better than nothing!

Algorithmic

  1. Define a function that returns n lines of Pascal’s Triangle. (this question was the entire interview)
  2. Define a function that takes an array of strings, and returns the most commonly occurring string that array (this question came with an execution time limit)
  3. Use recursion to log a fibonacci sequence of n length.

    Definitional

  4. Explain the use cases for, and differences between — bind, apply and call.

  5. Explain event delegation and why it is useful.

  6. What is the event loop?

  7. How does hoisting work in JavaScript?

    Discussion

  8. Walk us through the process of creation of an application or website you've built.

  9. Which new JavaScript / browser features are you most excited about and why?

  10. What are the differences between functional and imperative programming styles, and explain your preference, if any.

submitted by /u/b_n to /r/javascript
[link] [comments]

Posted on 2 November 2015

How hard is it to make a game in javascript with text based graphics?

Let me just get this out of the way, I'm quite a noob in Javascript :P. I don't expect to create a game with text based graphics anytime soon, but I have recently taken an interest in it. I've mainly been looking at things like Rouge or Nethack. All that aside, would this be time consuming, and how much experience under my belt would I need to create something like this? Also, what would be the optimal tool to program the javascript in?

Netback: https://www.youtube.com/watch?v=9ZzRkJk_Vuw Rouge: https://www.youtube.com/watch?v=NBNgfrxD3qE

submitted by /u/scaryslender18 to /r/javascript
[link] [comments]

Posted on 1 November 2015

I was just rejected via email by a recruiter because they were looking for Jquery developers not Javascript? I am shocked!

So I have just started my job search after spending almost all of 2015 learning CS and programming from C to Python, JS and Rails. So yesterday I contacted a recruitment firm and I listed programming languages that I am good at, I just listed C, Javascript, and Ruby. And today I got a blunt email back saying they are only looking for Jquery developers right now.

But when I said Javascript I thought most people would think that obviously Jquery as well. I mean I even listed frameworks, and libraries like Angular and D3, as well as my Github is littered with Jquery that I often use for cloning or finding elements within a div.

I just realized that I started my approach all wrong, at first I thought companies wanted to see actual tangible working applications that show off technical skills. But I guess companies want bullet point lists of every possible redundant tech buzzword.

I know if I talk to a developer or someone who knows code, they would understand that just by looking at the project what I can offer. Do you think it would be ok to just email some of these companies myself, or do I have to go through a recruitment mill?

submitted by /u/TheBeardofGilgamesh to /r/javascript
[link] [comments]

Posted on 28 October 2015

"Real JavaScript programmers", ES6 classes and all this hubbub.

There's a lot of people throwing around this term of "real javascript programmers" regarding ES6 classes.

Real JavaScript Programmers™ understand what they're doing and get shit done.

There's more than one way to skin a cat. Use the way you're comfortable with, and do your best to educate people on the underlinings of the language and gotchas and whether you use factories, es6 classes, or object literals, you'll sleep better at night knowing how your code works.

submitted by /u/CertifiedWebNinja to /r/javascript
[link] [comments]

Posted on 6 October 2015

Anyone use Javascript for non-web projects?

I've only recently decided to invest my time and effort into Javascript for a few reasons, primarily because of it's role outside of the web. I can use Javascript in MaxMSP (https://www.youtube.com/watch?v=C1p_xI6b4NA), which is promising. Node.js clearly opens a lot of doors and now we're starting to see JS-based micro-controller units like the Tessel - https://www.hackster.io/tessel

Does anyone here use JS outside of web or mobile application purposes? I'd like to know more of what technical opportunities exist out there for JS.

submitted by /u/rpeg to /r/javascript
[link] [comments]

Posted on 3 October 2015

I'm making an RPG in JavaScript! Without canvas! Yes, I'm an idiot!

Update: I got a test version of the current build up and running if anyone wants to check it out!

Controls: Up/W, Down/D, Left/A, Right/D, Enter/Spacebar

Hello there! I am a budding JavaScript developer looking to make a name for himself (read: find employment), and so I decided making an RPG might be a fun way to test out my skills. It's far from finished, but I think I'm far along enough that I can share with people, and hopefully get some feedback!

The GitHub repo:

https://github.com/robobeau/JobInterviewStory

I'm also getting into the habit of making write-ups of the process:

http://jobinterviewstory.tumblr.com

I don't have screenshots, but here's a really quick video I posted just recently:

http://instagram.com/p/rmgJlySZpK/

I'm posting in /r/javascript primarily to get some constructive criticism on the code aspect of it, not so much the game design aspect. Also, this is technically my first GitHub repo, so if I messed up the setup instructions in any way, let me know.

Any and all feedback is welcome!

Edit #1: A clarification! I work primarily as a front-end developer and UI/UX designer. Hence, my DOM-only approach. I'm using this project as a way to hone my DOM manipulation skills, and have a little bit of fun while doing it!

Edit #2: After some of your feedback, I'm definitely going to refactor some of the code to stop relying on jQuery as a kind of framework.

Edit #3: Thanks for all the support, everyone! There's a lot of really good advice on this thread, and I'm gonna do my best to put it to good use!

submitted by /u/robobeau to /r/javascript
[link] [comments]

Posted on 12 August 2014

Do JavaScript app developers typically use object-oriented javascript?

I'm a Java Developer and i'm about to learn JavaScript and AngularJS. Do folks that make full-blown enterprise apps with things like AngularJS tend to use a lot of object-oriented JavaScript or not? I don't find the object oriented features of JavaScript to be very intuitive (i.e. prototypes etc). Do folk actually make a lot of prototypes and use inheritance etc?

submitted by /u/vt97john to /r/javascript
[link] [comments]

Posted on 14 July 2014

Why do so many Javascript libraries get this wrong?

And why does no one notice?

All too often I see a promising Javascript library follow this approach to creating classes:

function Library(a, b) { this.publicMethod = function() { return a + b; }; ...etc... } 

Instead of the superior prototypical way:

function Library(a, b) { this.a = a; this.b = b; } Library.prototype = { constructor: Library, publicMethod: function() { return this.a + this.b; } }; 

For those of you who don't understand the difference, in the first (non-prototypical) approach, every time you initialise a new Library object you also unnecessarily recreate every single method. If your class is instantiated a lot and/or has a large number of methods, this will lead to much heavier memory consumption. The other approach only creates the Library methods once to be reused in different contexts (the typical inheritance model), which is much better for memory.

Now the average jQuery plugin isn't going to see a whole lot of decrease in memory consumption by using the prototypical approach, but how has it not been the standard this whole time? It's clearly the intended way of creating anything like a class in Javascript.

I remember years back when I first started learning Javascript, every tutorial I found taught the former approach. I didn't even hear the word prototype until years later. Yet after all these years with Javascript maturing as it has I still run into recent GitHub projects that base it around the obviously inferior design approach. And no one even mentions it in the issues, even on ones with thousands of users and hundreds of contributors.

Maybe I'm missing something here...

EDIT: It seems I've stumbled upon quite a controversial topic in the Javascript community. A lot of really great points here, let's just try to not downvote comments only because we don't agree with them.

EDIT 2: It seems the general consensus is that they each have their appropriate uses. My views have definitely been challenged and I recognise that my opinion was a little flawed. This has been an excellent discussion, thank you!

submitted by /u/poisondwarf to /r/javascript
[link] [comments]

Posted on 2 April 2014

Is the option to disable Javascript in browsers outdated?

Do you think the option to turn Javascript off in most browsers is outdated?

It seems like more and more of elements of the user experience that users really like and find really useful, necessary, are dependent on Javascript. AJAX is the best example.

All of that gets bollixed up if someone shuts Javascript off. Yes, the programmer can detect if Javascript is enabled, but it seems out of date for browser makers to give the users the ability to shut off a major.....close to being a defacto standard technology, s/he may need.

submitted by /u/cyanocobalamin to /r/javascript
[link] [comments]

Posted on 12 August 2013

What are your vanilla JavaScript knowledge standards that every JS developer should know?

I have an interview coming up for a front end position. I have used JavaScript while at uni for the last 2.5 years and am familiar with Modular JavaScript and other design patterns. Also am familiar with scoping in JavaScript and ...inheritance.

What other things would you recommend I brush up on? Your help would really be appreciated!

submitted by /u/js_coder to /r/javascript
[link] [comments]

Posted on 7 August 2013

Javascript != Java

3rd-party contractor came to visit office yesterday, who has "decades" of experience. Conversation came up about JavaScript in one of our products. He says, "Our product doesn't use Java." After an awkward moment with someone who works on the knowledge base nodding in agreement with him, I speak up and delineate the difference between Java and JavaScript.

Later on in the conversation, the same 3rd-party guy followed up with this jewel: "besides, what would anyone even use JavaScript for on the web?"

I proceeded to disable Javascript in my browser and show him.

tl;dr: lasers, dinosaurs, & drums made a guy's head explode

[edit spelling]

submitted by /u/raiderrobert to /r/talesfromtechsupport
[link] [comments]

Posted on 22 May 2013

I'm trying to learn JavaScript, and all of the books I've looked at begin with a heavy dose of binary and memory allocation - is it really necessary to learn this??

I fully understand that in order to be a fantastic, brilliant programmer learning about how the computer converts your code and how much memory it takes to process it could be of benefit, but as a beginning programmer, I feel like it is a great waste of my time (for now) to know that the number 114 is made up of 64 bits. I'm feverishly trying to up my skill set so that I can move out of my horrific tech support job and into the world of programming, and in order to maximize my time, is it okay to skip over this or will it haunt me further down the line?

edit: Thank you for all the feedback, insight, and encouragement! I have ordered Professional JavaScript for Web Developers and The Definitive Guide from Amazon. They won't be here for another week, so in the meantime, I am 25 pages into homoiconic's book JavaScript Allonge (a very clever and informative read!) and I'm pressing on :)

submitted by /u/have_u_restarted_it to /r/javascript
[link] [comments]

Posted on 1 February 2013

r/javascript is not Stack Overflow

I don't know how other users of r/javascript feel about this, but I think this should be a forum for discussion of Javascript itself and sharing interesting examples.

Every day new threads hit the top of the page which are just asking for help with, or critique of code. IMO, these kinds of posts belong in a different forum, preferably Stack Overflow, a link to which is posted right over there --->

Am I being a fusspot? How do other people feel about this?

submitted by /u/mitchellrj to /r/javascript
[link] [comments]

Posted on 23 October 2012

Learn Javascript

This subreddit is for anyone who wants to learn JavaScript or help others do so. Questions and posts about HTML and CSS are also encouraged. /r/LearnJavascript is sponsored by the folks at [Hack Reactor](http://www.catalystclass.com), a school specializing in teaching Javascript to fledgling programmers. HR staff members regularly post and respond to questions here.

Posted on 4 April 2012

What program do you use to write Javascript?

I hope you guys don't get this a lot. Currently I'm using Dreamweaver code mode, but there's got to be a better tool out there for OO Javascript right?

Edit: Thanks for the advice guys, I'm going to give a couple of these a shot.

Also, I was going to ask for some up-votes, so that this would be more prominent on /r/javascript, but then I remembered it was /r/javascript. 2 is enough.

submitted by /u/90yoboy to /r/javascript
[link] [comments]

Posted on 9 August 2011

Javascript is NOT a bad language

Venting here. I'm sick of hearing that Javascript is a bad language. It's not perfect (what language is?) but it is quick and easy to write clean, flexible and reusable code. It's extremely well documented. It has some sweet debugging tools (these days). I love the powerful dynamic nature of it, and the event driven programming that it enables. Occasionally I sit down with people that "used to do some Javascript back in the day", people who were left with a bad taste in their mouth. Together we (ok, mostly me) hash out some clean, concise, and readable Javascript... and I laugh as they slowly realize that they don't know as much about it as they thought they did.

I love Javascript. It's the web browsers that I usually have issues with.

submitted by /u/spiderworm to /r/javascript
[link] [comments]

Posted on 29 December 2010

JavaScript

All about the JavaScript programming language!

Posted on 24 January 2008