News for hackers. Stuff that matters.
Re:Teach Yourself a New Programming Language in 21 Minutes (... by ghc on Monday August 19, 2013 @11:13PM (#6241481)

    But this strategy is especially awful if you know you
    don’t plan to ever actually learn the language, but you
    turn out to be wrong. It ends up that you find yourself
    using it on a regular basis, and hilariously, you don’t
    even notice this for years and years.
This is especially true of my relationship with Javascript. First I held it at arm's length, then I learned a bit when jQuery and other frameworks were first released...at least enough to get by. Then, about 3 years later, CoffeeScript came out and I embraced that. Now I find myself, thanks to AngularJS, back at Javascript, and truly embracing the language for the first time.

Javascript will never be my favorite language, but after 10 years of finding every way to avoid using it directly, and 2 repentant years of truly mastering it, I can at least finally say that I know it well.

Re:Teach Yourself a New Programming Language in 21 Minutes (... by ocfx on Tuesday August 20, 2013 @01:23AM (#6241965)
Could you explain some of the reasons for needing a client side framework for a web app? I've always just used requirejs and wrote modules and that has worked for me as I try to keep as much server side as possible, but I realize my experience in the industry is limited so I wanted to hear some arguments for client side frameworks. I've been flamed in a few freenode channels just for bringing them up.
Re:Teach Yourself a New Programming Language in 21 Minutes (... by digitalzombie on Tuesday August 20, 2013 @03:50AM (#6242321)
I'd like to answer this.

You're separating layout logic/codes to client side.

Not only that but your server side code is now basically a web service, usually Restful. So it's real slim and all it does is serve data. And your client side will be the one responsible for rendering the data.

This also may forces your layout code to be front end, which people can steal, but it put more emphasis on the value of your data. Then again you can steal webpage design css/html all the time... likewise with javascript anyway.

And another reason for using client side MVC is because they want their web application to act like an application and less of a webpage so you'll hear the term single page application a lot. It's a whole a trend, they created AJAX so it's less like a webpage more like a web application.

Of course it depends on your project/website and it requirement and if it's more like an application or more of a website.

There are some drawbacks to this, SEO namely for angular but you can have work around like phantomjs. Not so much for ember.js (I'm about to learn ember soon...).

Re:Teach Yourself a New Programming Language in 21 Minutes (... by ghc on Tuesday August 20, 2013 @08:27AM (#6243221)
Imagine you're building a desktop application that does something like take a bunch of sensors from an attached serial port device and displays configuration of them + a table of their values updating in real time.

You wouldn't create every GUI element from scratch. You'd use the built-in Windows components (these sorts of apps are almost always windows-exclusive).

Now imagine you're building a web app that does the same thing, except now it's hosted on the embedded system and you get to it via web browser. You're going to want it to behave like a desktop application. Adopting client-side GUI frameworks like ExtJS was so common you wouldn't think twice about it. The reusable components make it much closer to a desktop application than a website.

If I were still building applications like that, I think I would still use ExtJS, warts and all. It's perfect for table-and-tree-driven application.

Nowadays, if I want to build SPAs, I use AngularJS. It's hard to overestimate just how much of a revelation that kind of client-side framework is.

TL;DR - In industry you often can't keep much server side. Instead you have to talk to lots of services and APIs directly from the browser. Additionally, you may need standardized GUI components that are familiar to people who only use desktop programs for the most part. Those two areas are admirably served by client-side frameworks like AngularJS in the first instance and ExtJS in the latter.

Re:Teach Yourself a New Programming Language in 21 Minutes (... by jaxytee on Tuesday August 20, 2013 @02:44AM (#6242163)
The Mode View * client side frameworks help to separate concerns of storing the data relevant to your app (models), creating the abstractions responsible for displaying the models to the user interface (Views), and managing the routing of your app (* or sometimes called controllers) within your application. These separations help to make code in your application more reusable, easier to debug, and easier to modify.