JavaScript "app" style... I think?

I have been coming across a lot of code that uses this somewhat new “app” style framework. Some of the code is AngularJS 1 and others have been things like Intel XDK or Ionic. I have even seen other types. I have found what some of these technologies are producing extremely useful. When I look at this code a lot of times I don’t understand what is going on. I would like to be able to read this like I can HTML, CSS and JavaScript and know what is going on. Is there a general subject that covers this type of structure of code and the application it creates, or will I have to focus on each particular development platform to understand? Thanks

It sounds like it would be worth you reading up on the concepts of model-view-controller (MVC) development architecture. There are other variations, such MVVM, MVA, MVP and so on, but these are perhaps what you’re encountering. There are any number of products out there that make use of this type of structuring, some of which you mention.

The other site you might like to look at is the TodoMVC site, which builds the same application over and over with some of the different products available, including plain old JavaScript, jQuery, Angular, Polymer, NodeJS/Express, React and a whole bunch of others. Give those a look and see if those will give you some further insights.

1 Like

Thanks so much this is super helpful!. The TodoMVC site… idea is something that I have tried to imagine my self doing to pick up concepts my self. Wow… now I have a good guide to follow, and wont just be figuring out everything my self. Thanks

Are you having trouble with the syntax of JavaScript, or the structure of the code?

If you’re talking about how code is structured, I highly suggest Learning JavaScript Design Patterns.

But, understand that you’ll probably never read it like HTML or CSS. HTML is just a structure. That’s what it is designed to do. It’s meant to be readable. CSS is just a set of attributes. JavaScript on the other hand is a programming language and even the best code isn’t always clear. Things are coming in from different places, going out to new places, changing, and creating and removing new stuff all the time.

1 Like

Following on from that particular Addy Osmani book, you could also take a look at this later article by him - Patterns For Large-Scale JavaScript Application Architecture

2 Likes

Great stuff. I knew that was a tad bit outdated, but still a good book. I didn’t know about this post. I will probably read it tomorrow.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.