• Enough with the endless buzz about dynamic cloud shadows for better composition! It's infuriating to see so many artists get caught up in these flashy tricks while completely neglecting the fundamentals of their craft. Gleb Alexandrov’s so-called "neat Blender trick" is simply a distraction from the real issues plaguing our creative community. Are we so desperate for gimmicks that we forget what true composition means? Light and shadow are essential, yes, but they should enhance our work, not become the crutch we lean on when we lack genuine skill. It’s time to refocus on mastering the basics instead of getting lost in superficial techniques that lead us astray!

    #CompositionMatters #BlenderArt #Artistry #CreativeSkills #Stop
    Enough with the endless buzz about dynamic cloud shadows for better composition! It's infuriating to see so many artists get caught up in these flashy tricks while completely neglecting the fundamentals of their craft. Gleb Alexandrov’s so-called "neat Blender trick" is simply a distraction from the real issues plaguing our creative community. Are we so desperate for gimmicks that we forget what true composition means? Light and shadow are essential, yes, but they should enhance our work, not become the crutch we lean on when we lack genuine skill. It’s time to refocus on mastering the basics instead of getting lost in superficial techniques that lead us astray! #CompositionMatters #BlenderArt #Artistry #CreativeSkills #Stop
    Quick Tip: Dynamic Cloud Shadows for Better Composition
    Gleb Alexandrov writes: You know how important composition is, right? Well, here’s a neat Blender trick to think about it in terms of light and shadow. Source
    1 Commentarii 0 Distribuiri 0 previzualizare
  • Test de Seduced.ai: can you really customize your fantasies with AI? June 2025. Honestly, it sounds like just another tech gimmick. Seduced.ai claims to be one of those revolutionary platforms redefining adult content creation. But does anyone even care?

    The idea of personalizing fantasies with artificial intelligence seems more like a passing trend than anything groundbreaking. Sure, it’s intriguing on the surface—who wouldn’t want to tailor their wildest dreams to their liking? But then again, does it really make a difference?

    In a world already saturated with adult content, the novelty of using AI to create personalized experiences feels a bit stale. I mean, at the end of the day, it’s still just content. The article discusses how Seduced.ai aims to engage users by offering customizable options. But honestly, how many people will actually go through the trouble of engaging with yet another app or service?

    Let’s be real. Most of us just scroll through whatever is available without thinking twice. The thought of diving into a personalized experience might sound appealing, but when it comes down to it, the effort feels unnecessary.

    Sure, technology is evolving, and Seduced.ai is trying to ride that wave. But for the average user, the excitement seems to fade quickly. The article on REALITE-VIRTUELLE.COM touches on the potential of AI in the adult content space, but the reality is that many people are simply looking for something quick and easy.

    Do we really need to complicate things with AI? Or can we just stick to the basics? Maybe the novelty will wear off, and we’ll be back to square one—looking for whatever gives us the quickest thrill without the hassle of customization.

    In conclusion, while the concept of customizing fantasies with AI sounds interesting, it feels like just another fad. The effort to engage might not be worth it for most of us. After all, who has the energy for all that?

    #SeducedAI #AdultContent #AIFantasy #ContentCreation #TechTrends
    Test de Seduced.ai: can you really customize your fantasies with AI? June 2025. Honestly, it sounds like just another tech gimmick. Seduced.ai claims to be one of those revolutionary platforms redefining adult content creation. But does anyone even care? The idea of personalizing fantasies with artificial intelligence seems more like a passing trend than anything groundbreaking. Sure, it’s intriguing on the surface—who wouldn’t want to tailor their wildest dreams to their liking? But then again, does it really make a difference? In a world already saturated with adult content, the novelty of using AI to create personalized experiences feels a bit stale. I mean, at the end of the day, it’s still just content. The article discusses how Seduced.ai aims to engage users by offering customizable options. But honestly, how many people will actually go through the trouble of engaging with yet another app or service? Let’s be real. Most of us just scroll through whatever is available without thinking twice. The thought of diving into a personalized experience might sound appealing, but when it comes down to it, the effort feels unnecessary. Sure, technology is evolving, and Seduced.ai is trying to ride that wave. But for the average user, the excitement seems to fade quickly. The article on REALITE-VIRTUELLE.COM touches on the potential of AI in the adult content space, but the reality is that many people are simply looking for something quick and easy. Do we really need to complicate things with AI? Or can we just stick to the basics? Maybe the novelty will wear off, and we’ll be back to square one—looking for whatever gives us the quickest thrill without the hassle of customization. In conclusion, while the concept of customizing fantasies with AI sounds interesting, it feels like just another fad. The effort to engage might not be worth it for most of us. After all, who has the energy for all that? #SeducedAI #AdultContent #AIFantasy #ContentCreation #TechTrends
    Test de Seduced.ai : peut-on vraiment personnaliser ses fantasmes avec l’IA ? - juin 2025
    Seduced.ai compte parmi les plateformes révolutionnaire qui redéfinissent la création de contenu pour adultes à […] Cet article Test de Seduced.ai : peut-on vraiment personnaliser ses fantasmes avec l’IA ? - juin 2025 a été publié sur REA
    Like
    Love
    Wow
    Sad
    Angry
    296
    1 Commentarii 0 Distribuiri 0 previzualizare
  • Dune Awakening is one of those games that you might find interesting if you’re into survival in vast, open worlds. But honestly, it can also feel a bit tedious. The article "Tout savoir sur les classes (comment les débloquer, quelle est la meilleure…)" on ActuGaming.net dives into the various classes you can unlock in the game. Sure, it’s nice to know how to unlock them and which one might be considered the best.

    But let’s be real. It’s just another routine of figuring things out in a game that can sometimes feel like it drags on. You’ll read about the different classes, and maybe you’ll feel a spark of interest, but then again, you might just end up scrolling through your phone instead. Unlocking classes isn’t exactly thrilling, and deciding which one is the best feels like trying to choose a favorite brand of water.

    The article gives you the basics on how to unlock classes. Apparently, you have to do certain tasks or maybe complete some boring missions. The best class? Well, that’s subjective. It’s all about what you prefer, but it feels more like a chore than a choice.

    So, if you’re curious about the classes and how to unlock them, the article is there. But let’s not pretend it’s going to change your life. It’s just another piece of information in the endless sea of gaming content. If you have some time to kill, sure, give it a look. Otherwise, you could probably find something more entertaining to do.

    Anyway, if you’re into this sort of thing, you can check it out on ActuGaming.net. Just don’t expect fireworks or anything.

    #DuneAwakening #GamingClasses #OpenWorldGames #SurvivalGames #ActuGaming
    Dune Awakening is one of those games that you might find interesting if you’re into survival in vast, open worlds. But honestly, it can also feel a bit tedious. The article "Tout savoir sur les classes (comment les débloquer, quelle est la meilleure…)" on ActuGaming.net dives into the various classes you can unlock in the game. Sure, it’s nice to know how to unlock them and which one might be considered the best. But let’s be real. It’s just another routine of figuring things out in a game that can sometimes feel like it drags on. You’ll read about the different classes, and maybe you’ll feel a spark of interest, but then again, you might just end up scrolling through your phone instead. Unlocking classes isn’t exactly thrilling, and deciding which one is the best feels like trying to choose a favorite brand of water. The article gives you the basics on how to unlock classes. Apparently, you have to do certain tasks or maybe complete some boring missions. The best class? Well, that’s subjective. It’s all about what you prefer, but it feels more like a chore than a choice. So, if you’re curious about the classes and how to unlock them, the article is there. But let’s not pretend it’s going to change your life. It’s just another piece of information in the endless sea of gaming content. If you have some time to kill, sure, give it a look. Otherwise, you could probably find something more entertaining to do. Anyway, if you’re into this sort of thing, you can check it out on ActuGaming.net. Just don’t expect fireworks or anything. #DuneAwakening #GamingClasses #OpenWorldGames #SurvivalGames #ActuGaming
    Tout savoir sur les classes (comment les débloquer, quelle est la meilleure…) – Dune Awakening
    ActuGaming.net Tout savoir sur les classes (comment les débloquer, quelle est la meilleure…) – Dune Awakening Dune Awakening est un jeu de survie en monde ouvert, certes, mais il s’agit surtout […] L'article Tout savoir sur les cla
    Like
    Love
    Wow
    Sad
    Angry
    331
    1 Commentarii 0 Distribuiri 0 previzualizare
  • Laptops are everywhere, and for CAD work, you really just need something that runs the software without crashing. So, there are these three laptops that are supposedly perfect for CAD. They’re on sale, which is nice, I guess. But honestly, who has the energy to care that much about discounts?

    The first one is just a standard model, nothing fancy. It has a decent processor and enough RAM to handle basic CAD tasks. It’s probably fine for most people, though I can’t say it’s exciting. The screen is okay, I mean, it shows things. So, if you need to do some drafting, it might get the job done. But really, it’s just another laptop.

    Then there’s the second option, which is slightly better, I think. It has a bit more power, which might make it more suitable for heavier CAD applications. But honestly, if you’re just sketching out ideas, do you really need that? The battery life isn’t terrible, but you’ll probably still find yourself looking for an outlet halfway through the day.

    Lastly, there’s the third laptop, and it’s kind of a mixed bag. It’s got some features that are nice, like a touchscreen or whatever. But again, who actually uses that? The performance is solid if you’re into that sort of thing. But if you’re just doing the basics, you might not even notice the difference.

    So, yeah, these three laptops are marked as perfect for CAD. They’re discounted, which might be a reason to look at them. But honestly, if you’re not super into CAD or just need something to get by, any random laptop will probably do. Just pick one, and let’s move on with life.

    #CAD #Laptops #DiscountedPrices #TechBoredom #ProductRecommendations
    Laptops are everywhere, and for CAD work, you really just need something that runs the software without crashing. So, there are these three laptops that are supposedly perfect for CAD. They’re on sale, which is nice, I guess. But honestly, who has the energy to care that much about discounts? The first one is just a standard model, nothing fancy. It has a decent processor and enough RAM to handle basic CAD tasks. It’s probably fine for most people, though I can’t say it’s exciting. The screen is okay, I mean, it shows things. So, if you need to do some drafting, it might get the job done. But really, it’s just another laptop. Then there’s the second option, which is slightly better, I think. It has a bit more power, which might make it more suitable for heavier CAD applications. But honestly, if you’re just sketching out ideas, do you really need that? The battery life isn’t terrible, but you’ll probably still find yourself looking for an outlet halfway through the day. Lastly, there’s the third laptop, and it’s kind of a mixed bag. It’s got some features that are nice, like a touchscreen or whatever. But again, who actually uses that? The performance is solid if you’re into that sort of thing. But if you’re just doing the basics, you might not even notice the difference. So, yeah, these three laptops are marked as perfect for CAD. They’re discounted, which might be a reason to look at them. But honestly, if you’re not super into CAD or just need something to get by, any random laptop will probably do. Just pick one, and let’s move on with life. #CAD #Laptops #DiscountedPrices #TechBoredom #ProductRecommendations
    3 laptops perfect for CAD – and they're all discounted
    Recommendations straight from the experts.
    Like
    Love
    Wow
    Sad
    Angry
    512
    1 Commentarii 0 Distribuiri 0 previzualizare
  • How to Implement Insertion Sort in Java: Step-by-Step Guide

    Posted on : June 13, 2025

    By

    Tech World Times

    Uncategorized 

    Rate this post

    Sorting is important in programming. It helps organize data. Sorting improves performance in searching, analysis, and reporting. There are many sorting algorithms. One of the simplest is Insertion Sort.
    In this article, we will learn how to implement Insertion Sort in Java. We will explain each step in simple words. You will see examples and understand how it works.
    What Is Insertion Sort?
    Insertion Sort is a simple sorting algorithm. It works like how you sort playing cards. You take one card at a time and place it in the right position. It compares the current element with those before it. If needed, it shifts elements to the right. Then, it inserts the current element at the correct place.
    How Insertion Sort Works
    Let’s understand with a small list:
    Example List:Steps:

    First elementis already sorted.
    Compare 3 with 8. Move 8 right. Insert 3 before it →Compare 5 with 8. Move 8 right. Insert 5 after 3 →Compare 1 with 8, 5, 3. Move them right. Insert 1 at start →Now the list is sorted!
    Why Use Insertion Sort?
    Insertion Sort is simple and easy to code. It works well for:

    Small datasets
    Nearly sorted lists
    Educational purposes and practice

    However, it is not good for large datasets. It has a time complexity of O.
    Time Complexity of Insertion Sort

    Best Case: OAverage Case: OWorst Case: OIt performs fewer steps in nearly sorted data.
    How to Implement Insertion Sort in Java
    Now let’s write the code for Insertion Sort in Java. We will explain each part.
    Step 1: Define a Class
    javaCopyEditpublic class InsertionSortExample {
    // Code goes here
    }

    We create a class named InsertionSortExample.
    Step 2: Create the Sorting Method
    javaCopyEditpublic static void insertionSort{
    int n = arr.length;
    for{
    int key = arr;
    int j = i - 1;

    while{
    arr= arr;
    j = j - 1;
    }
    arr= key;
    }
    }

    Let’s break it down:

    arris the current value.
    j starts from the previous index.
    While arr> key, shift arrto the right.
    Insert the key at the correct position.

    This logic sorts the array step by step.
    Step 3: Create the Main Method
    Now we test the code.
    javaCopyEditpublic static void main{
    intnumbers = {9, 5, 1, 4, 3};

    System.out.println;
    printArray;

    insertionSort;

    System.out.println;
    printArray;
    }

    This method:

    Creates an array of numbers
    Prints the array before sorting
    Calls the sort method
    Prints the array after sorting

    Step 4: Print the Array
    Let’s add a helper method to print the array.
    javaCopyEditpublic static void printArray{
    for{
    System.out.print;
    }
    System.out.println;
    }

    Now you can see how the array changes before and after sorting.
    Full Code Example
    javaCopyEditpublic class InsertionSortExample {

    public static void insertionSort{
    int n = arr.length;
    for{
    int key = arr;
    int j = i - 1;

    while{
    arr= arr;
    j = j - 1;
    }
    arr= key;
    }
    }

    public static void printArray{
    for{
    System.out.print;
    }
    System.out.println;
    }

    public static void main{
    intnumbers = {9, 5, 1, 4, 3};

    System.out.println;
    printArray;

    insertionSort;

    System.out.println;
    printArray;
    }
    }

    Sample Output
    yamlCopyEditBefore sorting:
    9 5 1 4 3
    After sorting:
    1 3 4 5 9

    This confirms that the sorting works correctly.
    Advantages of Insertion Sort in Java

    Easy to implement
    Works well with small inputs
    Stable sortGood for educational use

    When Not to Use Insertion Sort
    Avoid Insertion Sort when:

    The dataset is large
    Performance is critical
    Better algorithms like Merge Sort or Quick Sort are available

    Real-World Uses

    Sorting small records in a database
    Teaching algorithm basics
    Handling partially sorted arrays

    Even though it is not the fastest, it is useful in many simple tasks.
    Final Tips

    Practice with different inputs
    Add print statements to see how it works
    Try sorting strings or objects
    Use Java’s built-in sort methods for large arrays

    Conclusion
    Insertion Sort in Java is a great way to learn sorting. It is simple and easy to understand. In this guide, we showed how to implement it step-by-step. We covered the logic, code, and output. We also explained when to use it. Now you can try it yourself. Understanding sorting helps in coding interviews and software development. Keep practicing and exploring other sorting methods too. The more you practice, the better you understand algorithms.
    Tech World TimesTech World Times, a global collective focusing on the latest tech news and trends in blockchain, Fintech, Development & Testing, AI and Startups. If you are looking for the guest post then contact at techworldtimes@gmail.com
    #how #implement #insertion #sort #java
    How to Implement Insertion Sort in Java: Step-by-Step Guide
    Posted on : June 13, 2025 By Tech World Times Uncategorized  Rate this post Sorting is important in programming. It helps organize data. Sorting improves performance in searching, analysis, and reporting. There are many sorting algorithms. One of the simplest is Insertion Sort. In this article, we will learn how to implement Insertion Sort in Java. We will explain each step in simple words. You will see examples and understand how it works. What Is Insertion Sort? Insertion Sort is a simple sorting algorithm. It works like how you sort playing cards. You take one card at a time and place it in the right position. It compares the current element with those before it. If needed, it shifts elements to the right. Then, it inserts the current element at the correct place. How Insertion Sort Works Let’s understand with a small list: Example List:Steps: First elementis already sorted. Compare 3 with 8. Move 8 right. Insert 3 before it →Compare 5 with 8. Move 8 right. Insert 5 after 3 →Compare 1 with 8, 5, 3. Move them right. Insert 1 at start →Now the list is sorted! Why Use Insertion Sort? Insertion Sort is simple and easy to code. It works well for: Small datasets Nearly sorted lists Educational purposes and practice However, it is not good for large datasets. It has a time complexity of O. Time Complexity of Insertion Sort Best Case: OAverage Case: OWorst Case: OIt performs fewer steps in nearly sorted data. How to Implement Insertion Sort in Java Now let’s write the code for Insertion Sort in Java. We will explain each part. Step 1: Define a Class javaCopyEditpublic class InsertionSortExample { // Code goes here } We create a class named InsertionSortExample. Step 2: Create the Sorting Method javaCopyEditpublic static void insertionSort{ int n = arr.length; for{ int key = arr; int j = i - 1; while{ arr= arr; j = j - 1; } arr= key; } } Let’s break it down: arris the current value. j starts from the previous index. While arr> key, shift arrto the right. Insert the key at the correct position. This logic sorts the array step by step. Step 3: Create the Main Method Now we test the code. javaCopyEditpublic static void main{ intnumbers = {9, 5, 1, 4, 3}; System.out.println; printArray; insertionSort; System.out.println; printArray; } This method: Creates an array of numbers Prints the array before sorting Calls the sort method Prints the array after sorting Step 4: Print the Array Let’s add a helper method to print the array. javaCopyEditpublic static void printArray{ for{ System.out.print; } System.out.println; } Now you can see how the array changes before and after sorting. Full Code Example javaCopyEditpublic class InsertionSortExample { public static void insertionSort{ int n = arr.length; for{ int key = arr; int j = i - 1; while{ arr= arr; j = j - 1; } arr= key; } } public static void printArray{ for{ System.out.print; } System.out.println; } public static void main{ intnumbers = {9, 5, 1, 4, 3}; System.out.println; printArray; insertionSort; System.out.println; printArray; } } Sample Output yamlCopyEditBefore sorting: 9 5 1 4 3 After sorting: 1 3 4 5 9 This confirms that the sorting works correctly. Advantages of Insertion Sort in Java Easy to implement Works well with small inputs Stable sortGood for educational use When Not to Use Insertion Sort Avoid Insertion Sort when: The dataset is large Performance is critical Better algorithms like Merge Sort or Quick Sort are available Real-World Uses Sorting small records in a database Teaching algorithm basics Handling partially sorted arrays Even though it is not the fastest, it is useful in many simple tasks. Final Tips Practice with different inputs Add print statements to see how it works Try sorting strings or objects Use Java’s built-in sort methods for large arrays Conclusion Insertion Sort in Java is a great way to learn sorting. It is simple and easy to understand. In this guide, we showed how to implement it step-by-step. We covered the logic, code, and output. We also explained when to use it. Now you can try it yourself. Understanding sorting helps in coding interviews and software development. Keep practicing and exploring other sorting methods too. The more you practice, the better you understand algorithms. Tech World TimesTech World Times, a global collective focusing on the latest tech news and trends in blockchain, Fintech, Development & Testing, AI and Startups. If you are looking for the guest post then contact at techworldtimes@gmail.com #how #implement #insertion #sort #java
    TECHWORLDTIMES.COM
    How to Implement Insertion Sort in Java: Step-by-Step Guide
    Posted on : June 13, 2025 By Tech World Times Uncategorized  Rate this post Sorting is important in programming. It helps organize data. Sorting improves performance in searching, analysis, and reporting. There are many sorting algorithms. One of the simplest is Insertion Sort. In this article, we will learn how to implement Insertion Sort in Java. We will explain each step in simple words. You will see examples and understand how it works. What Is Insertion Sort? Insertion Sort is a simple sorting algorithm. It works like how you sort playing cards. You take one card at a time and place it in the right position. It compares the current element with those before it. If needed, it shifts elements to the right. Then, it inserts the current element at the correct place. How Insertion Sort Works Let’s understand with a small list: Example List: [8, 3, 5, 1] Steps: First element (8) is already sorted. Compare 3 with 8. Move 8 right. Insert 3 before it → [3, 8, 5, 1] Compare 5 with 8. Move 8 right. Insert 5 after 3 → [3, 5, 8, 1] Compare 1 with 8, 5, 3. Move them right. Insert 1 at start → [1, 3, 5, 8] Now the list is sorted! Why Use Insertion Sort? Insertion Sort is simple and easy to code. It works well for: Small datasets Nearly sorted lists Educational purposes and practice However, it is not good for large datasets. It has a time complexity of O(n²). Time Complexity of Insertion Sort Best Case (already sorted): O(n) Average Case: O(n²) Worst Case (reversed list): O(n²) It performs fewer steps in nearly sorted data. How to Implement Insertion Sort in Java Now let’s write the code for Insertion Sort in Java. We will explain each part. Step 1: Define a Class javaCopyEditpublic class InsertionSortExample { // Code goes here } We create a class named InsertionSortExample. Step 2: Create the Sorting Method javaCopyEditpublic static void insertionSort(int[] arr) { int n = arr.length; for (int i = 1; i < n; i++) { int key = arr[i]; int j = i - 1; while (j >= 0 && arr[j] > key) { arr[j + 1] = arr[j]; j = j - 1; } arr[j + 1] = key; } } Let’s break it down: arr[i] is the current value (called key). j starts from the previous index. While arr[j] > key, shift arr[j] to the right. Insert the key at the correct position. This logic sorts the array step by step. Step 3: Create the Main Method Now we test the code. javaCopyEditpublic static void main(String[] args) { int[] numbers = {9, 5, 1, 4, 3}; System.out.println("Before sorting:"); printArray(numbers); insertionSort(numbers); System.out.println("After sorting:"); printArray(numbers); } This method: Creates an array of numbers Prints the array before sorting Calls the sort method Prints the array after sorting Step 4: Print the Array Let’s add a helper method to print the array. javaCopyEditpublic static void printArray(int[] arr) { for (int number : arr) { System.out.print(number + " "); } System.out.println(); } Now you can see how the array changes before and after sorting. Full Code Example javaCopyEditpublic class InsertionSortExample { public static void insertionSort(int[] arr) { int n = arr.length; for (int i = 1; i < n; i++) { int key = arr[i]; int j = i - 1; while (j >= 0 && arr[j] > key) { arr[j + 1] = arr[j]; j = j - 1; } arr[j + 1] = key; } } public static void printArray(int[] arr) { for (int number : arr) { System.out.print(number + " "); } System.out.println(); } public static void main(String[] args) { int[] numbers = {9, 5, 1, 4, 3}; System.out.println("Before sorting:"); printArray(numbers); insertionSort(numbers); System.out.println("After sorting:"); printArray(numbers); } } Sample Output yamlCopyEditBefore sorting: 9 5 1 4 3 After sorting: 1 3 4 5 9 This confirms that the sorting works correctly. Advantages of Insertion Sort in Java Easy to implement Works well with small inputs Stable sort (keeps equal items in order) Good for educational use When Not to Use Insertion Sort Avoid Insertion Sort when: The dataset is large Performance is critical Better algorithms like Merge Sort or Quick Sort are available Real-World Uses Sorting small records in a database Teaching algorithm basics Handling partially sorted arrays Even though it is not the fastest, it is useful in many simple tasks. Final Tips Practice with different inputs Add print statements to see how it works Try sorting strings or objects Use Java’s built-in sort methods for large arrays Conclusion Insertion Sort in Java is a great way to learn sorting. It is simple and easy to understand. In this guide, we showed how to implement it step-by-step. We covered the logic, code, and output. We also explained when to use it. Now you can try it yourself. Understanding sorting helps in coding interviews and software development. Keep practicing and exploring other sorting methods too. The more you practice, the better you understand algorithms. Tech World TimesTech World Times (TWT), a global collective focusing on the latest tech news and trends in blockchain, Fintech, Development & Testing, AI and Startups. If you are looking for the guest post then contact at techworldtimes@gmail.com
    0 Commentarii 0 Distribuiri 0 previzualizare
  • Selection Sort Time Complexity: Best, Worst, and Average Cases

    Development and Testing 

    Rate this post

    Sorting is a basic task in programming. It arranges data in order. There are many sorting algorithms. Selection Sort is one of the simplest sorting methods. It is easy to understand and code. But it is not the fastest. In this guide, we will explain the Selection Sort Time Complexity. We will cover best, worst, and average cases.
    What Is Selection Sort?
    Selection Sort works by selecting the smallest element from the list. It places it in the correct position. It repeats this process for all elements. One by one, it moves the smallest values to the front.
    Let’s see an example:
    Input:Step 1: Smallest is 2 → swap with 5 →Step 2: Smallest in remaining is 3 → already correctStep 3: Smallest in remaining is 5 → swap with 8 →Now the list is sorted.How Selection Sort Works
    Selection Sort uses two loops. The outer loop moves one index at a time. The inner loop finds the smallest element. After each pass, the smallest value is moved to the front. The position is fixed. Selection Sort does not care if the list is sorted or not. It always does the same steps.
    Selection Sort Algorithm
    Here is the basic algorithm:

    Start from the first element
    Find the smallest in the rest of the list
    Swap it with the current element
    Repeat for each element

    This repeats until all elements are sorted.
    Selection Sort CodejavaCopyEditpublic class SelectionSort {
    public static void sort{
    int n = arr.length;
    for{
    int min = i;
    for{
    if{
    min = j;
    }
    }
    int temp = arr;
    arr= arr;
    arr= temp;
    }
    }
    }

    This code uses two loops. The outer loop runs n-1 times. The inner loop finds the minimum.
    Selection Sort Time Complexity
    Now let’s understand the main topic. Let’s analyze Selection Sort Time Complexity in three cases.
    1. Best Case
    Even if the array is already sorted, Selection Sort checks all elements. It keeps comparing and swapping.

    Time Complexity: OReason: Inner loop runs fully, regardless of the order
    Example Input:Even here, every comparison still happens. Only fewer swaps occur, but comparisons remain the same.
    2. Worst Case
    This happens when the array is in reverse order. But Selection Sort does not optimize for this.

    Time Complexity: OReason: Still needs full comparisons
    Example Input:Even in reverse, the steps are the same. It compares and finds the smallest element every time.
    3. Average Case
    This is when elements are randomly placed. It is the most common scenario in real-world problems.

    Time Complexity: OReason: Still compares each element in the inner loop
    Example Input:Selection Sort does not change behavior based on input order. So the complexity remains the same.
    Why Is It Always O?
    Selection Sort compares all pairs of elements. The number of comparisons does not change.
    Total comparisons = n ×/ 2
    That’s why the time complexity is always O.It does not reduce steps in any case. It does not take advantage of sorted elements.
    Space Complexity
    Selection Sort does not need extra space. It sorts in place.

    Space Complexity: OOnly a few variables are used
    No extra arrays or memory needed

    This is one good point of the Selection Sort.
    Comparison with Other Algorithms
    Let’s compare Selection Sort with other basic sorts:
    AlgorithmBest CaseAverage CaseWorst CaseSpaceSelection SortOOOOBubble SortOOOOInsertion SortOOOOMerge SortOOOOQuick SortOOOOAs you see, Selection Sort is slower than Merge Sort and Quick Sort.
    Advantages of Selection Sort

    Very simple and easy to understand
    Works well with small datasets
    Needs very little memory
    Good for learning purposes

    Disadvantages of Selection Sort

    Slow on large datasets
    Always takes the same time, even if sorted
    Not efficient for real-world use

    When to Use Selection Sort
    Use Selection Sort when:

    You are working with a very small dataset
    You want to teach or learn sorting logic
    You want stable, low-memory sorting

    Avoid it for:

    Large datasets
    Performance-sensitive programs

    Conclusion
    Selection Sort Time Complexity is simple to understand. But it is not efficient for big problems. It always takes Otime, no matter the case. That is the same for best, worst, and average inputs. Still, it is useful in some cases. It’s great for learning sorting basics. It uses very little memory. If you’re working with small arrays, Selection Sort is fine. For large data, use better algorithms. Understanding its time complexity helps you choose the right algorithm. Always pick the tool that fits your task.
    Tech World TimesTech World Times, a global collective focusing on the latest tech news and trends in blockchain, Fintech, Development & Testing, AI and Startups. If you are looking for the guest post then contact at techworldtimes@gmail.com
    #selection #sort #time #complexity #best
    Selection Sort Time Complexity: Best, Worst, and Average Cases
    Development and Testing  Rate this post Sorting is a basic task in programming. It arranges data in order. There are many sorting algorithms. Selection Sort is one of the simplest sorting methods. It is easy to understand and code. But it is not the fastest. In this guide, we will explain the Selection Sort Time Complexity. We will cover best, worst, and average cases. What Is Selection Sort? Selection Sort works by selecting the smallest element from the list. It places it in the correct position. It repeats this process for all elements. One by one, it moves the smallest values to the front. Let’s see an example: Input:Step 1: Smallest is 2 → swap with 5 →Step 2: Smallest in remaining is 3 → already correctStep 3: Smallest in remaining is 5 → swap with 8 →Now the list is sorted.How Selection Sort Works Selection Sort uses two loops. The outer loop moves one index at a time. The inner loop finds the smallest element. After each pass, the smallest value is moved to the front. The position is fixed. Selection Sort does not care if the list is sorted or not. It always does the same steps. Selection Sort Algorithm Here is the basic algorithm: Start from the first element Find the smallest in the rest of the list Swap it with the current element Repeat for each element This repeats until all elements are sorted. Selection Sort CodejavaCopyEditpublic class SelectionSort { public static void sort{ int n = arr.length; for{ int min = i; for{ if{ min = j; } } int temp = arr; arr= arr; arr= temp; } } } This code uses two loops. The outer loop runs n-1 times. The inner loop finds the minimum. Selection Sort Time Complexity Now let’s understand the main topic. Let’s analyze Selection Sort Time Complexity in three cases. 1. Best Case Even if the array is already sorted, Selection Sort checks all elements. It keeps comparing and swapping. Time Complexity: OReason: Inner loop runs fully, regardless of the order Example Input:Even here, every comparison still happens. Only fewer swaps occur, but comparisons remain the same. 2. Worst Case This happens when the array is in reverse order. But Selection Sort does not optimize for this. Time Complexity: OReason: Still needs full comparisons Example Input:Even in reverse, the steps are the same. It compares and finds the smallest element every time. 3. Average Case This is when elements are randomly placed. It is the most common scenario in real-world problems. Time Complexity: OReason: Still compares each element in the inner loop Example Input:Selection Sort does not change behavior based on input order. So the complexity remains the same. Why Is It Always O? Selection Sort compares all pairs of elements. The number of comparisons does not change. Total comparisons = n ×/ 2 That’s why the time complexity is always O.It does not reduce steps in any case. It does not take advantage of sorted elements. Space Complexity Selection Sort does not need extra space. It sorts in place. Space Complexity: OOnly a few variables are used No extra arrays or memory needed This is one good point of the Selection Sort. Comparison with Other Algorithms Let’s compare Selection Sort with other basic sorts: AlgorithmBest CaseAverage CaseWorst CaseSpaceSelection SortOOOOBubble SortOOOOInsertion SortOOOOMerge SortOOOOQuick SortOOOOAs you see, Selection Sort is slower than Merge Sort and Quick Sort. Advantages of Selection Sort Very simple and easy to understand Works well with small datasets Needs very little memory Good for learning purposes Disadvantages of Selection Sort Slow on large datasets Always takes the same time, even if sorted Not efficient for real-world use When to Use Selection Sort Use Selection Sort when: You are working with a very small dataset You want to teach or learn sorting logic You want stable, low-memory sorting Avoid it for: Large datasets Performance-sensitive programs Conclusion Selection Sort Time Complexity is simple to understand. But it is not efficient for big problems. It always takes Otime, no matter the case. That is the same for best, worst, and average inputs. Still, it is useful in some cases. It’s great for learning sorting basics. It uses very little memory. If you’re working with small arrays, Selection Sort is fine. For large data, use better algorithms. Understanding its time complexity helps you choose the right algorithm. Always pick the tool that fits your task. Tech World TimesTech World Times, a global collective focusing on the latest tech news and trends in blockchain, Fintech, Development & Testing, AI and Startups. If you are looking for the guest post then contact at techworldtimes@gmail.com #selection #sort #time #complexity #best
    TECHWORLDTIMES.COM
    Selection Sort Time Complexity: Best, Worst, and Average Cases
    Development and Testing  Rate this post Sorting is a basic task in programming. It arranges data in order. There are many sorting algorithms. Selection Sort is one of the simplest sorting methods. It is easy to understand and code. But it is not the fastest. In this guide, we will explain the Selection Sort Time Complexity. We will cover best, worst, and average cases. What Is Selection Sort? Selection Sort works by selecting the smallest element from the list. It places it in the correct position. It repeats this process for all elements. One by one, it moves the smallest values to the front. Let’s see an example: Input: [5, 3, 8, 2]Step 1: Smallest is 2 → swap with 5 → [2, 3, 8, 5]Step 2: Smallest in remaining is 3 → already correctStep 3: Smallest in remaining is 5 → swap with 8 → [2, 3, 5, 8] Now the list is sorted.How Selection Sort Works Selection Sort uses two loops. The outer loop moves one index at a time. The inner loop finds the smallest element. After each pass, the smallest value is moved to the front. The position is fixed. Selection Sort does not care if the list is sorted or not. It always does the same steps. Selection Sort Algorithm Here is the basic algorithm: Start from the first element Find the smallest in the rest of the list Swap it with the current element Repeat for each element This repeats until all elements are sorted. Selection Sort Code (Java Example) javaCopyEditpublic class SelectionSort { public static void sort(int[] arr) { int n = arr.length; for (int i = 0; i < n - 1; i++) { int min = i; for (int j = i + 1; j < n; j++) { if (arr[j] < arr[min]) { min = j; } } int temp = arr[min]; arr[min] = arr[i]; arr[i] = temp; } } } This code uses two loops. The outer loop runs n-1 times. The inner loop finds the minimum. Selection Sort Time Complexity Now let’s understand the main topic. Let’s analyze Selection Sort Time Complexity in three cases. 1. Best Case Even if the array is already sorted, Selection Sort checks all elements. It keeps comparing and swapping. Time Complexity: O(n²) Reason: Inner loop runs fully, regardless of the order Example Input: [1, 2, 3, 4, 5] Even here, every comparison still happens. Only fewer swaps occur, but comparisons remain the same. 2. Worst Case This happens when the array is in reverse order. But Selection Sort does not optimize for this. Time Complexity: O(n²) Reason: Still needs full comparisons Example Input: [5, 4, 3, 2, 1] Even in reverse, the steps are the same. It compares and finds the smallest element every time. 3. Average Case This is when elements are randomly placed. It is the most common scenario in real-world problems. Time Complexity: O(n²) Reason: Still compares each element in the inner loop Example Input: [3, 1, 4, 2, 5] Selection Sort does not change behavior based on input order. So the complexity remains the same. Why Is It Always O(n²)? Selection Sort compares all pairs of elements. The number of comparisons does not change. Total comparisons = n × (n – 1) / 2 That’s why the time complexity is always O(n²).It does not reduce steps in any case. It does not take advantage of sorted elements. Space Complexity Selection Sort does not need extra space. It sorts in place. Space Complexity: O(1) Only a few variables are used No extra arrays or memory needed This is one good point of the Selection Sort. Comparison with Other Algorithms Let’s compare Selection Sort with other basic sorts: AlgorithmBest CaseAverage CaseWorst CaseSpaceSelection SortO(n²)O(n²)O(n²)O(1)Bubble SortO(n)O(n²)O(n²)O(1)Insertion SortO(n)O(n²)O(n²)O(1)Merge SortO(n log n)O(n log n)O(n log n)O(n)Quick SortO(n log n)O(n log n)O(n²)O(log n) As you see, Selection Sort is slower than Merge Sort and Quick Sort. Advantages of Selection Sort Very simple and easy to understand Works well with small datasets Needs very little memory Good for learning purposes Disadvantages of Selection Sort Slow on large datasets Always takes the same time, even if sorted Not efficient for real-world use When to Use Selection Sort Use Selection Sort when: You are working with a very small dataset You want to teach or learn sorting logic You want stable, low-memory sorting Avoid it for: Large datasets Performance-sensitive programs Conclusion Selection Sort Time Complexity is simple to understand. But it is not efficient for big problems. It always takes O(n²) time, no matter the case. That is the same for best, worst, and average inputs. Still, it is useful in some cases. It’s great for learning sorting basics. It uses very little memory. If you’re working with small arrays, Selection Sort is fine. For large data, use better algorithms. Understanding its time complexity helps you choose the right algorithm. Always pick the tool that fits your task. Tech World TimesTech World Times (TWT), a global collective focusing on the latest tech news and trends in blockchain, Fintech, Development & Testing, AI and Startups. If you are looking for the guest post then contact at techworldtimes@gmail.com
    0 Commentarii 0 Distribuiri 0 previzualizare
  • Decoding The SVG <code>path</code> Element: Line Commands

    In a previous article, we looked at some practical examples of how to code SVG by hand. In that guide, we covered the basics of the SVG elements rect, circle, ellipse, line, polyline, and polygon.
    This time around, we are going to tackle a more advanced topic, the absolute powerhouse of SVG elements: path. Don’t get me wrong; I still stand by my point that image paths are better drawn in vector programs than coded. But when it comes to technical drawings and data visualizations, the path element unlocks a wide array of possibilities and opens up the world of hand-coded SVGs.
    The path syntax can be really complex. We’re going to tackle it in two separate parts. In this first installment, we’re learning all about straight and angular paths. In the second part, we’ll make lines bend, twist, and turn.
    Required Knowledge And Guide Structure
    Note: If you are unfamiliar with the basics of SVG, such as the subject of viewBox and the basic syntax of the simple elements, I recommend reading my guide before diving into this one. You should also familiarize yourself with <text> if you want to understand each line of code in the examples.
    Before we get started, I want to quickly recap how I code SVG using JavaScript. I don’t like dealing with numbers and math, and reading SVG Code with numbers filled into every attribute makes me lose all understanding of it. By giving coordinates names and having all my math easy to parse and write out, I have a much better time with this type of code, and I think you will, too.
    The goal of this article is more about understanding path syntax than it is about doing placement or how to leverage loops and other more basic things. So, I will not run you through the entire setup of each example. I’ll instead share snippets of the code, but they may be slightly adjusted from the CodePen or simplified to make this article easier to read. However, if there are specific questions about code that are not part of the text in the CodePen demos, the comment section is open.
    To keep this all framework-agnostic, the code is written in vanilla JavaScript.
    Setting Up For Success
    As the path element relies on our understanding of some of the coordinates we plug into the commands, I think it is a lot easier if we have a bit of visual orientation. So, all of the examples will be coded on top of a visual representation of a traditional viewBox setup with the origin in the top-left corner, then moves diagonally down to. The command is: M10 10 L100 100.
    The blue line is horizontal. It starts atand should end at. We could use the L command, but we’d have to write 55 again. So, instead, we write M10 55 H100, and then SVG knows to look back at the y value of M for the y value of H.
    It’s the same thing for the green line, but when we use the V command, SVG knows to refer back to the x value of M for the x value of V.
    If we compare the resulting horizontal path with the same implementation in a <line> element, we may

    Notice how much more efficient path can be, and
    Remove quite a bit of meaning for anyone who doesn’t speak path.

    Because, as we look at these strings, one of them is called “line”. And while the rest doesn’t mean anything out of context, the line definitely conjures a specific image in our heads.
    <path d="M 10 55 H 100" />
    <line x1="10" y1="55" x2="100" y2="55" />

    Making Polygons And Polylines With Z
    In the previous section, we learned how path can behave like <line>, which is pretty cool. But it can do more. It can also act like polyline and polygon.
    Remember, how those two basically work the same, but polygon connects the first and last point, while polyline does not? The path element can do the same thing. There is a separate command to close the path with a line, which is the Z command.

    const polyline2Points = M${start.x} ${start.y} L${p1.x} ${p1.y} L${p2.x} ${p2.y};
    const polygon2Points = M${start.x} ${start.y} L${p1.x} ${p1.y} L${p2.x} ${p2.y} Z;

    So, let’s see this in action and create a repeating triangle shape. Every odd time, it’s open, and every even time, it’s closed. Pretty neat!
    See the Pen Alternating Trianglesby Myriam.
    When it comes to comparing path versus polygon and polyline, the other tags tell us about their names, but I would argue that fewer people know what a polygon is versus what a line is. The argument to use these two tags over path for legibility is weak, in my opinion, and I guess you’d probably agree that this looks like equal levels of meaningless string given to an SVG element.
    <path d="M0 0 L86.6 50 L0 100 Z" />
    <polygon points="0,0 86.6,50 0,100" />

    <path d="M0 0 L86.6 50 L0 100" />
    <polyline points="0,0 86.6,50 0,100" />

    Relative Commands: m, l, h, v
    All of the line commands exist in absolute and relative versions. The difference is that the relative commands are lowercase, e.g., m, l, h, and v. The relative commands are always relative to the last point, so instead of declaring an x value, you’re declaring a dx value, saying this is how many units you’re moving.
    Before we look at the example visually, I want you to look at the following three-line commands. Try not to look at the CodePen beforehand.
    const lines =;

    As I mentioned, I hate looking at numbers without meaning, but there is one number whose meaning is pretty constant in most contexts: 0. Seeing a 0 in combination with a command I just learned means relative manages to instantly tell me that nothing is happening. Seeing l 0 20 by itself tells me that this line only moves along one axis instead of two.
    And looking at that entire blue path command, the repeated 20 value gives me a sense that the shape might have some regularity to it. The first path does a bit of that by repeating 10 and 30. But the third? As someone who can’t do math in my head, that third string gives me nothing.
    Now, you might be surprised, but they all draw the same shape, just in different places.
    See the Pen SVG Compound Pathsby Myriam.
    So, how valuable is it that we can recognize the regularity in the blue path? Not very, in my opinion. In some cases, going with the relative value is easier than an absolute one. In other cases, the absolute is king. Neither is better nor worse.
    And, in all cases, that previous example would be much more efficient if it were set up with a variable for the gap, a variable for the shape size, and a function to generate the path definition that’s called from within a loop so it can take in the index to properly calculate the start point.

    Jumping Points: How To Make Compound Paths
    Another very useful thing is something you don’t see visually in the previous CodePen, but it relates to the grid and its code.
    I snuck in a grid drawing update.
    With the method used in earlier examples, using line to draw the grid, the above CodePen would’ve rendered the grid with 14 separate elements. If you go and inspect the final code of that last CodePen, you’ll notice that there is just a single path element within the .grid group.
    It looks like this, which is not fun to look at but holds the secret to how it’s possible:

    <path d="M0 0 H110 M0 10 H110 M0 20 H110 M0 30 H110 M0 0 V45 M10 0 V45 M20 0 V45 M30 0 V45 M40 0 V45 M50 0 V45 M60 0 V45 M70 0 V45 M80 0 V45 M90 0 V45" stroke="currentColor" stroke-width="0.2" fill="none"></path>

    If we take a close look, we may notice that there are multiple M commands. This is the magic of compound paths.
    Since the M/m commands don’t actually draw and just place the cursor, a path can have jumps.

    So, whenever we have multiple paths that share common styling and don’t need to have separate interactions, we can just chain them together to make our code shorter.
    Coming Up Next
    Armed with this knowledge, we’re now able to replace line, polyline, and polygon with path commands and combine them in compound paths. But there is so much more to uncover because path doesn’t just offer foreign-language versions of lines but also gives us the option to code circles and ellipses that have open space and can sometimes also bend, twist, and turn. We’ll refer to those as curves and arcs, and discuss them more explicitly in the next article.
    Further Reading On SmashingMag

    “Mastering SVG Arcs,” Akshay Gupta
    “Accessible SVGs: Perfect Patterns For Screen Reader Users,” Carie Fisher
    “Easy SVG Customization And Animation: A Practical Guide,” Adrian Bece
    “Magical SVG Techniques,” Cosima Mielke
    #decoding #svg #ampltcodeampgtpathampltcodeampgt #element #line
    Decoding The SVG <code>path</code> Element: Line Commands
    In a previous article, we looked at some practical examples of how to code SVG by hand. In that guide, we covered the basics of the SVG elements rect, circle, ellipse, line, polyline, and polygon. This time around, we are going to tackle a more advanced topic, the absolute powerhouse of SVG elements: path. Don’t get me wrong; I still stand by my point that image paths are better drawn in vector programs than coded. But when it comes to technical drawings and data visualizations, the path element unlocks a wide array of possibilities and opens up the world of hand-coded SVGs. The path syntax can be really complex. We’re going to tackle it in two separate parts. In this first installment, we’re learning all about straight and angular paths. In the second part, we’ll make lines bend, twist, and turn. Required Knowledge And Guide Structure Note: If you are unfamiliar with the basics of SVG, such as the subject of viewBox and the basic syntax of the simple elements, I recommend reading my guide before diving into this one. You should also familiarize yourself with <text> if you want to understand each line of code in the examples. Before we get started, I want to quickly recap how I code SVG using JavaScript. I don’t like dealing with numbers and math, and reading SVG Code with numbers filled into every attribute makes me lose all understanding of it. By giving coordinates names and having all my math easy to parse and write out, I have a much better time with this type of code, and I think you will, too. The goal of this article is more about understanding path syntax than it is about doing placement or how to leverage loops and other more basic things. So, I will not run you through the entire setup of each example. I’ll instead share snippets of the code, but they may be slightly adjusted from the CodePen or simplified to make this article easier to read. However, if there are specific questions about code that are not part of the text in the CodePen demos, the comment section is open. To keep this all framework-agnostic, the code is written in vanilla JavaScript. Setting Up For Success As the path element relies on our understanding of some of the coordinates we plug into the commands, I think it is a lot easier if we have a bit of visual orientation. So, all of the examples will be coded on top of a visual representation of a traditional viewBox setup with the origin in the top-left corner, then moves diagonally down to. The command is: M10 10 L100 100. The blue line is horizontal. It starts atand should end at. We could use the L command, but we’d have to write 55 again. So, instead, we write M10 55 H100, and then SVG knows to look back at the y value of M for the y value of H. It’s the same thing for the green line, but when we use the V command, SVG knows to refer back to the x value of M for the x value of V. If we compare the resulting horizontal path with the same implementation in a <line> element, we may Notice how much more efficient path can be, and Remove quite a bit of meaning for anyone who doesn’t speak path. Because, as we look at these strings, one of them is called “line”. And while the rest doesn’t mean anything out of context, the line definitely conjures a specific image in our heads. <path d="M 10 55 H 100" /> <line x1="10" y1="55" x2="100" y2="55" /> Making Polygons And Polylines With Z In the previous section, we learned how path can behave like <line>, which is pretty cool. But it can do more. It can also act like polyline and polygon. Remember, how those two basically work the same, but polygon connects the first and last point, while polyline does not? The path element can do the same thing. There is a separate command to close the path with a line, which is the Z command. const polyline2Points = M${start.x} ${start.y} L${p1.x} ${p1.y} L${p2.x} ${p2.y}; const polygon2Points = M${start.x} ${start.y} L${p1.x} ${p1.y} L${p2.x} ${p2.y} Z; So, let’s see this in action and create a repeating triangle shape. Every odd time, it’s open, and every even time, it’s closed. Pretty neat! See the Pen Alternating Trianglesby Myriam. When it comes to comparing path versus polygon and polyline, the other tags tell us about their names, but I would argue that fewer people know what a polygon is versus what a line is. The argument to use these two tags over path for legibility is weak, in my opinion, and I guess you’d probably agree that this looks like equal levels of meaningless string given to an SVG element. <path d="M0 0 L86.6 50 L0 100 Z" /> <polygon points="0,0 86.6,50 0,100" /> <path d="M0 0 L86.6 50 L0 100" /> <polyline points="0,0 86.6,50 0,100" /> Relative Commands: m, l, h, v All of the line commands exist in absolute and relative versions. The difference is that the relative commands are lowercase, e.g., m, l, h, and v. The relative commands are always relative to the last point, so instead of declaring an x value, you’re declaring a dx value, saying this is how many units you’re moving. Before we look at the example visually, I want you to look at the following three-line commands. Try not to look at the CodePen beforehand. const lines =; As I mentioned, I hate looking at numbers without meaning, but there is one number whose meaning is pretty constant in most contexts: 0. Seeing a 0 in combination with a command I just learned means relative manages to instantly tell me that nothing is happening. Seeing l 0 20 by itself tells me that this line only moves along one axis instead of two. And looking at that entire blue path command, the repeated 20 value gives me a sense that the shape might have some regularity to it. The first path does a bit of that by repeating 10 and 30. But the third? As someone who can’t do math in my head, that third string gives me nothing. Now, you might be surprised, but they all draw the same shape, just in different places. See the Pen SVG Compound Pathsby Myriam. So, how valuable is it that we can recognize the regularity in the blue path? Not very, in my opinion. In some cases, going with the relative value is easier than an absolute one. In other cases, the absolute is king. Neither is better nor worse. And, in all cases, that previous example would be much more efficient if it were set up with a variable for the gap, a variable for the shape size, and a function to generate the path definition that’s called from within a loop so it can take in the index to properly calculate the start point. Jumping Points: How To Make Compound Paths Another very useful thing is something you don’t see visually in the previous CodePen, but it relates to the grid and its code. I snuck in a grid drawing update. With the method used in earlier examples, using line to draw the grid, the above CodePen would’ve rendered the grid with 14 separate elements. If you go and inspect the final code of that last CodePen, you’ll notice that there is just a single path element within the .grid group. It looks like this, which is not fun to look at but holds the secret to how it’s possible: <path d="M0 0 H110 M0 10 H110 M0 20 H110 M0 30 H110 M0 0 V45 M10 0 V45 M20 0 V45 M30 0 V45 M40 0 V45 M50 0 V45 M60 0 V45 M70 0 V45 M80 0 V45 M90 0 V45" stroke="currentColor" stroke-width="0.2" fill="none"></path> If we take a close look, we may notice that there are multiple M commands. This is the magic of compound paths. Since the M/m commands don’t actually draw and just place the cursor, a path can have jumps. So, whenever we have multiple paths that share common styling and don’t need to have separate interactions, we can just chain them together to make our code shorter. Coming Up Next Armed with this knowledge, we’re now able to replace line, polyline, and polygon with path commands and combine them in compound paths. But there is so much more to uncover because path doesn’t just offer foreign-language versions of lines but also gives us the option to code circles and ellipses that have open space and can sometimes also bend, twist, and turn. We’ll refer to those as curves and arcs, and discuss them more explicitly in the next article. Further Reading On SmashingMag “Mastering SVG Arcs,” Akshay Gupta “Accessible SVGs: Perfect Patterns For Screen Reader Users,” Carie Fisher “Easy SVG Customization And Animation: A Practical Guide,” Adrian Bece “Magical SVG Techniques,” Cosima Mielke #decoding #svg #ampltcodeampgtpathampltcodeampgt #element #line
    SMASHINGMAGAZINE.COM
    Decoding The SVG <code>path</code> Element: Line Commands
    In a previous article, we looked at some practical examples of how to code SVG by hand. In that guide, we covered the basics of the SVG elements rect, circle, ellipse, line, polyline, and polygon (and also g). This time around, we are going to tackle a more advanced topic, the absolute powerhouse of SVG elements: path. Don’t get me wrong; I still stand by my point that image paths are better drawn in vector programs than coded (unless you’re the type of creative who makes non-logical visual art in code — then go forth and create awe-inspiring wonders; you’re probably not the audience of this article). But when it comes to technical drawings and data visualizations, the path element unlocks a wide array of possibilities and opens up the world of hand-coded SVGs. The path syntax can be really complex. We’re going to tackle it in two separate parts. In this first installment, we’re learning all about straight and angular paths. In the second part, we’ll make lines bend, twist, and turn. Required Knowledge And Guide Structure Note: If you are unfamiliar with the basics of SVG, such as the subject of viewBox and the basic syntax of the simple elements (rect, line, g, and so on), I recommend reading my guide before diving into this one. You should also familiarize yourself with <text> if you want to understand each line of code in the examples. Before we get started, I want to quickly recap how I code SVG using JavaScript. I don’t like dealing with numbers and math, and reading SVG Code with numbers filled into every attribute makes me lose all understanding of it. By giving coordinates names and having all my math easy to parse and write out, I have a much better time with this type of code, and I think you will, too. The goal of this article is more about understanding path syntax than it is about doing placement or how to leverage loops and other more basic things. So, I will not run you through the entire setup of each example. I’ll instead share snippets of the code, but they may be slightly adjusted from the CodePen or simplified to make this article easier to read. However, if there are specific questions about code that are not part of the text in the CodePen demos, the comment section is open. To keep this all framework-agnostic, the code is written in vanilla JavaScript (though, really, TypeScript is your friend the more complicated your SVG becomes, and I missed it when writing some of these). Setting Up For Success As the path element relies on our understanding of some of the coordinates we plug into the commands, I think it is a lot easier if we have a bit of visual orientation. So, all of the examples will be coded on top of a visual representation of a traditional viewBox setup with the origin in the top-left corner (so, values in the shape of 0 0 ${width} ${height}. I added text labels as well to make it easier to point you to specific areas within the grid. Please note that I recommend being careful when adding text within the <text> element in SVG if you want your text to be accessible. If the graphic relies on text scaling like the rest of your website, it would be better to have it rendered through HTML. But for our examples here, it should be sufficient. So, this is what we’ll be plotting on top of: See the Pen SVG Viewbox Grid Visual [forked] by Myriam. Alright, we now have a ViewBox Visualizing Grid. I think we’re ready for our first session with the beast. Enter path And The All-Powerful d Attribute The <path> element has a d attribute, which speaks its own language. So, within d, you’re talking in terms of “commands”. When I think of non-path versus path elements, I like to think that the reason why we have to write much more complex drawing instructions is this: All non-path elements are just dumber paths. In the background, they have one pre-drawn path shape that they will always render based on a few parameters you pass in. But path has no default shape. The shape logic has to be exposed to you, while it can be neatly hidden away for all other elements. Let’s learn about those commands. Where It All Begins: M The first, which is where each path begins, is the M command, which moves the pen to a point. This command places your starting point, but it does not draw a single thing. A path with just an M command is an auto-delete when cleaning up SVG files. It takes two arguments: the x and y coordinates of your start position. const uselessPathCommand = `M${start.x} ${start.y}`; Basic Line Commands: M , L, H, V These are fun and easy: L, H, and V, all draw a line from the current point to the point specified. L takes two arguments, the x and y positions of the point you want to draw to. const pathCommandL = `M${start.x} ${start.y} L${end.x} ${end.y}`; H and V, on the other hand, only take one argument because they are only drawing a line in one direction. For H, you specify the x position, and for V, you specify the y position. The other value is implied. const pathCommandH = `M${start.x} ${start.y} H${end.x}`; const pathCommandV = `M${start.x} ${start.y} V${end.y}`; To visualize how this works, I created a function that draws the path, as well as points with labels on them, so we can see what happens. See the Pen Simple Lines with path [forked] by Myriam. We have three lines in that image. The L command is used for the red path. It starts with M at (10,10), then moves diagonally down to (100,100). The command is: M10 10 L100 100. The blue line is horizontal. It starts at (10,55) and should end at (100, 55). We could use the L command, but we’d have to write 55 again. So, instead, we write M10 55 H100, and then SVG knows to look back at the y value of M for the y value of H. It’s the same thing for the green line, but when we use the V command, SVG knows to refer back to the x value of M for the x value of V. If we compare the resulting horizontal path with the same implementation in a <line> element, we may Notice how much more efficient path can be, and Remove quite a bit of meaning for anyone who doesn’t speak path. Because, as we look at these strings, one of them is called “line”. And while the rest doesn’t mean anything out of context, the line definitely conjures a specific image in our heads. <path d="M 10 55 H 100" /> <line x1="10" y1="55" x2="100" y2="55" /> Making Polygons And Polylines With Z In the previous section, we learned how path can behave like <line>, which is pretty cool. But it can do more. It can also act like polyline and polygon. Remember, how those two basically work the same, but polygon connects the first and last point, while polyline does not? The path element can do the same thing. There is a separate command to close the path with a line, which is the Z command. const polyline2Points = M${start.x} ${start.y} L${p1.x} ${p1.y} L${p2.x} ${p2.y}; const polygon2Points = M${start.x} ${start.y} L${p1.x} ${p1.y} L${p2.x} ${p2.y} Z; So, let’s see this in action and create a repeating triangle shape. Every odd time, it’s open, and every even time, it’s closed. Pretty neat! See the Pen Alternating Triangles [forked] by Myriam. When it comes to comparing path versus polygon and polyline, the other tags tell us about their names, but I would argue that fewer people know what a polygon is versus what a line is (and probably even fewer know what a polyline is. Heck, even the program I’m writing this article in tells me polyline is not a valid word). The argument to use these two tags over path for legibility is weak, in my opinion, and I guess you’d probably agree that this looks like equal levels of meaningless string given to an SVG element. <path d="M0 0 L86.6 50 L0 100 Z" /> <polygon points="0,0 86.6,50 0,100" /> <path d="M0 0 L86.6 50 L0 100" /> <polyline points="0,0 86.6,50 0,100" /> Relative Commands: m, l, h, v All of the line commands exist in absolute and relative versions. The difference is that the relative commands are lowercase, e.g., m, l, h, and v. The relative commands are always relative to the last point, so instead of declaring an x value, you’re declaring a dx value, saying this is how many units you’re moving. Before we look at the example visually, I want you to look at the following three-line commands. Try not to look at the CodePen beforehand. const lines = [ { d: `M10 10 L 10 30 L 30 30`, color: "var(--_red)" }, { d: `M40 10 l 0 20 l 20 0`, color: "var(--_blue)" }, { d: `M70 10 l 0 20 L 90 30`, color: "var(--_green)" } ]; As I mentioned, I hate looking at numbers without meaning, but there is one number whose meaning is pretty constant in most contexts: 0. Seeing a 0 in combination with a command I just learned means relative manages to instantly tell me that nothing is happening. Seeing l 0 20 by itself tells me that this line only moves along one axis instead of two. And looking at that entire blue path command, the repeated 20 value gives me a sense that the shape might have some regularity to it. The first path does a bit of that by repeating 10 and 30. But the third? As someone who can’t do math in my head, that third string gives me nothing. Now, you might be surprised, but they all draw the same shape, just in different places. See the Pen SVG Compound Paths [forked] by Myriam. So, how valuable is it that we can recognize the regularity in the blue path? Not very, in my opinion. In some cases, going with the relative value is easier than an absolute one. In other cases, the absolute is king. Neither is better nor worse. And, in all cases, that previous example would be much more efficient if it were set up with a variable for the gap, a variable for the shape size, and a function to generate the path definition that’s called from within a loop so it can take in the index to properly calculate the start point. Jumping Points: How To Make Compound Paths Another very useful thing is something you don’t see visually in the previous CodePen, but it relates to the grid and its code. I snuck in a grid drawing update. With the method used in earlier examples, using line to draw the grid, the above CodePen would’ve rendered the grid with 14 separate elements. If you go and inspect the final code of that last CodePen, you’ll notice that there is just a single path element within the .grid group. It looks like this, which is not fun to look at but holds the secret to how it’s possible: <path d="M0 0 H110 M0 10 H110 M0 20 H110 M0 30 H110 M0 0 V45 M10 0 V45 M20 0 V45 M30 0 V45 M40 0 V45 M50 0 V45 M60 0 V45 M70 0 V45 M80 0 V45 M90 0 V45" stroke="currentColor" stroke-width="0.2" fill="none"></path> If we take a close look, we may notice that there are multiple M commands. This is the magic of compound paths. Since the M/m commands don’t actually draw and just place the cursor, a path can have jumps. So, whenever we have multiple paths that share common styling and don’t need to have separate interactions, we can just chain them together to make our code shorter. Coming Up Next Armed with this knowledge, we’re now able to replace line, polyline, and polygon with path commands and combine them in compound paths. But there is so much more to uncover because path doesn’t just offer foreign-language versions of lines but also gives us the option to code circles and ellipses that have open space and can sometimes also bend, twist, and turn. We’ll refer to those as curves and arcs, and discuss them more explicitly in the next article. Further Reading On SmashingMag “Mastering SVG Arcs,” Akshay Gupta “Accessible SVGs: Perfect Patterns For Screen Reader Users,” Carie Fisher “Easy SVG Customization And Animation: A Practical Guide,” Adrian Bece “Magical SVG Techniques,” Cosima Mielke
    0 Commentarii 0 Distribuiri 0 previzualizare
  • Why I Would Choose a Steam Deck Over a Nintendo Switch 2

    We may earn a commission from links on this page.After spending about a week with the Nintendo Switch 2, I have to admit that it’s a good console. It’s priced fairly for its sleek form factor and the performance it offers, and it sets Nintendo up to stay relevant while gaming graphics only continue to get more complex. And yet, for my own personal tastes, it’s still not my handheld of choice. Instead, I’ll be sticking to Valve’s Steam Deck, the first and still overall best handheld gaming PC, at least going by value for money. And if you don’t necessarily care about Nintendo’s exclusive games, there’s a good chance it might be the better option for you, too.The Steam Deck is cheaper than the Switch 2Out of the gate, the most obvious reason to get a Steam Deck over a Nintendo Switch 2 is price. Starting at for a new model, it’s only modestly cheaper than the Switch 2’s but that’s only part of the story. Valve also runs a certified refurbished program that offers used Decks with only cosmetic blemishes for as low as Restocks are infrequent, since Valve is only able to sell as much as gets sent back to it, but when they do happen, it's a heck of a great deal.That said, there is one catch. The Steam Deck OLED, which offers a bigger, more colorful screen and a larger battery, is more expensive than the Switch 2, starting at However, it’s maybe a bit unfair to compare the two, since the Switch 2 does not use an OLED screen and comes with less storage. If all you care about is the basics, the base Steam Deck is good enough—it’s got the same performance as the more recent one. And that performance, by the way, ended up being about on par with the Switch 2 in my testing, at least in Cyberpunk 2077.The Steam Deck is more comfortable to hold than the Switch 2This one is a bit of a toss-up, depending on your preferences, although I think the Steam Deck takes a slight lead here. While the Nintendo Switch 2 aims for a completely flat and somewhat compact profile, the Steam Deck instead allows itself to stretch out, and even though it’s a little bigger and a little heavier for it, I ultimately think that makes it more comfortable.At 11.73 x 4.60 x 1.93 inches against the Switch 2’s 10.7 x 4.5 x 0.55 inches, and at 1.41 pounds against the Switch 2’s 1.18 pounds, I won’t deny that this will be a non-starter for some. But personally, I still feel like the Steam Deck comes out on top, and that’s thanks to its ergonomics.I’ve never been a big fan of Nintendo’s joy-con controllers, and while the Switch 2’s joy-con 2 controllers improve on the Switch 1’s with bigger buttons and sticks, as well as more room to hold onto them, they still pale in comparison next to the Steam Deck’s controls.

    Steam Deck in profilevs. Switch 2 in profileCredit: Michelle Ehrhardt

    On the Switch 2, there are no grips to wrap your fingers around. On the Steam Deck, there are. The triggers also flare out more, and because the console is wider, your hands can stretch out a bit, rather than choking up on the device. It can get a bit heavy to hold a Steam Deck after a while, but I still prefer this approach overall, and if you have a surface to rest the Steam Deck against, weight is a non-issue.Plus, there are some extra bonuses that come with the additional space. The Steam Deck has large touchpads on either side of the device, plus four grip buttons on the back of it, giving you some extra inputs to play around with. Nice.It’s a bit less portable and a bit heavier, but for my adult hands, the Steam Deck is just better shaped to them.The Steam Deck has a bigger, cheaper library than the Switch 2This is the kicker. While there are cheap games that can run on the Switch 2 courtesy of backwards compatibility and third-party eShop titles, the big system drawscan get as pricey as Not to say the Steam Deck doesn’t have expensive games as well, but on the whole, I think it’s easier to get cheap and free games on the Steam Deck than on the eShop.That’s because, being a handheld gaming PC, the Steam Deck can take advantage of the many sales and freebies PC gaming stores love to give out. These happen a bit more frequently on PC than on console, and that’s because there’s more competition on PC. Someone on PC could download games either from Steam or Epic, for instance, while someone on the Switch 2 can only download games from the Nintendo eShop.So, even sticking to just Steam, you’ll get access to regular weekend and mid-week sales, quarterly event sales, and developer or publisher highlight sales. That’s more sales events than you’ll usually find on the Nintendo eShop, and if you’re looking for cheaper first-party games, forget about it. Nintendo’s own games hardly ever go on sale, even years after release.But that’s just the beginning. Despite being named the Steam Deck, the device can actually run games from other stores, too. That’s thanks to an easily installed Linux program called Heroic Launcher, which is free and lets you download and play games from your Epic, GOG, and Amazon Prime Games accounts with just a few clicks.

    Credit: Heroic Games Launcher

    This is a game changer. Epic and Amazon Prime are both underdogs in the PC gaming space, and so to bolster their numbers, they both regularly give away free games. Epic in particular offers one free PC game every week, whereas if you’re a Twitch user, you might notice a decent but more infrequent amount of notifications allowing you to claim free Amazon Prime games. Some of these are big titles, too—it’s how I got Batman: Arkham Knight and Star Wars Battlefront II. With a simple install and a few months of waiting, you could have a Steam Deck filled to the brim with games that you didn’t even pay for. You just can’t do that on Nintendo.And then there’s the elephant in the room: your backlog. If you’re anything like me, you probably already have a Steam library that’s hundreds of games large. It was maybe even like this before the Switch 1 came out—regular sales have a tendency to build up the amount of games you own. By choosing the Steam Deck as your handheld, you’ll be able to play those games on the go, instantly giving you what might as well be a full library with no added cost to you. If you migrate over to the Nintendo Switch 2, you’re going to have to start with a fresh library, or at least a library that’s only as old as the Nintendo Switch 1.Basically, while the Switch 2’s hardware is only more expensive than the Steam Deck, it’ll be easier to fill your Steam Deck up with high quality, inexpensive games than it would be on the Switch 2. If you don’t care about having access to Nintendo exclusive games, that’s a huge draw.TV Play is a mixed bagFinally, I want to acknowledge that the Steam Deck still isn’t necessarily a better option than the Switch 2 for everyone. That’s why I’m writing from a personal perspective here. Like all gaming PCs, it’ll take some fiddling to get some games to run, so the Switch 2 is definitely a smoother experience out of the box. It’s also got less battery life, from my testing. But the big point of departure is TV play.Playing your portable games on a TV on the Switch 2 is as simple as plugging it into its dock. With the Steam Deck, you have to buy a dock separately, and even then, you have to connect your own controller to it and manually find suitable TV graphics settings for each game on its own. It’s not nearly as easy or flexible.And yet, for folks like me, I’m willing to say that even TV play is better. Or, depending on what type of PC gamer you are, monitor play.That’s because you’re not limited to playing your Steam Deck games on the Deck itself, dock or not. Instead, you can play on the Deck when you’re away from your home, and then swap over to your regular gaming PC when you’re back. Your Deck will upload your saves to the cloud automatically, and your PC will seamlessly download them. While not as intuitive as plugging your Switch 2 into its dock, the benefit here is that your non-portable play isn’t limited by the power of your portable device, whereas docked Switch 2 play is still held back by running on portable hardware.The tradeoff is that maintaining a dedicated gaming PC in addition to a Steam Deck is more expensive, but maybe more importantly, requires more tinkering. And I think that’s the key point here. If you want a simple-to-use, pick-up-and-play handheld, the Switch 2 is a great choice for you. But if you’re like me, and you’re not afraid to download some launchers and occasionally dive into compatibility settings or swap between two devices, the Steam Deck might still be the best handheld gaming device for you, even three years later.
    #why #would #choose #steam #deck
    Why I Would Choose a Steam Deck Over a Nintendo Switch 2
    We may earn a commission from links on this page.After spending about a week with the Nintendo Switch 2, I have to admit that it’s a good console. It’s priced fairly for its sleek form factor and the performance it offers, and it sets Nintendo up to stay relevant while gaming graphics only continue to get more complex. And yet, for my own personal tastes, it’s still not my handheld of choice. Instead, I’ll be sticking to Valve’s Steam Deck, the first and still overall best handheld gaming PC, at least going by value for money. And if you don’t necessarily care about Nintendo’s exclusive games, there’s a good chance it might be the better option for you, too.The Steam Deck is cheaper than the Switch 2Out of the gate, the most obvious reason to get a Steam Deck over a Nintendo Switch 2 is price. Starting at for a new model, it’s only modestly cheaper than the Switch 2’s but that’s only part of the story. Valve also runs a certified refurbished program that offers used Decks with only cosmetic blemishes for as low as Restocks are infrequent, since Valve is only able to sell as much as gets sent back to it, but when they do happen, it's a heck of a great deal.That said, there is one catch. The Steam Deck OLED, which offers a bigger, more colorful screen and a larger battery, is more expensive than the Switch 2, starting at However, it’s maybe a bit unfair to compare the two, since the Switch 2 does not use an OLED screen and comes with less storage. If all you care about is the basics, the base Steam Deck is good enough—it’s got the same performance as the more recent one. And that performance, by the way, ended up being about on par with the Switch 2 in my testing, at least in Cyberpunk 2077.The Steam Deck is more comfortable to hold than the Switch 2This one is a bit of a toss-up, depending on your preferences, although I think the Steam Deck takes a slight lead here. While the Nintendo Switch 2 aims for a completely flat and somewhat compact profile, the Steam Deck instead allows itself to stretch out, and even though it’s a little bigger and a little heavier for it, I ultimately think that makes it more comfortable.At 11.73 x 4.60 x 1.93 inches against the Switch 2’s 10.7 x 4.5 x 0.55 inches, and at 1.41 pounds against the Switch 2’s 1.18 pounds, I won’t deny that this will be a non-starter for some. But personally, I still feel like the Steam Deck comes out on top, and that’s thanks to its ergonomics.I’ve never been a big fan of Nintendo’s joy-con controllers, and while the Switch 2’s joy-con 2 controllers improve on the Switch 1’s with bigger buttons and sticks, as well as more room to hold onto them, they still pale in comparison next to the Steam Deck’s controls. Steam Deck in profilevs. Switch 2 in profileCredit: Michelle Ehrhardt On the Switch 2, there are no grips to wrap your fingers around. On the Steam Deck, there are. The triggers also flare out more, and because the console is wider, your hands can stretch out a bit, rather than choking up on the device. It can get a bit heavy to hold a Steam Deck after a while, but I still prefer this approach overall, and if you have a surface to rest the Steam Deck against, weight is a non-issue.Plus, there are some extra bonuses that come with the additional space. The Steam Deck has large touchpads on either side of the device, plus four grip buttons on the back of it, giving you some extra inputs to play around with. Nice.It’s a bit less portable and a bit heavier, but for my adult hands, the Steam Deck is just better shaped to them.The Steam Deck has a bigger, cheaper library than the Switch 2This is the kicker. While there are cheap games that can run on the Switch 2 courtesy of backwards compatibility and third-party eShop titles, the big system drawscan get as pricey as Not to say the Steam Deck doesn’t have expensive games as well, but on the whole, I think it’s easier to get cheap and free games on the Steam Deck than on the eShop.That’s because, being a handheld gaming PC, the Steam Deck can take advantage of the many sales and freebies PC gaming stores love to give out. These happen a bit more frequently on PC than on console, and that’s because there’s more competition on PC. Someone on PC could download games either from Steam or Epic, for instance, while someone on the Switch 2 can only download games from the Nintendo eShop.So, even sticking to just Steam, you’ll get access to regular weekend and mid-week sales, quarterly event sales, and developer or publisher highlight sales. That’s more sales events than you’ll usually find on the Nintendo eShop, and if you’re looking for cheaper first-party games, forget about it. Nintendo’s own games hardly ever go on sale, even years after release.But that’s just the beginning. Despite being named the Steam Deck, the device can actually run games from other stores, too. That’s thanks to an easily installed Linux program called Heroic Launcher, which is free and lets you download and play games from your Epic, GOG, and Amazon Prime Games accounts with just a few clicks. Credit: Heroic Games Launcher This is a game changer. Epic and Amazon Prime are both underdogs in the PC gaming space, and so to bolster their numbers, they both regularly give away free games. Epic in particular offers one free PC game every week, whereas if you’re a Twitch user, you might notice a decent but more infrequent amount of notifications allowing you to claim free Amazon Prime games. Some of these are big titles, too—it’s how I got Batman: Arkham Knight and Star Wars Battlefront II. With a simple install and a few months of waiting, you could have a Steam Deck filled to the brim with games that you didn’t even pay for. You just can’t do that on Nintendo.And then there’s the elephant in the room: your backlog. If you’re anything like me, you probably already have a Steam library that’s hundreds of games large. It was maybe even like this before the Switch 1 came out—regular sales have a tendency to build up the amount of games you own. By choosing the Steam Deck as your handheld, you’ll be able to play those games on the go, instantly giving you what might as well be a full library with no added cost to you. If you migrate over to the Nintendo Switch 2, you’re going to have to start with a fresh library, or at least a library that’s only as old as the Nintendo Switch 1.Basically, while the Switch 2’s hardware is only more expensive than the Steam Deck, it’ll be easier to fill your Steam Deck up with high quality, inexpensive games than it would be on the Switch 2. If you don’t care about having access to Nintendo exclusive games, that’s a huge draw.TV Play is a mixed bagFinally, I want to acknowledge that the Steam Deck still isn’t necessarily a better option than the Switch 2 for everyone. That’s why I’m writing from a personal perspective here. Like all gaming PCs, it’ll take some fiddling to get some games to run, so the Switch 2 is definitely a smoother experience out of the box. It’s also got less battery life, from my testing. But the big point of departure is TV play.Playing your portable games on a TV on the Switch 2 is as simple as plugging it into its dock. With the Steam Deck, you have to buy a dock separately, and even then, you have to connect your own controller to it and manually find suitable TV graphics settings for each game on its own. It’s not nearly as easy or flexible.And yet, for folks like me, I’m willing to say that even TV play is better. Or, depending on what type of PC gamer you are, monitor play.That’s because you’re not limited to playing your Steam Deck games on the Deck itself, dock or not. Instead, you can play on the Deck when you’re away from your home, and then swap over to your regular gaming PC when you’re back. Your Deck will upload your saves to the cloud automatically, and your PC will seamlessly download them. While not as intuitive as plugging your Switch 2 into its dock, the benefit here is that your non-portable play isn’t limited by the power of your portable device, whereas docked Switch 2 play is still held back by running on portable hardware.The tradeoff is that maintaining a dedicated gaming PC in addition to a Steam Deck is more expensive, but maybe more importantly, requires more tinkering. And I think that’s the key point here. If you want a simple-to-use, pick-up-and-play handheld, the Switch 2 is a great choice for you. But if you’re like me, and you’re not afraid to download some launchers and occasionally dive into compatibility settings or swap between two devices, the Steam Deck might still be the best handheld gaming device for you, even three years later. #why #would #choose #steam #deck
    LIFEHACKER.COM
    Why I Would Choose a Steam Deck Over a Nintendo Switch 2
    We may earn a commission from links on this page.After spending about a week with the Nintendo Switch 2, I have to admit that it’s a good console. It’s priced fairly for its sleek form factor and the performance it offers, and it sets Nintendo up to stay relevant while gaming graphics only continue to get more complex. And yet, for my own personal tastes, it’s still not my handheld of choice. Instead, I’ll be sticking to Valve’s Steam Deck, the first and still overall best handheld gaming PC, at least going by value for money. And if you don’t necessarily care about Nintendo’s exclusive games, there’s a good chance it might be the better option for you, too.The Steam Deck is cheaper than the Switch 2Out of the gate, the most obvious reason to get a Steam Deck over a Nintendo Switch 2 is price. Starting at $400 for a new model, it’s only modestly cheaper than the Switch 2’s $450, but that’s only part of the story. Valve also runs a certified refurbished program that offers used Decks with only cosmetic blemishes for as low as $279. Restocks are infrequent, since Valve is only able to sell as much as gets sent back to it, but when they do happen, it's a heck of a great deal.That said, there is one catch. The Steam Deck OLED, which offers a bigger, more colorful screen and a larger battery, is more expensive than the Switch 2, starting at $549. However, it’s maybe a bit unfair to compare the two, since the Switch 2 does not use an OLED screen and comes with less storage. If all you care about is the basics (I’m perfectly happy with my LCD model), the base Steam Deck is good enough—it’s got the same performance as the more recent one. And that performance, by the way, ended up being about on par with the Switch 2 in my testing, at least in Cyberpunk 2077 (one of my go-to benchmark games).The Steam Deck is more comfortable to hold than the Switch 2This one is a bit of a toss-up, depending on your preferences, although I think the Steam Deck takes a slight lead here. While the Nintendo Switch 2 aims for a completely flat and somewhat compact profile, the Steam Deck instead allows itself to stretch out, and even though it’s a little bigger and a little heavier for it, I ultimately think that makes it more comfortable.At 11.73 x 4.60 x 1.93 inches against the Switch 2’s 10.7 x 4.5 x 0.55 inches, and at 1.41 pounds against the Switch 2’s 1.18 pounds, I won’t deny that this will be a non-starter for some. But personally, I still feel like the Steam Deck comes out on top, and that’s thanks to its ergonomics.I’ve never been a big fan of Nintendo’s joy-con controllers, and while the Switch 2’s joy-con 2 controllers improve on the Switch 1’s with bigger buttons and sticks, as well as more room to hold onto them, they still pale in comparison next to the Steam Deck’s controls. Steam Deck in profile (above) vs. Switch 2 in profile (below) Credit: Michelle Ehrhardt On the Switch 2, there are no grips to wrap your fingers around. On the Steam Deck, there are. The triggers also flare out more, and because the console is wider, your hands can stretch out a bit, rather than choking up on the device. It can get a bit heavy to hold a Steam Deck after a while, but I still prefer this approach overall, and if you have a surface to rest the Steam Deck against (like an airplane tray table), weight is a non-issue.Plus, there are some extra bonuses that come with the additional space. The Steam Deck has large touchpads on either side of the device, plus four grip buttons on the back of it, giving you some extra inputs to play around with. Nice.It’s a bit less portable and a bit heavier, but for my adult hands, the Steam Deck is just better shaped to them.The Steam Deck has a bigger, cheaper library than the Switch 2This is the kicker. While there are cheap games that can run on the Switch 2 courtesy of backwards compatibility and third-party eShop titles, the big system draws (Nintendo-developed titles like Mario Kart World, for example) can get as pricey as $80. Not to say the Steam Deck doesn’t have expensive games as well, but on the whole, I think it’s easier to get cheap and free games on the Steam Deck than on the eShop.That’s because, being a handheld gaming PC, the Steam Deck can take advantage of the many sales and freebies PC gaming stores love to give out. These happen a bit more frequently on PC than on console, and that’s because there’s more competition on PC. Someone on PC could download games either from Steam or Epic, for instance, while someone on the Switch 2 can only download games from the Nintendo eShop.So, even sticking to just Steam, you’ll get access to regular weekend and mid-week sales, quarterly event sales, and developer or publisher highlight sales. That’s more sales events than you’ll usually find on the Nintendo eShop, and if you’re looking for cheaper first-party games, forget about it. Nintendo’s own games hardly ever go on sale, even years after release.But that’s just the beginning. Despite being named the Steam Deck, the device can actually run games from other stores, too. That’s thanks to an easily installed Linux program called Heroic Launcher, which is free and lets you download and play games from your Epic, GOG, and Amazon Prime Games accounts with just a few clicks. Credit: Heroic Games Launcher This is a game changer. Epic and Amazon Prime are both underdogs in the PC gaming space, and so to bolster their numbers, they both regularly give away free games. Epic in particular offers one free PC game every week, whereas if you’re a Twitch user, you might notice a decent but more infrequent amount of notifications allowing you to claim free Amazon Prime games. Some of these are big titles, too—it’s how I got Batman: Arkham Knight and Star Wars Battlefront II. With a simple install and a few months of waiting, you could have a Steam Deck filled to the brim with games that you didn’t even pay for. You just can’t do that on Nintendo.And then there’s the elephant in the room: your backlog. If you’re anything like me, you probably already have a Steam library that’s hundreds of games large. It was maybe even like this before the Switch 1 came out—regular sales have a tendency to build up the amount of games you own. By choosing the Steam Deck as your handheld, you’ll be able to play those games on the go, instantly giving you what might as well be a full library with no added cost to you. If you migrate over to the Nintendo Switch 2, you’re going to have to start with a fresh library, or at least a library that’s only as old as the Nintendo Switch 1.Basically, while the Switch 2’s hardware is only $50 more expensive than the Steam Deck, it’ll be easier to fill your Steam Deck up with high quality, inexpensive games than it would be on the Switch 2. If you don’t care about having access to Nintendo exclusive games, that’s a huge draw.TV Play is a mixed bagFinally, I want to acknowledge that the Steam Deck still isn’t necessarily a better option than the Switch 2 for everyone. That’s why I’m writing from a personal perspective here. Like all gaming PCs, it’ll take some fiddling to get some games to run, so the Switch 2 is definitely a smoother experience out of the box. It’s also got less battery life, from my testing. But the big point of departure is TV play.Playing your portable games on a TV on the Switch 2 is as simple as plugging it into its dock. With the Steam Deck, you have to buy a dock separately (the official one is $79), and even then, you have to connect your own controller to it and manually find suitable TV graphics settings for each game on its own. It’s not nearly as easy or flexible.And yet, for folks like me, I’m willing to say that even TV play is better. Or, depending on what type of PC gamer you are, monitor play.That’s because you’re not limited to playing your Steam Deck games on the Deck itself, dock or not. Instead, you can play on the Deck when you’re away from your home, and then swap over to your regular gaming PC when you’re back. Your Deck will upload your saves to the cloud automatically, and your PC will seamlessly download them. While not as intuitive as plugging your Switch 2 into its dock, the benefit here is that your non-portable play isn’t limited by the power of your portable device, whereas docked Switch 2 play is still held back by running on portable hardware.The tradeoff is that maintaining a dedicated gaming PC in addition to a Steam Deck is more expensive, but maybe more importantly, requires more tinkering (there are ways to build a cheap gaming PC, after all). And I think that’s the key point here. If you want a simple-to-use, pick-up-and-play handheld, the Switch 2 is a great choice for you. But if you’re like me, and you’re not afraid to download some launchers and occasionally dive into compatibility settings or swap between two devices, the Steam Deck might still be the best handheld gaming device for you, even three years later.
    0 Commentarii 0 Distribuiri 0 previzualizare
CGShares https://cgshares.com