<?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: FTWCougar</title>
    <description>The latest articles on DEV Community by FTWCougar (@ftwcougar).</description>
    <link>https://dev.to/ftwcougar</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%2F955197%2F0e5b79c6-dcb7-4f16-8c19-4a81fc99505c.jpg</url>
      <title>DEV Community: FTWCougar</title>
      <link>https://dev.to/ftwcougar</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ftwcougar"/>
    <language>en</language>
    <item>
      <title>Big O Time Complexities</title>
      <dc:creator>FTWCougar</dc:creator>
      <pubDate>Fri, 20 Jan 2023 22:57:41 +0000</pubDate>
      <link>https://dev.to/ftwcougar/big-o-time-complexities-4ngg</link>
      <guid>https://dev.to/ftwcougar/big-o-time-complexities-4ngg</guid>
      <description>&lt;h2&gt;
  
  
  Big O
&lt;/h2&gt;

&lt;p&gt;A method of expressing an algorithm's complexity, specifically the upper bound of the development of the running time, is known as big O notation. It is frequently used to compare the effectiveness of various algorithms and can be employed to foretell how well a specific algorithm would function with huge inputs.&lt;/p&gt;

&lt;p&gt;Using Big O notation, which places a limit on how many operations an algorithm can do, the temporal complexity of an algorithm is frequently discussed. The notation is commonly expressed as O(n), where n is the size of the input. An algorithm that runs in linear time, or O(n), for instance, will have a running time that increases most linearly with the amount of the input.&lt;/p&gt;

&lt;h2&gt;
  
  
  Time Complexities
&lt;/h2&gt;

&lt;p&gt;There are several common time complexities that are often used in Big O notation, including:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8zd8op39sc07qpsp7gdc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8zd8op39sc07qpsp7gdc.png" alt="O(1)" width="275" height="183"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;O(1), also known as constant time. No matter how large the input is, a constant-time algorithm will always run in the same amount of time.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frhuo47acxonzlucdqpuh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frhuo47acxonzlucdqpuh.png" alt="O(log n)" width="239" height="211"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;O(log n) denotes time in logarithmic terms. If an algorithm runs in logarithmic time, the execution time will gradually increase as the size of the input grows. For algorithms that split the input in half after each iteration, this is frequently the case.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgxpd5d6meu8swjoh1n18.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgxpd5d6meu8swjoh1n18.png" alt="O(n)" width="239" height="211"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;O(n), or linear time, is used as a measure. A linearly scalable method will have a running time that scales linearly with input size.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fg30amn41t32lvu48q4ug.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fg30amn41t32lvu48q4ug.png" alt="O(n log n)" width="800" height="412"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Log-linear time is represented as O(n log n). A log-linear algorithm's running time will increase quicker than linear time but more slowly than quadratic time. This is frequently true for algorithms that incorporate both linear and logarithmic operations.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3rwbaemkpjjm69h3v1ip.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3rwbaemkpjjm69h3v1ip.png" alt="O(n^2)" width="266" height="190"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;O(n^2) is a symbol for quadratic time. An algorithm that operates in quadratic time will experience a sharp increase in running time as the size of the input increases. For algorithms that use nested loops, this is frequently the case.&lt;/p&gt;

&lt;h2&gt;
  
  
  Finishing up
&lt;/h2&gt;

&lt;p&gt;It is crucial to remember that Big O notation only offers an upper bound on an algorithm's execution time and ignores any lower bounds or worst-case possibilities. Furthermore, Big O notation typically ignores constant factors, which can result in two algorithms with the same time complexity actually operating at vastly different speeds.&lt;/p&gt;

&lt;p&gt;In conclusion, Big O notation is a means to define an algorithm's time complexity. This enables us to evaluate the effectiveness of various algorithms and make predictions about how well they will work with huge inputs. O(1), O(log n), O(log n), O(n), O(n log n), and O(n^2) are examples of common time complexity. It's crucial to remember that Big O notation only offers an upper bound and ignores any lower bounds or worst-case possibilities.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>productivity</category>
      <category>tooling</category>
    </item>
    <item>
      <title>Solving FizzBuzz</title>
      <dc:creator>FTWCougar</dc:creator>
      <pubDate>Fri, 16 Dec 2022 20:41:00 +0000</pubDate>
      <link>https://dev.to/ftwcougar/solving-fizzbuzz-3lh6</link>
      <guid>https://dev.to/ftwcougar/solving-fizzbuzz-3lh6</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--S8tmhP86--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2j4pdbmdcle6oypi7toi.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--S8tmhP86--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2j4pdbmdcle6oypi7toi.png" alt="Image of FizzBuzz" width="880" height="694"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;A common way to quickly assess a candidate's coding abilities is to use the well-known programming problem FizzBuzz. The objective is to create a program that prints the numbers from 1 to a specified number, but instead of printing the number for multiples of 3, it prints "Fizz," and for multiples of 5, it produces "Buzz." Print "FizzBuzz" when the given number is a multiple of both 3 and 5.&lt;/p&gt;

&lt;p&gt;For example, the output of FizzBuzz for the numbers 1 to 15 would be:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;1
2
Fizz
4
Buzz
Fizz
7
8
Fizz
Buzz
11
Fizz
13
14
FizzBuzz
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;Here is a straightforward JavaScript version of FizzBuzz using an if statement:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;for (let i = 1; i &amp;lt;= 100; i++) {
  if (i % 3 === 0 &amp;amp;&amp;amp; i % 5 === 0) {
    console.log("FizzBuzz");
  } else if (i % 3 === 0) {
    console.log("Fizz");
  } else if (i % 5 === 0) {
    console.log("Buzz");
  } else {
    console.log(i);
  }
}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;This program iterates through the numbers from 1 to 100 using a for loop. The loop outputs "FizzBuzz" if the current number is a multiple of 3 and 5 (checked using the modulo operator%). "Fizz" is printed if the number is only a multiple of 3. "Buzz" is printed if the number is just a multiple of 5. If the number is not a multiple of 3 or 5, it is printed as is.&lt;/p&gt;

&lt;p&gt;Although this implementation is quite simple, there are a few considerations to keep in mind. The sequence of the if statements is crucial first. A number that is a multiple of both 3 and 5 should be regarded as a "FizzBuzz" rather than a "Fizz" or a "Buzz," so the check for "FizzBuzz" must come before the checks for "Fizz" and "Buzz."&lt;/p&gt;

&lt;p&gt;Second, even though the else statements are optional, they can improve readability by indicating clearly what should happen when a number is not a multiple of 3 or 5. The code would continue to function without the else statements, although it could be less evident what is happening.&lt;/p&gt;




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

&lt;p&gt;In this blog we talked about a common way to quickly assess a candidate's coding abilities using a programming problem called FizzBuzz. And showed you a way to solve the programming problem. &lt;/p&gt;

</description>
    </item>
    <item>
      <title>React Components</title>
      <dc:creator>FTWCougar</dc:creator>
      <pubDate>Wed, 07 Dec 2022 17:38:45 +0000</pubDate>
      <link>https://dev.to/ftwcougar/react-components-m0k</link>
      <guid>https://dev.to/ftwcougar/react-components-m0k</guid>
      <description>&lt;p&gt;Today we'll be talking about components built from react.&lt;br&gt;
React is a library built for javascript and is very useful when it comes to building out web applications. &lt;/p&gt;

&lt;p&gt;A component built from react looks like this&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const ReactComponent = () =&amp;gt; {
return(
&amp;lt;div&amp;gt;
&amp;lt;p&amp;gt;Hello World&amp;lt;/p&amp;gt;
&amp;lt;/div&amp;gt;
)
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It looks really simple and it is. This is useful because previously in javaScript you would have to write it all out individually telling it what the text content is and where to append it to. This way is faster and much easier to read than basic javaScript. Each component doesn't have to be that simple you can pass down props from the parent and use that to show data to the screen or for forms you can use callback functions to go up to the parent. You can also have what is called useState which can keep track of data from the user and update the web page based on that data.&lt;br&gt;
React is very useful to everyone once you get to know it. React components &lt;/p&gt;

</description>
      <category>beginners</category>
      <category>programming</category>
    </item>
    <item>
      <title>The Breakdown 1</title>
      <dc:creator>FTWCougar</dc:creator>
      <pubDate>Wed, 16 Nov 2022 16:52:02 +0000</pubDate>
      <link>https://dev.to/ftwcougar/the-breakdown-1-4do4</link>
      <guid>https://dev.to/ftwcougar/the-breakdown-1-4do4</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;"It is not enough for code to work." - Robert C Martin.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Understanding the code is just the beginning of your long sought out journey. Being able to breakdown every component of your code and explain what each part does and how it does that is a very important skill you'll need to continue with coding. If your not able to do this, it will then likely take you longer to debug you code. You'll get lost and the sauce and stress out over what is going wrong. I'll demonstrate some basic code that can be broken down.&lt;/p&gt;

&lt;p&gt;We'll break down a basic function setup&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const basicFunction = ("Parameter") =&amp;gt; {
//Your Code Goes Here
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;First the const. The const is short for constant and it means the number or in this case function doesn't change.&lt;/p&gt;

&lt;p&gt;Secondly the name (basicFunction) of the function is a name that you'll use to invoke that function (basicFunction()) be careful not to put that name in a infinite loop.&lt;/p&gt;

&lt;p&gt;Lastly the Parameter is something that you pass in when you invoke the function (basicFunction(parameter)). It's typically data that you want the function to manipulate generally user input triggers functions you wanna manipulate data with.&lt;/p&gt;

&lt;p&gt;And that is the breakdown of a function. I hope this helped some of you understand the code a little better and with this  knowledge you use it to write better code so that you understand it and others reading it do too.&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>programming</category>
    </item>
    <item>
      <title>The importance of Clean Code</title>
      <dc:creator>FTWCougar</dc:creator>
      <pubDate>Tue, 25 Oct 2022 17:52:55 +0000</pubDate>
      <link>https://dev.to/ftwcougar/the-importance-of-clean-code-5487</link>
      <guid>https://dev.to/ftwcougar/the-importance-of-clean-code-5487</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--i5c1NtWN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/awm1daiq1xofi2yvtq28.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--i5c1NtWN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/awm1daiq1xofi2yvtq28.png" alt="Clean Code" width="880" height="742"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"So if you want to go fast, if you want to get done quickly, if you want your code to be easy to write, make it easy to read." - Robert C Martin&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Clean code is very important not just to you but everyone that has to work with the code as-well. Clean coding means writing for your future self and others that will have to go back and read your code. The code is not just for the computer it is for humans to understand too.&lt;/p&gt;

&lt;p&gt;If you do not write clean code you will get lost in the sauce as my cohort would say. Code should be written in functions adding modularity and those functions should do one thing. Nested code can be hard to read and make changes to if the programmer can't even understand the code. Writing with variables and functions that have meaningful names can be helpful towards writing clean code. Writing simple code will help with writing clean code for example knowing when to use if statements and when to use ternary statements. Having all these things will lead to clean code as-well as when looking for how to fix a problem it will be solved faster with clean code.&lt;/p&gt;

&lt;p&gt;To conclude writing clean code isn't just for yourself but for others too. Just because you understand it now doesn't mean you will later. Writing clean code will allow you to work much faster as-well as anyone you are working with too.&lt;/p&gt;

</description>
      <category>programming</category>
      <category>beginners</category>
      <category>javascript</category>
      <category>cleancode</category>
    </item>
  </channel>
</rss>
