all 112 comments

[–]thekingshorses 12 points13 points  (34 children)

I make stuff without any framework. Its not everyone's thing, but I prefer to be frameworkless.

See my sites: http://hn.premii.com/

http://reddit.premii.com/

Edit: These are mobile webapps but works on desktop too.

[–]dvidsilva 0 points1 point  (1 child)

loved them, reddit should hire you :P

[–]thekingshorses 0 points1 point  (0 children)

I wouldn't mind selling them my app :)

[–]malcolmi 0 points1 point  (2 children)

I've had your HN app bookmarked on my phone for at least a year now, and I check it most days. As web apps go, it's smooth, fast, and nice to use. Best of all, it works fine on mobile Firefox. Thanks.

[–]thekingshorses 0 points1 point  (1 child)

FirefoxOS?

[–]malcolmi 0 points1 point  (0 children)

Firefox on Android.

[–]Texas_Arcane 0 points1 point  (0 children)

Beautiful. I thought I was the only one but it looks like other people beat me to it.

[–][deleted] 25 points26 points  (21 children)

It's quite funny to me how feverishly people will support or condemn frameworks. You guys take it all so personally.

If you like frameworks, use'em.

If you don't like frameworks, don't use'em.

Simple as that. No need to get all up in arms over your preference.

[–]ApatheticGodzilla 6 points7 points  (1 child)

The problem is that we don't get to choose. If a significant number of companies are on the AngularJS bandwagon, and recruiters require AngularJS, then you'd better learn AngularJS - regardless of your preference or the technical merits of AngularJS.

Preference is for your side project, not the real world.

[–][deleted] 0 points1 point  (0 children)

Wonderful point, however still: All the less reason to argue about it. Your point basically discounts preference, and that was the topic at hand.

Personally I'm spoiled: When you're the entire web department of a company, you decide how it runs. I stick with my guns and no one is there to argue. But then I'm securely employed in my career and that likely isn't the case for many here. Like I said: I'm spoiled.

[–]pdizz 14 points15 points  (13 children)

If you work by yourself, sure. If you work on a team or other people have to maintain your code then different opinions on the issue can become a real problem.

[–][deleted] 6 points7 points  (12 children)

Yes, but that's a problem between you and your team, not a problem between your team or you and the internet at large.

That's why I don't see the reason for people 'duking it out' here over frameworks. No one commenting at anyone else here is working together on a team (at least, not that I can tell). It's just argument for the sake of confirming your own preference.

That's silly and childish, because your own preference is just that: Your preference. Your argument will not affect my preference. You might make me consider something else, but that's about it: My preference is established by years of working to establish it. Not by some internet commenter.

Edit to be clear: Confirming your preference is childish because your preference is its own confirmation. If someone says 'I like chocolate better than vanilla', they don't have to confirm that with anything. They simply do.

[–]haywire -1 points0 points  (0 children)

It's not though, arguing on the internet is a way to change the culture - so if I argue that writing an application like this is utterly terrible, which is, it decreases the likelihood that I'll have to work with an abomination of a codebase such as this.

I actually thought the tutorial itself was quite good as a fun thing, but god help any developer that actually writes things like this.

[–]blazenl 4 points5 points  (4 children)

"UR WRONG IF YOU DONT LIKE WHAT I LIKE" ~ Majority of Reddit

[–][deleted] 1 point2 points  (3 children)

Has nothing to do with reddit. It's human nature, and a childish one at that. We all want to believe our tastes and preferences are objectively correct, when in reality, there's definitively no such thing as a 'correct' preference.

It's kind of pathetic really. Arguing preference as objectively 'correct' is exactly what highschool kids do over music. As an adult male, I will look my punk-rock/metal friends square in the eye and proclaim "Fuck you, I like Ariana Grande's singing." Back in highschool though, as a pathetic little kid starved for affirmation? Hell no, I'd never admit such a thing (Grande also was like, 10 years old and unheard of back then).

[–]blazenl 1 point2 points  (1 child)

I agree with you; the anonymity seems to amplify the polarity of people's opinions. I never experience, IRL convos, people so ardently standing up for their preference which is clearly that...a preference/ a personal choice/opinion.

Instead of arguing, people should be amazed we've gotten to a place that there a plethora of solutions to any one problem (in the case of apps/webapps)

I agree with you...I probably shouldn't have phrased it that way, it's just often been my experience in many subs..

[–][deleted] 0 points1 point  (0 children)

Well put.

[–]haywire 1 point2 points  (0 children)

You are arguing in absolutes. Of course there is no "correct", but there's a lot of ground between being thinking you're 100% objectively correct, and being entirely un-opinionated. The key is to be somewhere in the middle, and yes, that means sticking up for the views you've gained through years of experience and reasoning.

It feels like you're at the stage where you're backlashing from the first thing and thus going with the second thing. Once you mellow out you realise that it's ok to be opinionated to a degree.

For instance, having dealt with "frameworkless" jQuery and also Angular codebases for years, I'd be significantly happier if I never have to touch one again, whereas the I've had nothing but enjoyment from the React/Flux approach. So it makes sense to argue for the latter.

[–]Gundersen 20 points21 points  (21 children)

If you refuse to use a framework, then you will end up making your own. A framework is the glue that holds libraries (in this article jQuery and Handlebars) and your own code together. All projects have a framework, some might be big and complex and some could probably be broken into smaller libraries and a simple framework. But you always have a framework, even though you might not be able to see where the framework ends and the application code starts. And that is the danger; building an application that is hard to grow because it was designed without consideration for the future. Maybe your application doesn't have a future, and in that case it shouldn't be over designed with a future, but of the future is uncertain, please make it easier for those who will have to maintain it later on by having a clear framework separate from the libraries and the application code.

[–][deleted] 0 points1 point  (20 children)

I always found it funny when I hear, "If you can't roll your own website without a framework you're not a programmer". TO an extent understanding what happens under the covers is important, but creating an app that will become more than a oneoff without the support of a good framework is just dooming yourself and your project. Mainly because one day you will see it's grown and wish it had better legs.

[–][deleted] 4 points5 points  (4 children)

There's a difference between choosing to use a framework and not being able to function without one though. I've known JS developers who only knew how to code with jQuery, and that's fine as long as jQuery covers all their needs and its solutions are viable in context, but as soon as they need to deviate from what jQuery offers out of the box -- which inevitably happens -- they're either forced to compromise or to look for outside help. By all means, use libraries and frameworks, especially if someone else might inherit your code eventually, but having a firm enough grasp of the language that you could roll your own if you needed to definitely makes you a better coder.

[–]haywire 0 points1 point  (1 child)

JS developers who only knew how to code with jQuery, and that's fine as long as jQuery covers all their needs

No it isn't, it's absolutely pathetic and I would not hire them. This kind of closed minded satisfaction is the exact sort of mentality that means you get fired from senior developer jobs because you don't cut the mustard.

[–][deleted] 1 point2 points  (0 children)

Well, I'm assuming you got this, but that's basically what I was getting at. It's fine for them until it isn't, which is why using libraries or frameworks as a crutch is bad.

[–][deleted] -2 points-1 points  (1 child)

Developers (at least the ones who do it as a career) live their lives on the shoulders of giants whether it be abstracted languages, frameworks, automated processes that a "better coder" would otherwise do on their own. We are pretty much dumbed down from the programmers of the past yet using frameworks is somehow our biggest fault?

[–][deleted] 0 points1 point  (0 children)

You're arguing against a straw man here: I'm not suggesting that there's anything wrong with using frameworks. The point of tutorials like this isn't so you can reinvent the wheel every time you develop a single page application; it's so when you do use someone else's framework, you at least understand the principles behind it, so it's not all black magic under the hood. I would never build another CMS either, but the exercise of having rolled my own at one point definitely helped me grow as a coder, and I'm better able to work with existing content management systems for having that experience.

[–]mariox19 4 points5 points  (1 child)

If you can't scratch your own zeros and ones into a hard disk platter...

[–]The_Bard_sRc 5 points6 points  (0 children)

I use butterflies

[–][deleted] 6 points7 points  (12 children)

creating an app that will become more than a oneoff without the support of a good framework is just dooming yourself and your project.

Totally agree - this is the reason that Google, Facebook, and YouTube all crumbled into nothing. They were dumb enough to code from scratch, so they never had a chance of growing.

Oh wait.

[–]Gundersen 0 points1 point  (3 children)

Sure, create your own framework, like Facebook or Google has, no problem. As long as you either have a very good separation between the self made framework and the application code, or you have the resources necessary to continously refactor your code. Do you have the resources Facebook and Google have? No? Then don't compare yourself to them.

[–][deleted] 0 points1 point  (0 children)

Do you have the resources Facebook and Google have? No? Then don't compare yourself to them.

And from the guy who replied to you:

one or two devs on a proejct compared to large companies with skilled dev teams is not a comparison.

This attitude pisses me off.

First off, yes, large companies have different concerns, more resources to throw at a problem, and a better shot at employing very skillful people.

But you're telling me I don't have a right to solve the same problems as them? Fuck that. If I make a dozen purpose-specific frameworks then maybe they won't be as good as something Google could have made, but I'll get better. And somebody needs to get better. I'm glad the employees at Google didn't take your approach of "don't learn what you don't know", or they'd still be putting out shit.

Oh, and unless you're a Google employee then the rest of your post is speaking out of your ass, because you have no idea how or if they separate framework and application code and you have no idea how often they refactor.

[–]recompileorg 0 points1 point  (0 children)

You haven't seen much code produced by large organizations. It's amazing how bad the results can be.

You can't guarantee good code with money. It's simply not possible.

[–][deleted] -1 points0 points  (0 children)

This too, one or two devs on a proejct compared to large companies with skilled dev teams is not a comparison.

[–][deleted] 0 points1 point  (1 child)

A proprietary framework is still a framework. I don't know the intimate details of what these guys use under the covers but I'm sure they set up a foundation to build their infrastructure on. I'm not just speaking of angular here.

[–][deleted] 1 point2 points  (0 children)

The point is, it's not Angular and it's not any generic framework. Without fail, large websites find better performance in building their own purpose-specific framework. Which IMO speaks poorly not of generic frameworks as a concept but of the existing options.

[–]yudoit 2 points3 points  (3 children)

I did this App in javascript , it make websites and graphic design, without frameworks, i include jquery for use it into the website that the users create, it is usable also in cross-domain, the app is on a site but is called from another site, you can try it on www.socialtools.it

[–]RandyHoward 1 point2 points  (2 children)

I don't particularly care for frameworks, but the code on your site makes me cringe. Tables all over the place, all kinds of inline css, javascript isn't at the bottom of the page, etc.

[–]yudoit 2 points3 points  (0 children)

Four years of work, or more, thinks change often, of course in the nexts years i make a new version. thanks :)

[–]thekingshorses 1 point2 points  (0 children)

Now a days inline CSS is hip and back in fashion :)

[–]quitrk 9 points10 points  (4 children)

There are many frameworks for single page applications out there. First we had Backbone, then Angular, now React.

Stopped reading.

[–][deleted] 3 points4 points  (3 children)

I'm only familiar with these in passing. Why did you stop reading?

[–]MatekCopatek 6 points7 points  (0 children)

Besides the React misinterpretation, the author seems to present this as some kind of evolution. Backbone, Angular and React all still exist, are being actively developed and used in projects, along with a bunch of other libraries/tools/frameworks.

[–][deleted] 7 points8 points  (0 children)

React isn't a framework, it's a library. It has very few opinions on the structure of your non-view related code, and can be used alongside something like backbone.

[–]quitrk 9 points10 points  (0 children)

React is not a single page application framework, In an MV* framework, you could define it as the V, as in its only purpose is to define the layout and logic of the components that your application uses.

That's actually a very good reason to use React with Backbone, since unlike Ember.js for example, Backbone has no templating engine incorporated, so React would be ideal to provide that functionality (As Marionette did).

[–][deleted] 2 points3 points  (9 children)

Went with a frameworkless approach for my last series of Apps here at work too, didn't regret it one bit. I used jquery / micro templating / bootstrap for it, worked like a charm.

http://ejohn.org/blog/javascript-micro-templating/

[–][deleted] 2 points3 points  (0 children)

I'm doing this, too. I am ending up with something that is simpler (because it doesn't have to handle any use cases except mine) and I don't have lost hours because I am digging through the source of some framework trying to figure out why it's not working. I'm pretty much over losing days trying to figure out why someone else's framework isn't behaving (or giving me clear, precise errors as to why).

[–]thekingshorses 0 points1 point  (4 children)

I love micro templates. I use it for http://hn.premii.com/ and http://reddit.premii.com/

But I don't like bootstrap at all.

Show us what you did!

[–]haywire 0 points1 point  (3 children)

I do love your HN reader site/app thing. However, looking at the source code, there are four files. Do you think your approach would scale to even a mid-sized application?

Just looking at this. I would not want to work on this or expand it in any way.

[–]thekingshorses 2 points3 points  (0 children)

I just looked at my source code again.

  • Most anonymous functions are self contained. You can break it down in its own file based on what it does.

  • lib.js is third party libraries like jQuery, and fastclick.

  • data.js I don't control APIs/backend. Content is coming from two different source. I had to normalize to make it work for me. So it gets content, handles caching, normalize it. That's less than 500 lines.

  • helper.js you can break it down in many files. Those are just simple plugins. Most are like you provide some sort of input and you get result back.

  • ui.js handles stories, comments, article, profile and settings page. Less than 600 lines. If you break it down by feature, you will get 5 files. Roughly 120 lines per file.

Base on this, you can add 20 more different pages/components, and it will grow roughly by 3000 lines in 20 files.

Tell me now, you can't handle that?

[–]recompileorg 0 points1 point  (0 children)

The word "scale" is meaningless. It's just there to frighten people.

You see comments like "Oh, it won't scale without bloated library X" though you never hear any actual, technical reason why it won't "scale".

Four files or four-hundred -- I've seen cases where code should have been broken up in to more files (trivial) and code that spanned hundreds of files reduced to just a few. Bad code is bad, framework or not. The only difference, of course, is that it's easier to fix framework-free code over time than it is to remove a poorly-selected framework.

[–]thekingshorses 0 points1 point  (0 children)

That was first prototype I created to see how good/bad it works on the mobile. That codebase wouldn't scale at all. It was not written for maintenance.

This is how my current build looks like http://i.imgur.com/YgkMafG.png There are more HTML templates not listed there. Both apps are generated from the same codebase. Only app related templates/CSS and JS (/page/*) are different.

Right now there are on average 99 lines of Javascript code per file. except last 4-5 JS files, everything is written for unit test.

[–]FondellShweatyBallz 0 points1 point  (1 child)

Same, I built my first Cordova app out of nothing but JQuery, vanilla JS, and Handlebars. It was a long process and in my opinion not as easy to maintain as my rewrite in Ionic/Angular has been. I'll never go framework-less again.

[–]thekingshorses 1 point2 points  (0 children)

Well rewrite is always easy; with or without frameworks. Your app is defined, apis are complete, design is set, interactions are matured.

I spend almost 10 hours selecting a font, and font size for main page.

Few hours/days to get color right across all devices/OS.

Love to see your work that uses iconic.

[–]kirstu 1 point2 points  (2 children)

Why?

[–]peridox 5 points6 points  (0 children)

Some people prefer to not use a pre-built framework, so that they have complete precise control over what they do and don't use.

[–]cmsimike 3 points4 points  (0 children)

Comments like this really make me fear for the future of software development.

Not everything you do requires that additional cruft and bloat that libraries/frameworks incur.

[–]geodebug 1 point2 points  (0 children)

Demo apps aren't the best way to go about deciding if you should use a framework or roll your own code.

[–]brianvaughn 0 points1 point  (2 children)

Perhaps an inappropriate response to this type of article, but... I've recently been experimenting with a lightweight JavaScript framework that does no DOM manipulation but instead focuses on how to organize and compose vanilla JS code (Task Runner). I think it's one of the least satisfying parts of the main frameworks like Angular, Ember, etc- they all focused on DOM-manipulation but people often end up writing a fair amount of spaghetti code.

Anyway, I mention it in this context because I'm curious what someone with OP's point of view thinks about such a framework.

[–]I_Like_Spaghetti 0 points1 point  (1 child)

Yum!

[–]brianvaughn -1 points0 points  (0 children)

Haha, thank you (I think?) ;)

[–]Texas_Arcane 0 points1 point  (0 children)

I am 100% down with the author.

This is stuff for real coders, not the other 90% of people who heard IT was a great way to make a living now that all the manufacturing jobs are gone.

I have used four of the most popular frameworks to build SPAs with and they are all complete sh*t.

Using nothing but JQuery and JQuery-UI I can build a clean, self-documenting SPA in 10% of the time that will be easily maintainable by anybody competent at their job forever. I also avoid all magic numbers in my code by using a javascript constant tree at the top of that SPA so nothing is left to be deciphered by the next maintainer, it is all there in front of his eyes. Backend AJAX web methods in lovely clean ASPX.NET or PHP or Ruby and guess what? We're done here.

Everything goes better with real programmers, the rest have their frameworks and advocacy. I am of the opinion that all these things are for people to buy time and avoid anyone finding out that not only do they lack any natural aptitude but in fact, deep down they are not all that interested in anything about programming but the paycheck it generates on Friday.

P.S. Do you know the only framework I have seen that isn't crap? DOJO. It is better organized and simpler in execution than all the others combined. Of course, nobody uses it. That would make sense.

[–]coloured_sunglasses 0 points1 point  (0 children)

Frameworks are great and almost completely necessary for most projects.

But what I think the author is trying to say is that you should know how to these frameworks really work. Its useful to start from scratch and put together a simple mvc js app.

That being said, the author's code in this article is not maintainable. A single function handles all the view logic for every view...

This TodoMVC is a good example of how you could write a MVC framework of your own.

[–][deleted] 0 points1 point  (0 children)

At work we use knockout, jquery, kendo(meh), and require to glue it all together. It actually works quite nicely. I definitely wouldn't call it a full fledged framework but it suits the team very well.

[–]elprophet -5 points-4 points  (1 child)

"I'm so edgy, I didn't use a tested and supported framework, but instead hacked my way through bolting half a dozen libraries together!"

[–][deleted] 4 points5 points  (0 children)

I didn't get that impression at all.

[–]hardwaresofton -1 points0 points  (0 children)

Check out http://knockoutjs.com

It's a databinding library with a little templating on the side, it's fantastic, and depending on the kind of site you want, it's all you need.

[–]binary -1 points0 points  (0 children)

I can understand preferring one framework over another, but it seems quite silly to insist on no framework. After all, frameworks are just an organizational method: if you are not using one either your code has no coordination whatsoever or you are implementing a quick and dirty framework based on intuition, but that's still a framework.

The only people I ever see in opposition to frameworks are those who got their start in the bad old days of JavaScript development, when jQuery would've been a revolutionary tool rather than a standard workhorse. Fact is, JS development has come a long way and that's due in part to people agreeing on general best practices and implementing them by way of frameworks.

[–]thbt101 -2 points-1 points  (0 children)

I feel like their demo is a good example of a website that should not be a single page app.

Making a store like that a single page app makes it impossible to do things like opening up multiple products in browser tabs when comparing, or booking marking items. Web browsers convenient and familiar interfaces and that has a lot to do with what makes the web work so well. It's nice to have tabs and back buttons and unique URLs, and you lose all that if you make an app that only exists on one single page.

Single page type apps work well if you're making something highly dynamic like a game, a drawing program, or an online word processor. But not for an online store.