Best of General ProgrammingJuly 2024

  1. 1
    Article
    Avatar of devtoDEV·2y

    I'm tired of it

    AI-generated content is pervasive, often creating bland, inaccurate articles that lack true value. The author criticizes this trend, emphasizing the importance of human-crafted content that showcases effort and unique perspectives. Highlighting examples of pointless AI-generated articles and the inefficiency of email communication due to AI, the appeal is to maintain authenticity and personal touch in writing.

  2. 2
    Article
    Avatar of devtoDEV·2y

    Part 1: What is Clean Architecture?

    Clean Architecture, introduced by Robert C. Martin, aims to create systems that are easy to understand, flexible, and maintainable by emphasizing separation of concerns. It organizes code into concentric circles, where dependencies only flow inward, ensuring modularity and testability. The architecture allows for improved testability, flexibility, maintainability, reusability, and scalability by keeping business logic decoupled from external dependencies like frameworks and databases.

  3. 3
    Article
    Avatar of devtoDEV·2y

    Practical Guide to Creating a Design System

    Creating a design system involves selecting a suitable UI framework, defining both light and dark themes, and organizing the system into a reusable package. Using tools like Storybook for documentation and ensuring regression UI testing minimizes unexpected issues. Avoid custom CSS and components to reduce complexity and maintenance costs. While initially labor-intensive, this approach significantly reduces the marginal cost of developing new front-end pages.

  4. 4
    Article
    Avatar of communityCommunity Picks·2y

    Dependency Injection made simple.

    Dependency Injection simplifies handling dependent objects, making code more flexible and decoupled. In JavaScript, passing connection objects through constructors exemplifies this. For strongly typed languages like C# and Java, interfaces help enforce consistent structures. This approach enhances code management and testing.

  5. 5
    Article
    Avatar of towardsdevTowards Dev·2y

    SOLID Principles in C#

    The SOLID principles are a set of five key design principles for building maintainable and flexible software architecture: Single Responsibility, Open/Closed, Liskov Substitution, Interface Segregation, and Dependency Inversion. The post details each principle with examples in C#, providing guidelines to help keep classes focused and testable, favoring abstraction and composition over inheritance, and ensuring extensibility without modifying existing code.

  6. 6
    Article
    Avatar of devtoDEV·2y

    Portfolio or no portfolio?

    Discusses whether developers should have a personal portfolio site, inviting readers to vote using emojis and share their reasons for or against having one.

  7. 7
    Video
    Avatar of t3dotggTheo - t3․gg·2y

    It's Better To Be Late

    Many developers feel pressured to keep up with new technologies to avoid falling behind. Historical examples, such as early mobile game development, suggest that jumping on trends too quickly can be a disadvantage. Following genuine interest rather than fear of missing out may lead to better success. It's often more beneficial to wait until a market or technology has matured before investing significant time and effort.

  8. 8
    Article
    Avatar of freecodecampfreeCodeCamp·2y

    How To Use LINQ in C# – With Code Examples

    LINQ, part of the .NET framework, allows for powerful data querying through both language-level query syntax and method syntax. This post covers various LINQ methods such as `OrderBy`, `First`, `Single`, `SingleOrDefault`, and `Select` with examples on how to apply them. It also delves into deferred execution and method chaining, demonstrating how LINQ can optimize performance and allow for more complex, readable queries. Writing defensive code to handle changes in data over time is emphasized for error prevention.

  9. 9
    Article
    Avatar of devtoDEV·2y

    Part 2 :Design Principles in Software Development

    Adhering to fundamental design principles in software development—such as Dependency Inversion, Separation of Concerns, Single Responsibility, DRY (Don't Repeat Yourself), and Persistence Ignorance—is key to creating robust, maintainable, and scalable applications. Each principle contributes to keeping the codebase clean and efficient, which in turn simplifies maintenance and extension of the software.

  10. 10
    Article
    Avatar of javarevisitedJavarevisited·2y

    Refactoring 015 — Remove NULL. Eliminating The Billion-Dollar Mistake…

    The post discusses eliminating frequent null checks and null pointer exceptions in code by using the Null Object Pattern. This approach simplifies code, making it more readable and maintainable while avoiding the 'Billion-Dollar Mistake.' It provides step-by-step guidance and sample code demonstrating how to implement Null Objects to replace null checks.

  11. 11
    Article
    Avatar of airbnbAirbnb·2y

    How Airbnb Smoothly Upgrades React

    Airbnb recently upgraded all their web surfaces from React 16 to React 18. To manage this, they developed a React Upgrade System, a reusable infrastructure allowing incremental updates and performance measurements. This enabled small, frequent upgrades instead of a single, large-scale update. Key techniques involved module aliasing and environment targeting, ensuring safe rollout and testing. The system has been successfully implemented, and Airbnb plans to use it for future React upgrades, including React 19.

  12. 12
    Article
    Avatar of javarevisitedJavarevisited·2y

    SOLID Principles: OOP Fundamentals

    The SOLID principles are five key guidelines for healthy, sustainable, and maintainable software development. These principles include Single Responsibility, Open/Closed, Liskov Substitution, Interface Segregation, and Dependency Inversion. Each principle is explained with examples demonstrating how to implement them in real-world programming scenarios, highlighting their importance in creating modular, flexible, and maintainable codebases.

  13. 13
    Article
    Avatar of freecodecampfreeCodeCamp·2y

    What is Primitive Obsession?

    Primitive Obsession is a code smell where primitives like strings and integers are overused to represent complex concepts such as email addresses, phone numbers, and unique IDs. This leads to issues like weak type checking, poor readability, code duplication, and difficulty in refactoring. The post discusses the drawbacks of primitive obsession and offers strategies to design more robust data structures for better code correctness, maintainability, and data safety. It emphasizes the importance of encapsulation and being vigilant about special validation, comparison, and formatting rules for variables.

  14. 14
    Article
    Avatar of newstackThe New Stack·2y

    The Anatomy of Slow Code Reviews

    Slow code reviews are a common complaint among software developers due to various social and cultural factors. Identifying bottlenecks and optimizing the process through well-defined review guidelines, ownership, and iterative feedback can enhance code review times. Implementing review and revision SLOs, prioritizing code reviews, and using tools can further streamline the process and improve developer satisfaction. Encouraging manageable changes and recognizing the importance of cross-team reviews are also key strategies for improvement.

  15. 15
    Article
    Avatar of bartwullemsThe Art of Simplicity·2y

    Understanding Pure Domain Modelling: Bridging the Gap Between Existing Systems and the Real Domain

    Domain modelling is essential for designing systems that reflect business needs, but domain experts often start from existing systems rather than the actual domain, creating biased models. Pure domain modelling offers a solution by emphasizing the capture of core business processes and rules independent of current systems. Strategies include educating domain experts, conducting independent workshops, and adopting Domain-Driven Design (DDD) practices.

  16. 16
    Article
    Avatar of communityCommunity Picks·2y

    "It looks good to me"!

    The post highlights the importance of addressing critical gaps in code review processes, especially as the software industry evolves. It stresses the need to include performance tests in addition to traditional unit and integration tests. It also covers best practices for effective code reviews and the potential performance impact on systems. Tools like Digma can help integrate performance monitoring into the developer workflow, ensuring issues are caught early.

  17. 17
    Video
    Avatar of communityCommunity Picks·2y

    Fix Every TypeScript Error with This Tool!

    Discover how to automatically fix numerous TypeScript errors with the underrated tool TS fix, a CLI built by Microsoft. Learn the steps to clone, build, and link this tool to effortlessly apply fixes across your TypeScript project. TS fix includes safeguards to ensure no unwanted changes are applied, and it accounts for project-specific TypeScript configurations. The post also highlights the importance of the TypeScript configuration and introduces an optional VS Code plugin for additional support in identifying and fixing errors.

  18. 18
    Article
    Avatar of csharpcornerC# Corner·2y

    Liskov Substitution Principle in C# with Example

    The Liskov Substitution Principle (LSP) is one of the SOLID principles of object-oriented design, which ensures that objects of a superclass can be replaced by objects of a subclass without introducing errors. The post provided an example with a Bird class and an Ostrich class that violates LSP, and demonstrated refactoring the code by introducing an IBird interface and specific bird classes to adhere to LSP, making the code robust, maintainable, and scalable.

  19. 19
    Article
    Avatar of codemazeCode Maze·2y

    Bridge Design Pattern in C#

    The Bridge Design Pattern is a structural pattern in C# that helps decouple a class’s implementation from its abstraction, allowing the two to vary independently. This pattern uses interfaces and abstract classes as abstraction and implementation layers respectively, avoiding the explosion of subclasses that occur in inheritance-based designs. For example, by separating discount logic from delivery calculation in a pricing system, it allows different combinations of both without creating a subclass for each combination. However, it requires careful consideration due to its complexity and the shift of responsibility to client code.

  20. 20
    Article
    Avatar of csharpcornerC# Corner·2y

    C# Abstract Class with Examples

    Abstract classes in C# provide a blueprint for other classes, allowing for shared functionality, default behavior, and partial implementation. They contain abstract methods, which must be implemented by derived classes, as well as non-abstract methods that can be inherited. Abstract classes are essential for code reusability, extensibility, and maintainability, differentiating from interfaces which solely define method signatures. Understanding their usage is crucial for building scalable and maintainable applications in C#.

  21. 21
    Article
    Avatar of codemazeCode Maze·2y

    Template Method Design Pattern in C#

    The Template Method design pattern is a behavioral pattern that allows the reuse of an algorithm's structure while enabling subclasses to redefine certain parts of the algorithm. The pattern entails defining a top-level public routine in an abstract base class that is inherited by concrete classes. Key components include private/protected methods, abstract methods, and virtual methods, each serving a specific role in the algorithm's execution. This approach ensures maximum code reuse and allows for easier adaptation of variations. An example in C# includes refactoring reporting services to adhere to this pattern, enhancing code maintenance and reducing redundancy. However, potential trade-offs include reduced adaptability and increased error-proneness due to the control residing in the base class.

  22. 22
    Article
    Avatar of itnextITNEXT·2y

    Streaming Architecture in AWS to capture tweets in near real time

    This post describes a streaming architecture using AWS to capture tweets in near real time. It outlines how to use the Twitter Streaming API to collect tweets with specific keywords, Dockerized Tweet capture application on an AWS EC2 instance, and AWS services like Kinesis Firehose, S3, IAM roles, CloudWatch, Lambda functions, MySQL DB, and OpenSearch. The architecture was adjusted to include Amazon Simple Queue Service (SQS) for better handling of Lambda function triggers.

  23. 23
    Article
    Avatar of communityCommunity Picks·2y

    Dependency Injection

    Dependency Injection (DI) is a style of object configuration where an external entity sets an object's fields and collaborators. This helps in making the object more flexible and testable. The provided example demonstrates how to decouple a class from its dependencies by injecting them via constructors, improving maintainability. The concept is extended through layers of the application to enhance modularity.

  24. 24
    Article
    Avatar of trunkioTrunk.io·2y

    How it feels to keep it simple stupid

    The author discusses their shift from an over-engineered project with multiple microservices to a simpler setup using Next.js for the frontend, a monolith backend, and a single PostgreSQL database within a monorepo. They highlight improved development experience with tRPC and Drizzle, and outline current challenges like teaching trunk-based development and optimizing CI processes.