





















































Hi ,
Welcome to this week’s edition of ProgrammingPro andHappy Thanksgiving if you celebrate! We're grateful for your continued support and passion for learning.
In today’sExpert Insight, we bring you an excerpt from the recently published book, Mastering Angular Test-Driven Development, which explains the concept of code smells in Angular applications—indicators of potential issues in code that hinder maintainability and scalability.
News Highlights: TypeScript 5.7 adds never-initialized checks and ECMAScript 2024 support; Vite 6.0 debuts with modern Sass API and asset updates; Cython 3.1 supports Python's "no-GIL" builds for better parallelism; and USPTO petitioned to cancel Oracle's JavaScript trademark over alleged abandonment.
My top 5 picks from today’s learning resources:
But there’s more, so dive right in.
Stay Awesome!
Divya Anne Selvaraj
Editor-in-Chief
P.S.:Thank you all who participated in this month's survey. With this issue, we have fulfilled all content requests made this month.
IMemoryCache
,IDistributedCache
, andHybridCache
and discusses when to use caching, its benefits, challenges, and patterns, including cache invalidation and metrics.StringBuilder
objects through aSecretSauce
function without unsafe operations or external interference.for
Loop in C: Presents an alternative implementation of Bubble Sort in C using a single for
loop instead of nested loops.tsconfig.json
file for Angular 18 projects, covering configurations for TypeScript compiler options.GOMAXPROCS
parameter, leading to high CPU usage.Map
,MutableMap
, andIndex
types in a version-controlled SQL database.Here’s an excerpt from “Chapter 11: Refactoring and Improving Angular Code through TDD" in the book, Mastering Angular Test-Driven Development by Ezéchiel Amen AGBLA, published in October 2024.
While your Angular application might seem functional on the surface, there could be underlying issues waiting to erupt. These issues, known as code smells, don’t necessarily cause
immediate problems but indicate areas in your codebase that could benefit from refactoring. Just like a cluttered room can be stressful and unproductive, smelly code can make it difficult to maintain, understand, and extend your application. This section delves into the world of code smells in Angular applications. We’ll explore what they are, why they matter, and how to identify them proactively. By understanding these code smells, you’ll be equipped to prioritize refactoring efforts using TDD, ultimately leading to a cleaner, more maintainable, and robust code base.
Imagine walking into a kitchen where dirty dishes are piled up high in the sink, spices are scattered across the counter, and expired food lingers in the fridge. This unpleasant scene might not prevent you from cooking a basic meal, but it certainly wouldn’t be an enjoyable or efficient experience. Code smells are analogous to this messy kitchen in the softwaredevelopment world.
Coined by Martin Fowler in his book,Refactoring: Improving the Design of Existing Code, code smells are indicators of potential problems within your code base. They don’t necessarily represent functional bugs that cause the application to crash. Instead, they signify areas that could be improved for better readability, maintainability, and long-term health ofyour code.
Code smells are not bugs, but they can attract bugs in the future. They act like red flags, warning you of potential trouble spots that could become problematic as yourapplication evolves.
Ignoring a messy kitchen might lead to unpleasant odors, fruit flies, and frustration when you need to cook a meal. Similarly, neglecting code smells in your Angular application can have severalnegative consequences:
By proactively identifying and refactoring code smells, you can dothe following:
In essence, prioritizing code smell refactoring is an investment in the long-term health and maintainability of yourAngular application.
Now that we understand the importance of identifying code smells, let’s take a look at some of the most common offenses you might encounter in yourAngular application:
10
used for pagination but its purpose is unclear. Refactoring involves replacing these magic numbers with named variables or constants. For example, useITEMS_PER_PAGE
instead of10
, making the code more self-documenting and easierto understand.Mastering Angular Test-Driven Developmentwas published in October 2024. Packt library subscribers can continue reading the entire book for free or you can buy the bookhere!
That’s all for today.
We have an entire range of newsletters with focused content for tech pros. Subscribe to the ones you find the most usefulhere.
If your company is interested in reaching an audience of developers, software engineers, and tech decision makers, you may want toadvertise with us.
If you have any suggestions or feedback, or would like us to find you a learning resource on a particular subject, just respond to this email!