Refactoring Legacy JavaScript Code to Use Classes: The Good, The Bad and The Ugly
نویسندگان
چکیده
JavaScript systems are becoming increasingly complex and large. To tackle the challenges involved in implementing these systems, the language is evolving to include several constructions for programmingin-the-large. For example, although the language is prototype-based, the latest JavaScript standard, named ECMAScript 6 (ES6), provides native support for implementing classes. Even though most modern web browsers support ES6, only a very few applications use the class syntax. In this paper, we analyze the process of migrating structures that emulate classes in legacy JavaScript code to adopt the new syntax for classes introduced by ES6. We apply a set of migration rules on eight legacy JavaScript systems. In our study, we document: (a) cases that are straightforward to migrate (the good parts); (b) cases that require manual and ad-hoc migration (the bad parts); and (c) cases that cannot be migrated due to limitations and restrictions of ES6 (the ugly parts). Six out of eight systems (75%) contain instances of bad and/or ugly cases. We also collect the perceptions of JavaScript developers about migrating their code to use the new syntax for classes.
منابع مشابه
Competition in Healthcare: Good, Bad or Ugly?
The role of competition in healthcare is much debated. Despite a wealth of international experience in relation to competition, evidence is mixed and contested and the debate about the potential role for competition is often polarised. This paper considers briefly some of the reasons for this, focusing on what is meant by “competition in healthcare” and why it is more valuable to think about th...
متن کاملOptimisation of Healthcare Contracts: Tensions Between Standardisation and Innovation; Comment on “Competition in Healthcare: Good, Bad or Ugly?”
An important determinant of health system performance is contracting. Providers often respond to financial incentives, despite the ethical underpinnings of medicine, and payers can craft contracts to influence performance. Yet contracting is highly imperfect in both single-payer and multi-payer health systems. Arguably, in a competitive, multi-payer environment, contractual innovation may occur...
متن کاملGood, bad and ugly: Exploring the Machiavellian power dynamics of leadership in medical education
Introduction: Medical education requires participation of variousstakeholders and this contributes to power dynamics operating atmultiple levels. Personality traits of an individual can affect thesmooth execution of the educational programmes and eventuallythe professionalism of the environment. With the increased focuson leadership traits in medical education and collaboration inhealth care se...
متن کاملThe Good, the Bad, and the Ugly: An Empirical Study of Implicit Type Conversions in JavaScript
Most popular programming languages support situations where a value of one type is converted into a value of another type without any explicit cast. Such implicit type conversions, or type coercions, are a highly controversial language feature. Proponents argue that type coercions enable writing concise code. Opponents argue that type coercions are error-prone and that they reduce the understan...
متن کاملIdentifying Classes in Legacy JavaScript Code
1Department of Computer Science, Federal University ofMinas Gerais, Belo Horizonte, Brazil 2Department of Computer Science, DCC Pleiad Lab, University of Chile, Santiago, Chile 3RMod Project Team, INRIA Lille Nord Europe, France Correspondence Leonardo Humberto Silva, Department of Informatics, Federal Institute of Northern Minas Gerais, Salinas, Brazil. Email: [email protected] Fundi...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
عنوان ژورنال:
دوره شماره
صفحات -
تاریخ انتشار 2017