
Making the Switch: The Reality of Moving from Windows to Mac for Your Software Engineering Team
If you have a team of software engineers and want to move them to Mac, you will need to consider a number of things before you do so.
If you have a team of software engineers and want to move them to Mac, you will need to consider a number of things before you do so.
Here’s what’s new in our January 2023 Release Notes:
* Tables Columns Sorting Improved
* Reconcile Commits Count Between KPI Card and the Table
* Efficiency Tab Improvements and Efficiency KPI Cards Align
“For sale: baby shoes, never worn.” This six-word story is attributed to Ernest Hemingway. As a software developer, the code you write will never make it onto the New York Times “Best Sellers” list. Your code will never receive the critical acclaim of a Shakespeare, Dickinson, Poe, or an Orwell. Using cognitive complexity as a coding metric can help your developers write better quality code. They’ll be able to read and understand it faster and find bugs easier, so they can spend more time actually writing code.
Cognitive complexity for software code is a metric formulated by G. Ann Campbell from Switzerland’s SonarSource SA. You can download Code Complexity: A new way of measuring understandability for a complete technical overview of how it works. Cognitive complexity measures how difficult code is for a human to read and understand. Devised in 2018, it’s a comparatively new, but very insightful measurement for software developers. The concept of cognitive complexity in psychology goes back to 1955 with the work of James Bieri.
It’s sort of like the Flesch reading ease score, but for coders. Improving cognitive complexity will make it easier for other coders to understand. Writers of articles and books use Flesch to write so their audience will understand them. That means short sentences and simple words for young students. University graduates can (usually) understand multi-syllable words and longer sentences. Even so, simpler is better.
Cognitive Complexity is quite different from Cyclomatic Complexity. Cyclomatic Complexity is a metric used to how complex a program is, particularly for testing. There is no inherent correlation between the two. A program’s code can be difficult to test, but easy to understand, and vice versa.
Only people who write code actually read code. Mostly. While it’s not for entertainment, code sometimes includes elements of humor, horror, and mystery. Most coders would agree that good code doesn’t include any of that. The simpler it is, the better, because:
You’re really writing code for everyone else who follows in your footsteps. You don’t know how skilled or experienced they are with the programming language you’re using. For these reasons, best practice is to write code that explains itself.
Per the complete technical details, Cognitive Complexity is calculated according to three rules:
1. Ignore structures that allow multiple statements to be readably shorthanded into one
2. Increment (add one) for each break in the linear flow of the code
3. Increment when flow-breaking structures are nested
There are four types of increments: Nesting, Structural, Fundamental, and Hybrid. Each type of increment adds one to the Cognitive Complexity score. Paying attention to the type of increment can be helpful in understanding how complexity is accruing and how it can be simplified.
The following screenshot from the Cognitive Complexity pdf showing the same amount of code for the same basic purpose can vary quite dramatically in its ease to understand.
It’s best to have no more than 2-3 parameters for a method. If you need more, you can include all of them in a class – and pass the object.
{
//Logic to update Customer
}
public void updateCustomer (String customerName, Integer CustomerId, String customerNiche, Double customerSalary)
Try to use no more than 2-3 elements for the method
{
//Logic to update Customer
}
public void updateCustomer (Customer customer)
Use Object of Customer class
Fortunately, nearly every programming language code is written and reads from left to right, then down. But, if we were to suddenly shift to how it’s not always that simple in design – we’d be breaking the flow. That’s not to say that we can’t, only that doing so adds complexity to the discussion. And, if we were to get into the languages that read right to left, or top-down and left to right, it would get even more complex.
Simple | Complex |
---|---|
Java | Java |
if (env.debugMode()) { System.out.println(“Hello, world!”); } | while(theWorldTurns) { if(isMorning) { try { if (env.debugMode()) { System.out.println(“Hello, world!”); } } catch (BadDay e) { System.out.println(“Yikes!”); } } } |
Nesting conditionals and loops, and other components like goto or if adds complexity and makes the issue harder for other developers to find.
Cognitive Complexity has several uses, even if it won’t make you into a Hemingway. For team development, it is worth addressing in your coding standards. Three inherent benefits immediately spring to mind.
So, even if it doesn’t turn developers into world-renowned writers like Hemingway, it will help improve their skills and the quality of their code. Besides, software developers make more than the vast majority of writers.
If you have a team of software engineers and want to move them to Mac, you will need to consider a number of things before you do so.
Here’s what’s new in our January 2023 Release Notes:
* Tables Columns Sorting Improved
* Reconcile Commits Count Between KPI Card and the Table
* Efficiency Tab Improvements and Efficiency KPI Cards Align
Here’s what’s new in our December 2022 Release Notes:
* Developing Improvements for On-Prem Data Processing;
* Improving Jira Data Connection;
* Aligning Metrics throughout the Application.