News for hackers. Stuff that matters.
Re:Frameworkless JavaScript by sync on Thursday January 09, 2014 @10:13AM (#7030850)
Not using a JS Framework? Congratulations, you've just built your own ad hoc JS Framework.

Suddenly, anyone who joins moot will have to invest tons of effort in your custom framework instead of being able to hit the ground running.

Re:Frameworkless JavaScript by Chris_Newton on Thursday January 09, 2014 @11:06AM (#7031217)
Congratulations, you've just built your own ad hoc JS Framework.

We used to call that part of software development “design”, and learning basic design skills and becoming familiar with the common strategies and techniques were prerequisites for being a useful developer. Perhaps losing that baseline is an unfortunate side effect of having readily available black box code to do many common jobs in the Internet age and being able to get moderately good results just by joining up those boxes. I don’t think this is a good thing, though. The idea that learning to find your way around a design when you start working on a new project might be considered difficult and not just something everyone routinely does is not a happy one.

Re:Frameworkless JavaScript by SkyMarshal on Thursday January 09, 2014 @11:34AM (#7031398)
In my experience, using a framework and learning design aren't mutually exclusive. Learning a framework often requires studying its source code and grokking how it works, there's simply no better documentation.

Granted that may not be quite at the level of designing your own complete framework from scratch, but imho it's the happiest middle ground between personal skill development and standing on the shoulders of giants that FOSS has enabled.

Re:Frameworkless JavaScript by coldtea on Thursday January 09, 2014 @11:34AM (#7031399)
>Not using a JS Framework? Congratulations, you've just built your own ad hoc JS Framework. Suddenly, anyone who joins moot will have to invest tons of effort in your custom framework instead of being able to hit the ground running.

That's the framework party line. Not necesarilly true. For one, somebody not familiar with, say, Angular would still have to get to know Angular (a huge task in itself) and then your application code too.

Why not just have them understand the application code only? Since it's tailored to your application it also omits needless features and workarounds for framework issues.

Re:Frameworkless JavaScript by jdewald on Thursday January 09, 2014 @01:40PM (#7032260)
I've never seen a non-trivial application that is "application code only".

Most frameworks weren't built out of thin air, but because of real application needs. Sure they have more than is necessary, but it is often the case in any non-trivial application that you end up writing a bunch of custom common "framework" code which duplicates the work that readily available frameworks (that you avoided using) had.

Any new developers then have to learn your new "lightweight templating language", "lightweight database mapper", "lightweight MVC layer", and what have you (which now you have to support even though it's not core to what your application does, but is just a support layer).

Though I guess the best part is most of these frameworks being discussed came about because an internal team wasn't happy with what was available and decided to roll their own, which eventually became big enough to release as a standalone unit.

Re:Frameworkless JavaScript by coldtea on Thursday January 09, 2014 @06:39PM (#7034032)
>Sure they have more than is necessary, but it is often the case in any non-trivial application that you end up writing a bunch of custom common "framework" code which duplicates the work that readily available frameworks (that you avoided using) had.

There are trivial apps (no need of framework, small enough), medium apps (can use a framework maybe) and serious non-trivial large apps, apps you bet your company on.

The latter are often better to NOT base into a framework. If they do anything novel, and they want to do, they'd hit framework limits. The framework will impose its logic upon your code, whether it fits or not, and you'll have all the baggage of assorted layers it offers you'll feel obliged to use.

>Any new developers then have to learn your new "lightweight templating language", "lightweight database mapper", "lightweight MVC layer", and what have you

That's totally orthogonal. That you don't use a framework, doesn't mean you can handpick any of the popular template language libs, database mapper libs etc. Instead of being constrained by the set the framework authors chose.

That is: libs, instead of frameworks.

>Though I guess the best part is most of these frameworks being discussed came about because an internal team wasn't happy with what was available and decided to roll their own, which eventually became big enough to release as a standalone unit.

That's not ironic in the slightest though. It reinforces what I said: since those teams evaluated whats available and they didn't fit their needs and rolled their one to solve their particular problems they way they want to solve them, what makes third companies think those "hand-rolled" frameworks are a good fit for THEIR needs?

The message to take away, when a company rolls her own framework is not "frameworks are good, I should use theirs", but "they saw it fit to roll their own stuff. Perhaps I should too".

After all, if you're a startup your competitive advantage is your code. You shouldn't constrain it to fit anything external.

Now, if you are a consultant or web designer delivering cookie cutter projects for a company, or an enterprise developer doing some CRUD, by all means use a framework. Especially if you aren't doing anything very creative or original in the first place.

Re:Frameworkless JavaScript by mattgreenrocks on Thursday January 09, 2014 @10:27AM (#7030955)
This sentiment, expressed collectively, commoditizes the entire profession.

How can you expect to ask for raises if all devs are basically interchangeable? If we've eradicated all notions of design, and follow prescriptive rules of structuring and solving problems that anybody can Google and follow, then what avenues are left to express technical ability? What differentiates you?

Re:Frameworkless JavaScript by cliffbean on Thursday January 09, 2014 @10:45AM (#7031081)
This sentiment, expressed collectively and somewhat unsympathetically, portrays the entire profession as prioritizing job security over true excellence.
Re:Frameworkless JavaScript by chongli on Thursday January 09, 2014 @05:12PM (#7033649)
Or one could say that it reveals the fatal flaw in our current system of capitalism:

Automation is desirable because it increases efficiency and lowers costs.

Automation is undesirable because it eliminates jobs and automatons are not consumers.

Re:Frameworkless JavaScript by vidarh on Friday January 10, 2014 @04:27AM (#7035844)
That was Marx main argument for the inevitability of a socialist revolution: That capitalism will eventually become efficient enough to on one hand create enough goods to make it possible to totally eradicate poverty, but on the other hand become efficient enough to substantially reduce employment.
Re:Frameworkless JavaScript by mattgreenrocks on Thursday January 09, 2014 @10:51AM (#7031115)
Indeed.

But excellence should mean using the right design for a program, not the Good Enough one advocated by today's fashionable framework. I'm more concerned about collective effects (such as negating the need for analysis and design).

This is yet another instance of Worse is Better.

Re:Frameworkless JavaScript by mooreds on Thursday January 09, 2014 @12:31PM (#7031786)
What is worse? What is better? Often shipping something that is 'Good Enough' is better than getting the 'right' (perfect?) design for a program.

In the post, it is clear that moot has a set of concerns that a typical business software developer doesn't have.

So, pick the right tool for your business situation, which may include a framework, or not. But I have to say, as a developer, the times when I thought I had to start from scratch and been right were far fewer than the times I wanted to start from scratch and been wrong.

That may be a testament to my skill, the problems I work on, or both.

Re:Frameworkless JavaScript by pedalpete on Thursday January 09, 2014 @11:14AM (#7031274)
I find the difference to be that each developer is now more productive and can add more function in less time.

The profession isn't commoditized, the lower end of the profession gets better, and those with the skills move up a notch and do more and more challenging things.

I used to build single-page javascript apps in pure javascript (pre-jQuery), and it was a pain. Once jQuery came along, things were easier. I actually don't think I'd have too much trouble going back and using just jQuery, but I don't think I'd be as productive as I am with backbone, angular or knockout.

Re:Frameworkless JavaScript by mattgreenrocks on Thursday January 09, 2014 @12:27PM (#7031758)
I want to believe you, but I also see that a significant portion of the industry is still on CRUD, and people still get really excited about CRUD frameworks.
Re:Frameworkless JavaScript by pedalpete on Thursday January 09, 2014 @03:49PM (#7033121)
I don't know why you were downvoted. I (think) I agree with you.

I'm assuming you mean they are on CRUD as in most projects are what I call 'simple I/O'. Data goes into a database, data comes out of a database, and the job of the developer is just to make that happen.

For the most part, that is true, but I don't think you can blame that on the 'industry', that's the 'market'. The majority of the market didn't/doesn't need anything more than that.

However, if you have the skills, there are lots of jobs out there in data-analytics, robotics, etc. etc. (depending on where you are) that probably wouldn't have been available if we were ALL neck deep building every CRUD app from scratch. The frameworks make average people right faster and better code.

Hell, they help me write better and faster code. I'm no coding genius, but I've built apps in rails, and it is faster than when I was building everything by hand in PHP.

I haven't been doing much CRUD lately, seems like Front-End has taken the majority of my time in the last few years, but that's part of the 'craft' of being a developer. I actually find front-end more challenging and rewarding than CRUD (these days) simply because frameworks have made CRUD so easy.

Re:Frameworkless JavaScript by porker on Thursday January 09, 2014 @12:32PM (#7031798)
And yet I haven't seen a convincing web CRUD framework. Have you?

I never did desktop development so don't know about there, but some must have been good.

Re:Frameworkless JavaScript by wtracy on Thursday January 09, 2014 @05:22PM (#7033704)
Isn't that basically what Rails and Django are? Or are you asking for something client-side?
Re:Frameworkless JavaScript by SkyMarshal on Thursday January 09, 2014 @11:29AM (#7031361)
It doesn't commoditize the entire profession, only the 50% of it that is common to every web site or app you ever build. The other 50% is where the artistic license, craftsmanship, business sense, empiricism, and other value-adds of your team comes in.
Re:Frameworkless JavaScript by al2o3cr on Thursday January 09, 2014 @11:45AM (#7031466)
"then what avenues are left to express technical ability"

I dunno, maybe actually solving problems for clients instead of playing endless rounds of "my JS is smaller than yours"?

Re:Frameworkless JavaScript by mattgreenrocks on Thursday January 09, 2014 @12:16PM (#7031688)
This is not about code golf, this is about the widespread automatic use of frameworks in lieu of an analysis/design/build-one-to-throw-away phase.
Re:Frameworkless JavaScript by aaronem on Thursday January 09, 2014 @10:42AM (#7031048)
Calmly, Chicken Little, calmly! Perhaps the sky is not falling after all...
Re:Frameworkless JavaScript by mattgreenrocks on Thursday January 09, 2014 @10:45AM (#7031082)
Nope, it isn't. But clinging to frameworks in lieu of actual program design can hamper your ability to design something that doesn't fit neatly into a predefined box.
Re:Frameworkless JavaScript by chongli on Thursday January 09, 2014 @05:16PM (#7033672)
Frameworks tend to arise in languages with poor composability. Composable languages favour large numbers of small libraries which can be mixed and matched in many creative ways. Composability favours design.
Re:Frameworkless JavaScript by aaronem on Thursday January 09, 2014 @10:49AM (#7031107)
Of course. But no one seems to be suggesting otherwise, that I can see, and for the relatively common case in which one needs quickly to prototype and roll out something which does "fit neatly into a predefined box", a framework is often just the thing.
Re:Frameworkless JavaScript by Zelphyr on Thursday January 09, 2014 @11:19AM (#7031299)
You touch on the one things that frameworks are actually good for: prototyping. Unfortunately they're never just used for that purpose. The prototype and all the framework cruft is then called "the product" and used as such.

And sure, then you have people who can come in and "hit the ground running" but they're little more than overpaid glue sticks. They don't understand true software engineering. They just know how to glue framework code together.

Re:Frameworkless JavaScript by scarecrowbob on Thursday January 09, 2014 @12:02PM (#7031588)
"And sure, then you have people who can come in and "hit the ground running" but they're little more than overpaid glue sticks. They don't understand true software engineering. They just know how to glue framework code together."

Is it possible that some of us have an idea about what we're doing, but have to do enough different projects that learning a common framework has enough of a benefit to outweigh writing bespoke code for everything?

I don't feel the need to write a whole language for every problem I need to solve, and I don't generally think of the language functions I don't use on a given project as "cruft".

Re:Frameworkless JavaScript by Zelphyr on Thursday January 09, 2014 @02:12PM (#7032487)
Who said anything about writing a whole language? Just know the language you're writing in well enough that you can build something better without a framework than you can with.
Re:Frameworkless JavaScript by aaronem on Thursday January 09, 2014 @03:55PM (#7033152)
Well, sure. When I need something like URL routing, or object-relational mapping, or templating, why not reinvent it from scratch every time? Or, failing that, why not handle things like that with a collection of favorite libraries, each of which has its own calling conventions, its own requirements, and its own attitude toward the world? Reconciling all those differences certainly won't take a significant amount of time, and I'm always happy to spend my efforts on tooling instead of on whatever project inspired the need for tooling in the first place.

More seriously, I can understand where you might be coming from with the implication that frameworks are a crutch for developers who don't bother to learn, or aren't capable of learning, the language in which the framework is implemented; I've had to clean up the wreckage left behind by Ruby on Rails hacks, too.

But what's important to keep in mind is that the Rails dev community is extremely atypical in its extremely low average level of basic programming capability, and the Rails framework is likewise anomalous in the degree to which it forgives such incompetence. These traits, I stress, are not common to frameworks in general or to the developers who employ them, and consequently it is very much a mistake to use the Rails ghetto as a basis for extrapolation to more or less anything else. It's your mistake to make, of course, and if you insist upon it, then I won't go to any further effort on your behalf. But you can't say no one tried to warn you.

Re:Frameworkless JavaScript by collyw on Thursday January 09, 2014 @01:44PM (#7032281)
Prototypes always end up in production, framework or not.
Re:Frameworkless JavaScript by mattgreenrocks on Friday January 10, 2014 @01:49PM (#7038517)
I've seen this happen over over to the point where work prototypes are not terribly removed from production code.

I prototype slower, but nobody cares.

Re:Frameworkless JavaScript by collyw on Sunday January 19, 2014 @01:50PM (#7085422)
I just try to write production quality prototypes these days. Django is a godsend for writing maintainable solid agile database applications.
Re:Frameworkless JavaScript by twerquie on Thursday January 09, 2014 @12:09PM (#7031634)
What if, instead of needing a framework, we just wrote tiny modules of functionality and composed them into an application?

This is how the nodejs guys are doing this via npm and I must say, it's staggering. The core node "framework" has a tiny API, and the heart of it is simply require().

Re:Frameworkless JavaScript by ianstormtaylor on Thursday January 09, 2014 @04:07PM (#7033244)
Exactly. If this kind of thing seems like your cup of tea check out component[1].

[1]: https://github.com/component/component

Re:Frameworkless JavaScript by ben_mcmahen on Thursday January 09, 2014 @08:06PM (#7034393)
This, entirely. You can effectively construct your own framework by combining other pre-established routers, models, and views (plus whatever other modules you might want). You still get many of the benefits of using frameworks (testing, docs), but it's much more flexible and has the potential to be leaner. You still need to establish best practices and a relatively consistent application design, but these are things you'd want to do anyway... even if using Backbone, or whatevs.
Re:Frameworkless JavaScript by frik on Thursday January 09, 2014 @12:38PM (#7031857)
Yes exactly! Modules like in Node.js or libraries as in PHP are a lot more flexible and IMHO better than frameworks.

I coded single page HTML5 apps in JS and Node.js/PHP and avoided any frameworks. A few helper functions are enough and I got a codebase that is easy to read, refactore and the overall code size is small and the execution is fast.

Re:Frameworkless JavaScript by mrottenkolber on Thursday January 09, 2014 @11:12AM (#7031261)
I don't use any 3rd party code for my current work as of now. So yes I have built my own "toolkit". Maybe a vector rendering library wil be required at some point, but I started off on bare bones to see how far you get.

It's not that I am generally against 3rd party code, JavaScript is just a bit special in that case. The quality of JavaScript libraries is just so outright bad that I don't have any use for most of them. I have a personal policy to only include code that satisfies my personal quality standards, if a codebase makes me cringe I will not use it but rather write my own.

Re:Frameworkless JavaScript by codingdave on Thursday January 09, 2014 @11:30AM (#7031368)
Every non-trivial app will add enough custom code to a framework that new developers have a learning curve.
Re:Frameworkless JavaScript by hadem on Thursday January 09, 2014 @10:31AM (#7030989)
Whereas had they decided to use Backbone or AngularJS I wouldn't have to invest tons of effort...? Regardless of framework (or lack there of), effort will be needed for those utilizing the API.
Re:Frameworkless JavaScript by jonny_eh on Thursday January 09, 2014 @02:19PM (#7032527)
On top of that, their new knowledge of said framework is not transferrable to their next job.

If someone works on a popular framework, it makes it easier to get the next job.

Re:Frameworkless JavaScript by rfnslyr on Thursday January 09, 2014 @02:08PM (#7032466)
It's SO much effort to spend a weekend studying a code base and playing with it. Get over yourself.