Hacker Newsnew | past | comments | ask | show | jobs | submit | berzniz's commentslogin

We've developed (and keep developing) a rather big application in Backbone.js - it holds up and works perfectly.

We are setting a move from it since it lacks in some areas (no POJOs, no nested, manual binding, lots of extra backbone-mini-libs required), but it does hold well at any scale.

I wouldn't direct new comers to backbone.js anymore, new trends with 10x more contributors wins over anything. I wrote about it being the C++ of JS MVC frameworks (http://berzniz.com/post/66372634868/backbonejs-is-the-c-of-j...)


Go Oz!


Thanks Tal!


Styleguides are a matter of taste and there are probably no two people in the world with the same taste. Was there a voting of this?


It's on GitHub, issue a pull request with a fix


Considering the OP of this HN thread owns the Github repo, I'm sure they're aware.


I actually work for people who I consider to be good friends. It's just something I tell people of how this industry works and why it's an awesome job.


I figured as much, most of us do. Nothing like a portable skill set in high demand.


Yes, it's only saved on your browser (LocalStorage)


This is such a bad idea that I had to comment here:

1. Doesn't scale. You do not want to hand pick text all over your site/web-app. 2. It's not semantic. 3. It's very confusing to new people who looks at your code. 4. If you ever change a single char in that sentence, you will have to re-break it yourself.


Thanks for commenting. It's a great idea from a design and readability perspective. It sounds like you do not like my implementation - you could be right. Here is another way of doing it.. maybe I'll update the post late:

<div class="desktop-breakline"></div>

with the appropriate @media query.

It's obviously not for every situation. But for landing and marketing pages, headlines, etc, I'd go as far as to say it's absolutely essential.


I've also done simply:

<span class="line">First line</span> <span class="line">Second line</span>

Make em block level in css, collapsing to display:inline at small sizes. (Can even set the size with a specific class, bootstrap-style).


Yeah that works, but it creates a lot of code. <hr> is just 4 characters, and reminds me a lot of <br>, so its easy to read. Once you adapt your perspective to it, it becomes really awesome.


<hr> is a poor choice from an accessibility perspective. You should use a <span> instead.


var getJSON = function(callback) { // did async work to get the JSON data and now I want to call the callback function, but is it there? callback && callback(data); };

getJSON(); // See how I don't care about the result


While introducing new developers to work on the JS part of our codebase (node & client side) - I noticed some puzzled looks here and there.

Not everyone understands why && and || are used outside of if statements. Not everyone knows about joining strings using an array.

This summarises the things you'll have to know to read code in our codebase.


I would be concerned by someone not knowing || - it is used all the time by almost every major project. Not knowing what that one did outside of an if functions tells me 1.) Said person hasn't actually looked at any code other than their own OR 2.) They saw it and didn't care enough to learn what it did. Either way, strike against them.

The && though, I've never used in this context. And I'm not sure if I've seen it out in the wild or not. I knew what it did right away so I imagine if I have seen it before I wouldn't remember.


Or 3.) They are new developers. I learned to use that at some point and so did you.


Well yes, absolutely, but the context was someone being hired for a job and seeing the codebase. Someone that green is, at least in my opinion, not yet qualified to be hired as a programmer.


I second that.

I use the || trick really often, but never the && one.

By the way, why not use a one-liner if instead?

if (condition) something;

I find more readable this way.


It is definitely more readable. Best practices would say always to use curly braces though. I go back and forth on my opinion of that.

Also, for example I use a sublime plugin to automatically tidy my code, and that isn't an option in it, so I don't do it anymore.


Don't they know about the join operator at all, or is there something else here?

What else would you join if not arrays?


Tell a novice JS developer to concatenate a list of strings: "first", "middle" and "last" into "first, middle, last".

You'll probably get a solution using loops and a check if adding a comma is needed or not.

I know, I asked my friends. Ask your new teammates.


Reactjs is very interesting as well. The thing that looks weird there is the HTML inside the JavaScript code.


Handlebars does the same thing with it's "templates". A little irritating when I don't get HTML syntax highlighting since it's in the script tag. I'm sure there's a sublime plugin out there somewhere to fix that.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: