<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Loreley</title>
    <description>The latest articles on DEV Community by Loreley (@msoblivion).</description>
    <link>https://dev.to/msoblivion</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F726456%2F4c9cd09d-1467-4ed5-a888-5eda1ed3a9e8.jpeg</url>
      <title>DEV Community: Loreley</title>
      <link>https://dev.to/msoblivion</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/msoblivion"/>
    <language>en</language>
    <item>
      <title>Lines of Code (LoC)</title>
      <dc:creator>Loreley</dc:creator>
      <pubDate>Thu, 11 Nov 2021 08:33:20 +0000</pubDate>
      <link>https://dev.to/msoblivion/lines-of-code-loc-51e6</link>
      <guid>https://dev.to/msoblivion/lines-of-code-loc-51e6</guid>
      <description>&lt;h2&gt;
  
  
  Lines of Code (LoC)
&lt;/h2&gt;

&lt;p&gt;There are several metrics you can deploy to analyze the code size and quality of an application. One of the popular metrics that you can be used is called Lines of Code, also known as LoC. If you are keen to learn more about what LoC means and why it is metric is programming, this article is for you.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Does LoC Mean?
&lt;/h2&gt;

&lt;p&gt;Lines of Code or LoC is a method used to measure the size of an application by identifying the actual count of Lines of Code it has. For instance, small software projects usually have somewhere between 500 to 5000 Lines of Code, whereas large ones can have thousands or even millions of Lines of Code (LoC).&lt;/p&gt;

&lt;h2&gt;
  
  
  Purpose of LoC
&lt;/h2&gt;

&lt;p&gt;Estimating the size of a project:&lt;br&gt;
Usually, the size of a software project can be estimated based on the lines of code it has. It is one of the metrics clients can use to determine how much they can pay for a particular software project.&lt;/p&gt;

&lt;h2&gt;
  
  
  Check size and readability of code units:
&lt;/h2&gt;

&lt;p&gt;Any software project will always have code units like classes and functions. Usually, the functions and classes that have several code lines tend to be harder to read or understand than those. So, it is usually best to split up such classes or functions to make them smaller for easy understanding and readability.&lt;/p&gt;

&lt;h2&gt;
  
  
  To determine the quality of code:
&lt;/h2&gt;

&lt;p&gt;LoC is among the most reliable parameters that are used to assess the quality of a software program. You will often realize that most experienced developers usually write less code than amateurs even when the project they are working on is the same.&lt;/p&gt;

&lt;h2&gt;
  
  
  It measures how efficient the language used to code:
&lt;/h2&gt;

&lt;p&gt;An efficient language requires writing less code to accomplish a task that would need to write several lines of code if written in another language that is less efficient.&lt;/p&gt;

&lt;h2&gt;
  
  
  Methods Used to Measure LoC
&lt;/h2&gt;

&lt;p&gt;There are two common methods used to measure this parameter that is; physical and logical methods. Here is how the two defer&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Physical Lines of Code:&lt;br&gt;
With this method, the lines of code are physically counted while&lt;br&gt;
excluding comments and white spaces.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Logical Lines of Code:&lt;br&gt;
This method measures only the number of executable statements in the code.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Let us use an example below to differentiate between these two;&lt;/p&gt;

&lt;p&gt;for (i = 0; i&amp;lt; 100; i++)&lt;br&gt;
{&lt;br&gt;
printf("hello");&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;In this illustration above this code, the segment has four physical lines of code and two logical ones. The logical lines of code are; the for statement and the print statement.&lt;/p&gt;

&lt;h2&gt;
  
  
  Pros and Cons of Using This Method
&lt;/h2&gt;

&lt;h4&gt;
  
  
  Pros
&lt;/h4&gt;

&lt;p&gt;It is easy and intuitive&lt;br&gt;
Ubiquitous metric&lt;br&gt;
Integrated into most code editors&lt;/p&gt;

&lt;h4&gt;
  
  
  Cons
&lt;/h4&gt;

&lt;p&gt;Not a reliable metric to measure a programmer's productivity&lt;br&gt;
The LoC also differ based on the experience of a developer&lt;br&gt;
The LoC will also vary based on the programming language used&lt;br&gt;
It does not have a counting standard.&lt;/p&gt;

&lt;h2&gt;
  
  
  Don't Measure Productivity Based on Line of Code
&lt;/h2&gt;

&lt;p&gt;One of the mistakes that clients and some project supervisors who are not familiar with programming make is using LoC as a metric to measure a programmer's productivity. However, using this metric will not give the right picture because the time spent coding usually varies based on how complex the project is and the experience of the programmer.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;This parameter is crucial when it comes to assessing the size and quality of software or code segments. However, it would be misleading to use this parameter to measure a programmer's productivity or the progress of a particular project.&lt;/p&gt;

&lt;p&gt;Using LoC alone to measure these two parameters is misleading because different project segments vary in complexity and take different amounts of time to accomplish, so the number of LoC written usually doesn't matter.&lt;/p&gt;

</description>
      <category>programming</category>
      <category>codequality</category>
      <category>codereview</category>
      <category>database</category>
    </item>
    <item>
      <title>Code Quality Software That Makes A Difference!</title>
      <dc:creator>Loreley</dc:creator>
      <pubDate>Fri, 15 Oct 2021 12:35:18 +0000</pubDate>
      <link>https://dev.to/msoblivion/code-quality-software-that-makes-a-difference-98k</link>
      <guid>https://dev.to/msoblivion/code-quality-software-that-makes-a-difference-98k</guid>
      <description>&lt;p&gt;&lt;em&gt;"There is no single question to what does best quality mean? However, one proven approach is comparing how well a given code interacts with its neighbors in the same technical domain."&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;In the world of software development, code quality often comes to mean a certain level of complexity in a code. The code that is too complex for users or developers to understand or use easily is considered low in quality. Sometimes this means that the code is too complex for even the programmers to understand.&lt;/p&gt;

&lt;p&gt;In the rest of this article, we'll take a quick look at why it's crucial to understand code quality, what constitutes "quality" in the broadest sense and how to measure code quality using some of the best software.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is code quality?&lt;/strong&gt;&lt;br&gt;
The core question arises what makes good code? Code quality refers to describing behaviors of code through descriptive names, concise comments, and style guides. A quality code meets the stated standards of coding when put into code quality check.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why does code quality matter?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Security of software cannot be ignored:&lt;/p&gt;

&lt;p&gt;High programming quality is crucial for all software teams today. And it is essential for those building security-critical applications. Professional code editors generally compile Security-critical code; these code quality tools do not allow for errors.&lt;/p&gt;

&lt;p&gt;Additionally, great code will resist future attacks, which can give you the competitive edge you need. It helps improve coding quality in terms of code maintenance and reusability, which can also reduce engineering costs.&lt;/p&gt;

&lt;p&gt;The usability and readability depends on code quality:&lt;/p&gt;

&lt;p&gt;Quite simply, excellent code quality improves overall software quality because it compiles cleanly, consistently, and with minimal defects. Therefore, it will run the same way in any environment.&lt;/p&gt;

&lt;p&gt;High-quality code carries Low Technical Debt:&lt;/p&gt;

&lt;p&gt;It also tends to prevent technical debt, which can cause you to lose money if you have to hire a professional service to fix the problems. So it's essential to make sure your team practices high-quality coding.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How to Measure Code Quality?&lt;/strong&gt;&lt;br&gt;
The question on the minds of many experienced software developers is, "How can I improve my code quality?"&lt;br&gt;
There are many different ways of measuring code quality. They range from traditional inspection of the code's structure to more modern methods like code translation or high-level languages like Java.&lt;/p&gt;

&lt;p&gt;Code correctness and code readability:&lt;/p&gt;

&lt;p&gt;In web development, code quality refers to two separate but related ideas: code correctness and code readability.&lt;br&gt;
Good code quality ensures that clients can easily understand the code; low-quality code may lead to unexpected results, incorrect behavior, and security vulnerabilities. It is why comprehensive web code review and testing are essential for every web application development project.&lt;br&gt;
Good quality code communicates every bit of its intent to developers and customers clearly and brings down the risk of misinterpretation and mistakes.&lt;/p&gt;

&lt;p&gt;Code Reliability:&lt;/p&gt;

&lt;p&gt;It's also imperative that it meets technical debt requirements. If you've spent weeks or months following a specific design, then you're well aware of how it interacts with existing code.&lt;/p&gt;

&lt;p&gt;Code Re-usability:&lt;/p&gt;

&lt;p&gt;It means that the same application can be used in different environments, and this will decrease program delays and technical debt.&lt;/p&gt;

&lt;p&gt;Code Maintainability:&lt;/p&gt;

&lt;p&gt;Maintainability measures how easily the application is changed and maintains the existing functionality.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How to improve code quality?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;What is an efficient way to ensure that the code is working? One method is to make sure your developers are up to date on what's happening in the field, so they can provide input on ways to solve bugs. These software quality assurance best practices ensure consistency in maintaining better code throughout the project.&lt;br&gt;
Another method is of improving code quality is to ensure that your team members understand the nature of the problems they are attempting to solve.&lt;/p&gt;

&lt;p&gt;Finally, make sure your team members understand how to use the right tools and techniques to analyze code quality metrics and other tools to help them improve the quality of the code they write.&lt;/p&gt;

&lt;p&gt;Moreover, make sure to include the following steps in your code improvement plan:&lt;/p&gt;

&lt;p&gt;Routine Manual or automated code reviews:&lt;/p&gt;

&lt;p&gt;While manual reviews are recommended for relatively simple projects, computerized devices can be beneficial in tackling more complex projects with a heavier debt burden. One approach developers often don't consider when they're building a web application is whether the complexity of the resulting application is reflected in the complexity of the coding base.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How Easily can New Features be added?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;One of the biggest challenges facing developers today is adding new features to a project without adding code complexity. One solution developers face is not refactor code to maintain clarity, maintainability, and quality throughout the project.&lt;/p&gt;

&lt;p&gt;It is often difficult to determine what code changes will have the most significant impact on maintainability when adding new features. Yet, it is often necessary to change the existing code to accommodate the new feature. While refactoring is possible, maintaining quality throughout the project is a real challenge.&lt;/p&gt;

&lt;p&gt;Measuring Code Smells:&lt;/p&gt;

&lt;p&gt;One of the biggest challenges facing developers today is the ability to measure code smells correctly. Code smells are described as "an accepted and expected code type or structure" that typically results from an implementation detail that falls outside the developers' understanding scope. Code smells can result from various factors, including code formatting errors, redundant code, overly broad inputs, and missing return values.&lt;br&gt;
It is especially difficult to measure quality characteristics when the code is too complex. Code professionals who focus on code quality must first understand the nature of the problem and then invest the time to develop testing methods and techniques to detect code smells more reliably and consistently.&lt;/p&gt;

&lt;p&gt;Code Quality Software:&lt;/p&gt;

&lt;p&gt;Various softwares are available nowadays for code quality analysis, locating bugs and defects, communicating the changes, knowledge sharing, and code documentation.  Most organizations are using them to understand the code quality standards before they release their software. They can also reduce the time spent maintaining high-quality software.&lt;/p&gt;

</description>
      <category>codereview</category>
      <category>software</category>
      <category>projectmanagement</category>
    </item>
  </channel>
</rss>
