Your Privacy

This site uses cookies to enhance your browsing experience and deliver personalized content. By continuing to use this site, you consent to our use of cookies.
COOKIE POLICY

Skip to main content

The Road to Angular 2

The Road to Angular 2
Back to insights

In 1955 IBM developed the first high level programming language, FORTRAN.  Instead of using assembly code, FORTRAN gave your punch cards the ability to use 32 statements that would be compiled down into mainframe programs.  This abstraction drastically reduced the amount of code a program required and increased developer output (and presumably, their sanity). But why am I talking about an old language from the 50s?  It seems so far removed for the popular languages that we use today.  However, for the last 60 years, FORTRAN has been consistently updated.  The language is like a time capsule for the programming paradigms of the day.  Updates were made for Modular Programming, Structured Programming, Recursion, Object Oriented Programming, and more.  Be on the lookout for FORTRAN 2015 which releases in 2018.

The amount of languages and frameworks that exist today are staggering.  To stand above the rest, one must adapt to keep up with all the new proven methodologies.  Software updates are a fact of life now and dependency management is a part of every build. A new version can be as easy as changing a number and some minor refactoring.  But what if a new update requires drastic rewrites of a codebase?  Angular 2.0 was just released on September 14th and is still in its infancy.  How do you transition? And, is it really worth it?

This type of upgrade cannot happen overnight.   This change costs development time, defers new features, and causes a divide in the development community between the old and the new. When Python 3 came out in 2008, it standardized some of the languages features and brought Unicode support.  However, without specialized libraries, Python 2 code was no longer compatible with new Python 3 code.  As an import heavy language, there was large incentive to continue to use Python 2 until a majority of Python libraries were ported to Python 3.  It wasn’t until this year that Ubuntu finally started including Python 3 in its distribution, 8 years after Python 3’s initial release.

Right now the web framework AngularJS is going through a similar transformation.  In 2014 they announced that AngularJS will be rewritten for the modern browsing experience.  Inspired by concepts from competing technologies like React, Angular 2 promises to be modular, fast, and easy to maintain.  This sounds great, but these new features do not just plug into existing Angular code.  Angular 2 recommends using TypeScript instead of JavaScript.  Templates are now made up of a tree of specialized components that handle defined inputs and outputs.  The almighty “$scope” is gone for good.  In a large application written by many developers, refactoring for Angular 2 seems impossible.

Fortunately, I think the Angular developers learned from the past, and want to avoid having a large disconnect for the next 10 years.  They have released an upgrade guide that provides a clear path for developers going forward.  What I find clever is this path will improve your AngularJS code, even if you decide not to upgrade.  There are two things you can do today that will make your code cleaner with the added benefit of increased Angular 2 readiness: follow the style guide and try using the 1.5.x component directive.  If you haven’t looked at the style guide before, it is a great resource for how to structure Angular code while also giving justifications on why.  As the guide highlights, using the “controllerAs” syntax is a fantastic alternative to using “$scope” and will immediately clarify which variables belongs to which controllers in the DOM.  Using the component directive will prepare you for the new workflow of Angular 2.  It will help you get used to the component lifecycle, avoid two way bindings, and understand the component tree.  These smaller pieces of code are easier to reuse, test and understand.

Once you have mastered the initial steps, and decide to move forward with the upgrade, the path admittedly gets trickier.  Additionally, like the Python 3 problem, you may rely on a bunch of Angular 1 libraries do not transfer easily.  What the framework has done is provide a “Dual Boot” set up where Angular 1 and 2 frameworks run together using the Upgrade Adapter.  This allows developers to avoid having to convert all of their code at the same time.  Used responsibly and with a timeline for conversion, I can see this being a smart choice.  However, I am worried that many applications will be stuck on this step, never fully committing to Angular 2 and dealing with communication issues between the old and the new.  But with good planning, the promise land of a modern web framework can be reached where the productivity gains make it all worthwhile.

Right now Angular 2 is in its infancy.  Developers are still apprehensive about the drastic differences between the versions.  The developers at Angular realize how much they are asking of their users and have provided a good path for transitioning.  While it is too early for many teams to begin upgrading, I recommend these five steps to making sure your app is “Angular 2 Ready:”

  • Use the style guide
  • Follow current best practices in regards to “$scope”
  • Use Components in Angular 1, understanding what benefits they offer
  • Gain an understanding of the Angular 2 syntax and workflows
  • Review the Angular 2 migration process

There is no downside to readying your app.  At worst you made your codebase cleaner and easier to maintain.  There is no doubt that this is a big change, but I look forward to using the new features of Angular 2 as it gains support and popularity in the development community.

Digging In

  • Digital Products

    Energy 2025 – Expansion of Fossil Fuels or Carbon Reduction?

    Now that the election is behind us, we have an opportunity to anticipate the possible effects on the energy industry under this new administration. What strategies will be impacted? What will remain the same? What opportunities can we take advantage of in 2025? This blog is meant to dig into these questions and provide some […]

  • Digital Products

    The Growing Importance of Digital Accessibility

    Embracing Digital Accessibility: A Moral and Business Imperative In today’s digital landscape, accessibility has become crucial for businesses and organizations. With increasing awareness and legal requirements, ensuring that digital products are accessible to all users, including those with disabilities, is not just a compliance issue but a moral imperative. At UDig, we champion ADA compliance […]

  • Digital Products

    Unlocking Business Potential: The Power of Custom Application Development

    Like any savvy business leader, you’re likely always on the lookout for tools to give your company a competitive edge. And in doing so, you’ve undoubtedly considered investing in custom application development. But the question is, how do you ensure that such a major investment in a custom web application development provides a strong return on […]

  • Digital Products

    Mastering Legacy Application Modernization: Strategies for Success

    The ironic truth of the business world is that change is the only constant. But this means that failing to keep pace with the competition and its technologies will only end with you falling behind. That’s where legacy application modernization enters the fold. When you modernize legacy applications, your team gains access to new features […]

  • Digital Products

    CTO Confessions Podcast

    In this episode of CTO Confessions, Rob Phillips, the Vice President of Software Engineering at UDig, digs into his journey from a passionate technologist in his youth to a seasoned leader in the tech industry. He shares valuable lessons on transitioning to senior leadership, the importance of understanding and articulating company problems, and the art of empowering teams for high performance.

  • Digital Products

    Navigating the Challenges of On Premise to Cloud Migration

    In today’s rapidly evolving technological landscape, the shift from on premise solutions to cloud-based infrastructure has become a pivotal transformation for organizations seeking to modernize their IT operations. This transition holds the promise of increased agility, cost savings, and enhanced scalability. However, it is not without its set of formidable challenges that organizations must navigate. […]