Best of InfoWorldAugust 2024

  1. 1
    Article
    Avatar of infoworldInfoWorld·2y

    Best practices for handling exceptions in C#

    Effective exception handling is crucial for building robust applications. Key practices include deriving custom exceptions from the Exception class, handling exceptions at the highest level in the call hierarchy, using specific exceptions for clarity, employing try/catch/finally blocks for resource cleanup, and avoiding the re-throwing of exceptions to maintain stack trace integrity. Always log exceptions properly and use validation logic to minimize the need for exceptions.

  2. 2
    Article
    Avatar of infoworldInfoWorld·2y

    I switched to a vertical mouse and I’m never looking back. Here’s why.

    Vertical mice are designed to keep hands in a more natural 'handshake' position, reducing wrist and arm strain. They may take some time to get used to, but can significantly improve comfort and reduce repetitive stress injuries compared to conventional mice. With many options available at different price points, switching to a vertical mouse might be a worthwhile investment for those who spend long hours using a computer.

  3. 3
    Article
    Avatar of infoworldInfoWorld·2y

    JDK 23: The new features in Java 23

    Java Development Kit (JDK) 23, set for release on September 17, will feature previews of module import declarations, stream gatherers, structured concurrency, and scoped values. Notably, string templates have been dropped. JDK 23 will also bring enhancements such as a new functional interface for scoped values, deprecation of certain memory-access methods in `sun.misc.Unsafe`, and a generational mode default for the Z Garbage Collector. Furthermore, it includes updates to the vector API, Markdown documentation comments, and primitive types in patterns, `instanceof`, and `switch`.

  4. 4
    Article
    Avatar of infoworldInfoWorld·2y

    Why I don’t buy Apple products

    Apple products are well-engineered and user-friendly, appealing especially to non-technical users. However, the author prefers Windows and Android due to their flexibility, lower cost, and customization options. Concerns include Apple's closed ecosystem, privacy practices, developer restrictions, and the high App Store take rate. Despite recognizing Apple's success and innovation, the author finds these issues too significant to overlook.

  5. 5
    Article
    Avatar of infoworldInfoWorld·2y

    Better than reflection: Using method handles and variable handles in Java

    MethodHandles and VarHandles present safer and more performant alternatives to Java's reflection API. They allow programmatic access to methods and fields with a cleaner and more structured API. While they don't cover all the capabilities of reflection, they are preferred for accessing class metadata and manipulating methods and fields. Migrating away from reflection is necessary as it becomes deprecated, and the JVM is increasingly adopting these new methods.

  6. 6
    Article
    Avatar of infoworldInfoWorld·2y

    3 languages changing data science

    Python, Julia, and Rust are three pivotal languages in data science, each with distinct strengths. Python is notable for its ease of use and vast third-party library ecosystem but struggles with distribution and speed. Julia, created for data science, combines Python's simplicity with the speed of low-level languages like C, though it faces distribution challenges and initial performance lags. Rust excels in speed, memory safety, and correctness, making it suitable for robust tools, albeit with a steeper learning curve and longer development time.

  7. 7
    Article
    Avatar of infoworldInfoWorld·2y

    Functional programming with Java collections

    Streams and lambdas provide powerful ways to work with Java collections, making functional programming easier and more efficient. Java 8 introduced these features, allowing developers to use functional operations like sort, forEach, map, filter, and reduce on collections without modifying the original data. These operations enhance code readability and maintainability by enabling a more declarative syntax and composable pipelines. Additionally, converting different types of collections into streams unlocks the potential for these functional techniques across various data structures.

  8. 8
    Article
    Avatar of infoworldInfoWorld·2y

    String comparisons in Java

    This post explains how strings are compared in Java, covering key concepts such as encapsulation, method overloading, string pools, and the intern() method. It details how the '==' operator and the equals() method differ in comparing strings, and highlights common pitfalls. The post concludes with a series of examples and a challenge to help reinforce understanding.

  9. 9
    Article
    Avatar of infoworldInfoWorld·2y

    Java polymorphism and its types

    Polymorphism in Java allows entities to take different forms, enhancing code maintainability. Java supports four types of polymorphism: coercion, overloading, parametric, and subtype. Subtype polymorphism involves upcasting and late binding to execute various versions of a superclass method. Abstract classes and methods define more generic class hierarchies, while downcasting reverts to subtype-specific functionalities. Runtime type identification (RTTI) ensures casting safety, and covariant return types enhance method return flexibility.