Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds

ProgrammingPro

29 Articles
Divya Anne Selvaraj
06 Mar 2025
Save for later

ProgrammingPro #92: ByteDance's Trae AI Code Editor, Malicious Go Packages, Building AI Agents, and GPU Architecture

Divya Anne Selvaraj
06 Mar 2025
Bite-sized actionable content, practical tutorials, and resources for programmers#92:ByteDance's Trae AI Code Editor, Malicious Go Packages, Building AI Agents, and GPU ArchitectureHi ,Welcome to a brand new issue of ProgrammingPro.In today’sExpert Insight, we bring you an excerpt from the recently published book, TypeScript 5 Design Patterns and Best Practices, Second Edition, which discusses how developers transitioning from Java or Go often bring non-idiomatic patterns—such as Java’s verbose POJOs or Go’s explicit error-checking—both of which TypeScript simplifies with interfaces, factory functions, and exception handling.News Highlights: ByteDance launches Trae, an AI-powered code editor with free DeepSeek R1 and Claude 3.7 Sonnet access; GitHub expands Advanced Security tools to Team subscribers; major AI updates include OpenAI's GPT-4.5 preview and Claude Code; and seven malicious Go packages deploy malware on Linux and macOS.My top 5 picks from today’s learning resources:How to boost Python program performance with Zig⚡The correct way to do type punning in C++🔀Michigan TypeScript Founder Successfully Runs Doom Inside TypeScript's Type System🎮Roadmap: Understanding GPU Architecture🖥️Building AI Agents from Scratch | Full Course🧠But there’s more, so dive right in.Stay Awesome!Divya Anne SelvarajEditor-in-ChiefSign Up|Advertise🗞️News and Analysis🔎ByteDance Launches New AI Coding Tool Trae with DeepSeek R1 and Claude 3.7 Sonnet Free For All Users: Traesupports Visual Studio Code plugins, and provides Builder and Chat modes for generating applications and assisting with code.GitHub unbundling its GitHub Advanced Security offering starting in April: Previously available only to GitHub Enterprise customers, these tools will now be accessible to GitHub Team subscribers, expanding security options for organizations of all sizes.Feb 28, 2025: 10 AI updates from the past week: Updates include OpenAI's GPT-4.5 preview, Anthropic's Claude 3.7 Sonnet and Claude Code, Google’s Gemini 2.0 Flash-Lite and free Gemini Code Assist, and Microsoft’s Phi-4 models.Seven Malicious Go Packages Found Deploying Malware on Linux and macOS Systems: Although still available on the official package repository, most corresponding GitHub repositories have been taken down.OpenSSF Publishes Security Baseline for Open-Source Projects: The Open Source Project Security Baseline (OSPS) isa tiered security framework designed to help open-source maintainers improve project security by aligning with international cybersecurity standards.TypeScript 5.8 reaches general availability: The version introduces granular checks for branches in return expressions, performance optimizations, and improved ECMAScript module support.C++ creator calls for help to defend programming language from 'serious attacks': As cybersecurity experts advocate for languages with inherent memory safety features, Stroustrup has proposed the Profiles memory safety framework to enhance C++'s safety without a complete overhaul.🎓Tutorials and Learning Resources💡Legend:🎓 Tutorial/Course | 💼 Case Study | 💡 Insight/Analysis | 📜 Academic Paper |📖 Open Source BookPython💡The Secret Life of __init__.py : Why This Tiny File Holds the Key to Python’s Magic: Explains the purpose and functionality of the __init__.py file in Python, highlighting its crucial role in treating directories as packages and organizing modules efficiently within a Python project.🎓How to boost Python program performance with Zig: Covers both C-style shared libraries and native Python extensions, while highlighting tools like Pydust for easier development.For more Python resources, go to PythonProC# and .NET🎓Building Local AI Agents: Semantic Kernel and Ollama in C#: Details setting up the environment, creating a simple non-agentic agent, and running it to handle basic interactions, focusing on integrating Small Language Models.💡Unlock new possibilities for AI Evaluations for .NET: Introduces the Microsoft.Extensions.AI.Evaluations library, now open source, designed to integrate AI evaluation processes into .NET applications.🎓Poisson Regression Using C#: Demonstrates a technique useful for predicting counts in data approximating a Poisson distribution, such as call volumes and explains how to set up a model, train it with synthetic data, and interpret results.C++ and C💡C++26: no more UB in lexing: Discusses the resolution of undefined behaviors in C++ lexing through Corentin Jabot's proposal, P2621R3, which has been accepted to amend issues dating back to C++98.🎓The correct way to do type punning in C++: Explains the proper use of std::bit_cast in C++20 for safe type punning, replacing older methods that risk undefined behavior, in this informative tutorial.🎓Abusing C to implement JSON Parsing with Struct Methods: Covers parsing various JSON components such as atoms, arrays, and objects, and includes tips on managing memory and debugging.Java💡Microbenchmarks: Java Locks vs Atomic: Compares Java concurrency tools—synchronized, ReentrantLock, and AtomicLong—in microbenchmarks, finding that AtomicLong is the fastest.🎓SQL Injection in JDBC: A Technical Deep Dive: Using technical examples, the article explains that PreparedStatement separates SQL commands from data inputs, avoiding direct concatenation that leaves room for injection.💡How Java’s try-finally Blocks Work Without catch: Explains how Java's try-finally blocks ensure cleanup tasks are completed regardless of exceptions, using examples to demonstrate this fundamental behaviorJavaScript and TypeScript💡JavaScript Fatigue StrikesBack: Discusses the evolving JavaScript ecosystem, highlighting the complexity of choosing the right framework amidst rapid developments and new features like server-side rendering.🎓Preventing race conditions: My experience with LockManager in JavaScript: Describes using the LockManager API in JavaScript to effectively prevent race conditions across multiple browser tabs by ensuring exclusive function execution.💡Michigan TypeScript Founder Successfully Runs Doom Inside TypeScript's Type System: Mitropoulos achieved the remarkable feat by using an extensive and optimized codebase that processed 177 terabytes of TypeScript types to render the game.Go💡The cost of Go’s panic and recover: Explains how using Go's panic and recover for control flow is non-idiomatic and can degrade performance due to heavy computational demands and the mechanisms' tendency to prevent compiler optimizations.🎓Tips to debug hanging Go programs: Takes you through a detailed example involving the gokrazy/rsync tool and covers using SIGQUIT to print stack traces, attaching the Delve debugger for deeper analysis, and more.Rust🎓Demystifying monads in Rust through property-based testing: Explores monadic patterns in depth, offering practical Rust code examples and demonstrating how these patterns can significantly slow down the shrinking process.🎓Socrates is a state machine: Explores using Rust's async/await syntax, which de-sugars into a state machine, to write state machines for sans I/O network protocol APIs, demonstrating the process with the 9p protocol example.Swift💡What is Structured Concurrency?: Explains the paradigm's benefits for simplifying asynchronous programming by improving code readability, maintainability, and error handling, contrasting it with previous methods that used closures and Grand Central Dispatch.💡Clean Architecture + Swift 6: Discusses integrating Swift 6 features into an existing Clean Architecture setup for SwiftUI, detailing the transition to async/await for better asynchronous handling, and more.PHP💡The problem with indirections: Discusses the problematic overuse of indirections in programming, such as unnecessary variables, methods, and interfaces that complicate code and reduce maintainability.🎓Selenium in PHP for Web Scraping: A Step-by-Step Guide!: Covers setup, code examples, and best practices for effectively extracting data from dynamic JavaScript-heavy websites.SQL📜Debunking the Myth of Join Ordering: Toward Robust SQL Analytics: Introduces Robust Predicate Transfer (RPT), a new approach to SQL join order optimization that ensures robustness against varying join orders in acyclic queries.💡This Is Probably the Most Perfect Programming for Solving SQL Data Analysis Pain Points: Introduces esProc SPL as a superior alternative to SQL for complex data analysis tasks, highlighting its ability to process local file data directly without a database, and its simpler, procedural syntax.Ruby📖Open Source Book | I Love Ruby: A a comprehensive guide to learning Ruby covering installation, tools, basic to advanced programming concepts, and real-world examples and exercises.💡What's The Deal With Ractors?: Delves into the functionality and practicality of Ractors in Ruby, emphasizing their design for in-process parallelism without fully eliminating the Global VM Lock (GVL).Kotlin💼Kotlin Multiplatform (KMP) Scalability Challenges on a Large Project: Delves into the challenges and benefits of migrating a product feature from native development to KMP, and offers insights into KMP's performance and integration into existing systems.🎓Kotlininlinereifiedto Solve Type Erasure, and a Practical Guide onnoinline,crossinline , and More: Covers inline and reified keywords, explains their combined usage through practical examples, and discusses performance benefits and limitations.🌟Advanced Concepts🚀🎓Roadmap: Understanding GPU Architecture: Aims to explain the key architectural features of GPUs, how they compare to CPUs, and the implications for programming General-Purpose computing on GPUs (GPGPU).🎓Building AI Agents from Scratch | Full Course: Compiles four lessons on agentic design patterns into a single course, covering reflection, tool use, planning (React), and multi-agent patterns. Each pattern is implemented from scratch using Python and Groq as the LLM provider.💼Adopting Arm at Scale: Transitioning to a Multi-Architecture Environment: Details Uber's strategic scale-up from implementing Arm-based hosts in a primarily x86 infrastructure to a multi-architecture system involving thousands of services.💼Implementing a virtual rail architecture: Explains how IBM adapted traditional leaf/spine networking with virtual rail redundancy to balance network performance and reliability, addressing issues like unbalanced queue-pairs, Ethernet port utilization, and redundancy failures.💡Architectures of modern Front-end applications: Compares classical, modular, and Feature Sliced Design (FSD) architectures in modern front-end development, explaining their structures, benefits, and trade-offs.🧠Expert Insight📚Here’s an excerpt from “Chapter 10: Anti-Patterns and Workarounds" in the book, TypeScript 5 Design Patterns and Best Practices, Second Edition, by Theofanis Despoudis, published in February 2025.Using idiomatic code from other languagesWhen developers transition to TypeScript from other languages, they often bring coding patterns and idioms that may not be ideal in TypeScript. Although many programming concepts are shared between many languages,such as control loops, classes, and functions, there are many other concepts particular to one language that cannot be used in adifferent language.In the next subsections, we show some obvious cases where using some idiomatic constructs from other languages will not work well with TypeScript, starting first with theJava language.From the Java languageJava developers often usePlain Old Java Objects(POJOs) orJavaBeans. Let’s look at how this pattern might be inappropriately applied in TypeScript and then how toimprove it.POJO is a naming convention for creating a class that follows some rules, especially in the context of Java EE where object serialization is crucial for some operations. The more standardized version of POJOs is the JavaBean naming convention. When following this convention, you will need to adhere to thefollowing rules:Access levels: We mark all properties asprivateand we only allowgetterandsettermethods for accessor modification.Method names: When defininggetters, you will need to prefix the method withget– for example,getName()orgetEmail(). When definingsetters, you will need to prefix the method withset– for example,setName()orsetEmail().Default constructor: You need to use a constructor with no arguments and it mustbepublic.Serializable: The class needs to implement theSerializableinterface.To understand why using POJOs in TypeScript is not ideal, we’ll show an example class in TypeScript for a typicalEmployeemodel:Idiomatic-code.tsclass Employee { constructor(private id: string, private name: string) {} getName(): string { return this.name } setName(name: string) { this.name = name } getId(): string { return this.id } setId(id: string) { this.id = id }}If you attempt to declare more than one constructor in TypeScript, then you will find that it’s not allowed, so you cannot provide both a no-argument constructor and another one with arguments. Additionally, TypeScript will complain if you provide a no-argument constructor as the property’snameandIDmay have notbeen initialized.You will see thefollowing errors:Figure 10.1 – TypeScript compiler message when it complains when you use a no-argument constructorThe concept of serialization applies to Java only, so it’s not relevant to TypeScript. However, you can serialize plain TypeScript objects using theJSON.stringifymethodas follows:console.log(JSON.stringify(new Employee("Theo", "1")));//{"id":"Theo","name":"1"}You will find that this works only for basic cases and does not handle polymorphism, object identity, or when containing native JavaScript types such asMap,Set, orBigInt. However, in most cases, you can implement a custom object mapper or use a Factory Method to convert an object to JSON andvice versa.The use ofget/setmethods is overly verbose and not needed most of the time. If you want to provide encapsulation, you can only havegettermethods and if you want to modify an existingEmployeeclass method, you just create a newEmployeeinstance with the updated fieldname instead:const theo = new Employee("Theo", "1");new Employee(theo.getName(), "2");Finally, you may opt out of using classes altogether as you can work with types, type assignments, and object de-structuring,as follows:Idiomatic-code.tsinterface Employee { readonly id: string; readonly name: string; readonly department: string;}function createEmployee(id: string, name: string, department: string): Employee { return { id, name, department };}function updateEmployee(employee: Employee, updates: Partial<Employee>): Employee { return { ...employee, ...updates };}const emp = createEmployee('1', 'John Doe', 'IT');console.log(emp.name); // John Doeconst updatedEmp = updateEmployee(emp, { department: 'HR' });console.log(updatedEmp.department); // HRThis approach uses an interface instead of a class for simple data structures and provides factory functions for creation and updates, promoting immutability. This form is more idiomatic TypeScript and is the preferred way to workwith types.Now let’s look at some of the idiomatic constructs from theGo language.TypeScript 5 Design Patterns and Best Practices, Second Edition was published in February 2025. Packt library subscribers can continue reading the entire book for free or you can buy the book here!Get the eBook for $31.99$27.99🛠️Useful Tools⚒️onyx: An open-source Gen-AI and enterprise search platform that integrates with any LLM, connects to 40+ enterprise apps, and enables secure, scalable AI-powered research, chat, and custom agents.globstar: An open-source static analysis tool that lets developers write and run custom checkers using tree-sitter queries or Go in a single binary, integrating easily into CI/CD pipelines.drawdb: A free, browser-based database schema editor and SQL generator that lets you create, customize, and export diagrams effortlessly without an account.That’s all for today.We have an entire range of newsletters with focused content for tech pros. Subscribe to the ones you find the most usefulhere.If your company is interested in reaching an audience of developers, software engineers, and tech decision makers, you may want toadvertise with us.If you have any suggestions or feedback, or would like us to find you a learning resource on a particular subject, just respond to this email!*{box-sizing:border-box}body{margin:0;padding:0}a[x-apple-data-detectors]{color:inherit!important;text-decoration:inherit!important}#MessageViewBody a{color:inherit;text-decoration:none}p{line-height:inherit}.desktop_hide,.desktop_hide table{mso-hide:all;display:none;max-height:0;overflow:hidden}.image_block img+div{display:none}sub,sup{font-size:75%;line-height:0}#converted-body .list_block ol,#converted-body .list_block ul,.body [class~=x_list_block] ol,.body [class~=x_list_block] ul,u+.body .list_block ol,u+.body .list_block ul{padding-left:20px} @media (max-width: 100%;display:block}.mobile_hide{min-height:0;max-height:0;max-width: 100%;overflow:hidden;font-size:0}.desktop_hide,.desktop_hide table{display:table!important;max-height:none!important}}
Read more
  • 0
  • 0
  • 854

Divya Anne Selvaraj
27 Feb 2025
Save for later

ProgrammingPro #91: Rust 1.85 Upgrades, Gemini Code Assist Privacy Concerns, Copilot Extensions, and TypeScript Migration at Scale

Divya Anne Selvaraj
27 Feb 2025
Bite-sized actionable content, practical tutorials, and resources for programmers#91:Rust 1.85 Upgrades, Gemini Code Assist Privacy Concerns, Copilot Extensions, and TypeScript Migration at ScaleJoin Snyk's Fetch the Flag CTF 2025!Snyk’s annual Capture the Flag event, Fetch the Flag 2025, is back! Hosted by Snyk and John Hammond, the event will take place on February 27, 2025, from 9am ET to 9pm ET. Engage in 20+ real-world security challenges, enhance your professional development & earn CPE credits.Register for free!Hi ,Welcome to a brand new issue of ProgrammingPro.In today’sExpert Insight, we bring you an excerpt from the recently published book, ASP.NET Core 9.0 Essentials, which covers best practices for handling HTTP requests, including input validation and sanitization, asynchronous programming, and using caching and compression.News Highlights: Rust 1.85.0 brings language and tooling upgrades; Google’s free Gemini Code Assist collects user code by default; AI coding tools may harm code quality, says GitClear; and GitHub Copilot Extensions now integrate external services into IDEs.My top 5 picks from today’s learning resources:Slashing my ".bashrc" in half⚡Migrating 160,000 Lines of Production Banking JavaScript to TypeScript with Zero Downtime🔄Calling Rust from cursed Go🧙‍♂️Programming and architectural paradigms🏛️Prompt Engineering: Challenges, Strengths, and Its Place in Software Development's Future🧠But there’s more, so dive right in.Stay Awesome!Divya Anne SelvarajEditor-in-ChiefSign Up|Advertise🗞️News and Analysis🔎.NET 10 Preview 1 is now available!: Key updates include OpenAPI 3.1 support in ASP.NET Core, performance enhancements in .NET MAUI, and new Entity Framework Core capabilities.Announcing Rust 1.85.0 and Rust 2024: This version introduces language improvements, enhances the standard library, updates Cargo functionalities, and makes significant changes to Rustdoc and Rustfmt.Google previews free Gemini Code Assist tier – uses your code to improve AI models by default: Google has launched a free tier of Gemini Code Assist, offering up to 180,000 monthly code completions, but collects user code by default to improve its AI models unless developers opt out.AI is eroding code quality states new in-depth report: A GitClear report analyzing 211 million lines of code has found that AI coding assistants increase duplicated and copy-pasted code while reducing refactoring, leading to declining code quality. In contrast, Google’s DORA report claimed AI improves code quality by 3.4% butalso found a 7.2% decline in delivery stability.GitHub Copilot Extensions Integrate IDEs with External Services: GitHub Copilot Extensions, now generally available, allow developers to query documentation, generate code, retrieve data, and interact with external services directly from their IDEs using natural language.Laravel12 released: The version introduces updated dependencies, minimal breaking changes, and new starter kits for React, Vue, and Livewire, incorporating Inertia 2, TypeScript, and Tailwind.JDK 24: The new features in Java 24: Key improvements include enhanced concurrency, quantum-resistant cryptography, optimized garbage collection, streamlined object headers, and new APIs for key derivation.🎓Tutorials and Learning Resources💡Python💡Slashing my ".bashrc" in half: Discusses how the author improved their shell configuration by replacing numerous plugins with efficient, modern Rust-based tools, resulting in a faster, leaner, and easier-to-maintain ".bashrc."For more Python resources, go to PythonProC# and .NET🎓Abusing await with a result type to achieve rust-like error propagation in C#: Demonstrates a way to achieve Rust-like error propagation in C# by abusing await with a custom AsyncMethodBuilder.🎓Writing a .NET Garbage Collector in C# - Part 4: Covers how .NET's garbage collector tracks and manages memory, as well as how allocation strategies impact performance and efficiency.🎓Mastering Controllers in .NET APIs: Explains relative vs. absolute routes, passing parameters via URLs, query strings, and request bodies, and includes examples for API versioning, error handling, and documentation.C++ and C💡Is coding in Rust as bad as in C++?: Discusses the performance trade-offs of Rust vs. C++ builds, optimization techniques for both languages, and why C++ still has an edge in compilation speed for large-scale projects.💡Smart Pointers Can't Solve Use-After-Free: Explains why smart pointers alone aren't sufficient for preventing dangling pointers and how C++'s lack of enforced lifetimes makes it more error-prone compared to safer languages.💡Curl’s Daniel Stenberg on Securing 180,000 Lines of C Code: Curl's creator discusses the security challenges of maintaining C code in an open-source project with 20 billion installations, instead of rewriting in Rust.Java🎥Modern Java Deep Dive: Focuses on new features post-Java 21, alongside enhancements in garbage collection and the integration of markdown in JavaDocs and the phasing out of older Java components like the Security Manager and RMI Activation.🎓Using Java Libraries in BoxLang: Covers how to integrate Java libraries into BoxLang applications to enhance functionality using the Java Virtual Machine, with a focus on parsing RSS feeds using the 'rssreader' library.💡Handle Exceptions in Spring Boot: A Guide to Clean Code Principles: Covers best practices for implementing robust exception handling in Spring Boot applications to write clearer, more maintainable code aligned with clean code principles.JavaScript and TypeScript💡Speeding up the JavaScript ecosystem - Rust and JavaScript Plugins: Details how flattening the AST and leveraging node indexing can significantly reduce deserialization overhead.🎓A Mere Mortal’s Introduction to JIT Vulnerabilities in JavaScript Engines: Provides an introductory guide to JIT compiler vulnerabilities in JavaScript engines, aiming to demystify a complex topic usually reserved for "smart people.💼Migrating 160,000 Lines of Production Banking JavaScript to TypeScript with Zero Downtime: Discusses how WorkMade successfully migrated to TypeScript within six weeks to enhance maintainability and security.Go💡Faster Go maps with Swiss Tables: Discusses the introduction of a new hash table design, detailing its benefits and the unique challenges involved in adapting this efficient C++ hash table strategy to Go’s map implementation.🎓Tcl/Tk application binaries through Go: Covers how to use the modernc.org/tk9.0 Go package to convert Tcl/Tk 9.0 into standalone executables, enabling Go developers to use Tk without C dependencies.Rust🎓Calling Rust from cursed Go: Discusses integrating Rust with Go using a non-CGO method to handle foreign function interfaces (FFI), particularly focusing on calling Rust from Go without traditional drawbacks associated with CGO.💼Towards Practical Formal Verification for a General-Purpose OS in Rust: Discusses ensuring memory safety by verifying Asterinas operating system's page management module using the framekernel architecture.Swift💼How Swift's server support powers Things Cloud: Explains how Cultured Code rewrote Things Cloud's backend in Swift, detailing the architecture, deployment, and performance improvements.🎓Task.sleep() vs. Task.yield(): The differences explained: Explains the differences between the two, when to use each, and their impact on concurrency performance in Swift.PHP💡Laravel vs Django and Rails for SaaS Development: Comprehensively evaluates their performance, scalability, developer experience, ecosystem, hosting, deployment, and cost.💡Reclaiming Memory from PHP Arrays: Explains how PHP handles memory for arrays, why unset() alone is insufficient, and when to rebuild arrays for optimal memory management.SQL💡Streaming SQL in Stateful DataFlows: Discusses the evolution of SQL from its origins to its role in modern data streaming, highlighting Fluvio’s new SQL stream processing feature that enables real-time querying and transformation of streaming data.🎓Using Cloudflare Durable Objects with SQL Storage, D1, and Drizzle ORM: Provides a detailed guide on integrating Cloudflare Durable Objects with the D1 SQL database using Drizzle ORM, covering setup, configuration, schema migrations, deployments, and testing within a Hono-based Bun application.Ruby💡Advanced Queries in ActiveRecord for Ruby on Rails: Explores advanced ActiveRecord querying techniques in Ruby on Rails, covering complex joins, self-referential associations, JSON/JSONb columns, and database-specific optimizations for PostgreSQL.🎓RSpec Mocks & Doubles: The Secret Sauce for Testing Like a Pro: Explains RSpec mocks and test doubles using code examples demonstrating how to use stubs, expectations, and spies for testing in Ruby on Rails.Kotlin🎧How Meta is translating its Java codebase to Kotlin:In this podcast episode, engineers discuss challenges like handling nullability, ensuring idiomatic Kotlin code, and adapting Meta’s internal frameworks.🎓Server-Driven UI with Compose Remote Layout: Explains how to use Compose Remote Layout to build adaptable UIs controlled via JSON, implement dynamic value binding, create custom components, and leverage a live editor.🌟Advanced Concepts🚀Rethink State💡 Why You Should Model Your Frontend Around Events: advocates for shifting frontend development from CRUD-based state management to event-driven architecture (EDA), where UI interactions dispatch events instead of directly modifying data.Prompt Engineering: Challenges, Strengths, and Its Place in Software Development's Future: Delves into the structural similarities and differences between prompt engineering and programming and more.Intro to Elixir: A fresh take on functional programming: Introduces Elixir, highlighting its functional programming features, immutable data structures, pattern matching, concurrency model using actors, and unique syntax.Programming and architectural paradigms: Examines how object-oriented, functional, and procedural programming paradigms influence software architecture, particularly in Microservices, Event-Driven Architecture, and Space-Based Architecture.Software Architecture — Things That No One Has Told You: Outlines essential skills for software architects, covering negotiation, influencing, prioritization, communication, problem-solving, critical thinking, and business-technology translation.🧠Expert Insight📚Here’s an excerpt from “Chapter 7: Adding Capabilities to Applications" in the book, ASP.NET Core 9.0 Essentials, by Albert S. Tanure, published in January 2024.HTTP request best practicesThe HTTP request is a fundamental component when working with web applications. Proper handling of HTTP requests can significantly impact the performance and reliability ofyour application.We have already learned about thetypes of HTTP verbs and status codes in Chapter 3. However, each HTTP method provided by the application must be treated appropriately, to avoid inconsistencies in the application andavoid vulnerabilities.Furthermore, the way HTTP requests are made directly impacts the experience of users or consumers ofyour solution.Let’s understand some good practices related toHTTP requests.Validate and sanitize inputAlways validate and sanitize input to prevent security vulnerabilities such as SQL injection andcross-sitescripting(XSS).XSS is a security vulnerability where the attacker injects scripts into web pages. To know more, gotohttps://learn.microsoft.com/en-us/aspnet/core/security/cross-site-scripting?view=aspnetcore-9.0.Consider a scenario where a user submits a form with a username. To prevent harmful data from being processed, you should validate the input to ensure it meets the expected criteria and sanitize it to remove anymalicious content:public IActionResult Submit(string username){ if (string.IsNullOrEmpty(username)) { return BadRequest("Username is required."); } username = HttpUtility.HtmlEncode(username); // Proceed with processing the username return Ok();}The preceding code demonstrates a simple validation of the username parameter,if(string.IsNullOrEmpty), avoiding using it incorrectly. TheHttpUtility.HtmlEncode(username)method is used to convert characters such as<,>,&, and so on into anHTML-encoded format.Use asynchronous methodsDuring the execution flow of an HTTP request, we must avoid making the processing actions synchronous. Otherwise, this could degrade the user experience and cause some problems for the application, such asthe following:Thread blocking: Synchronous methods block the thread while waiting for I/O operations (such as database queries, file access, or network requests) to complete. In an ASP.NET Core application, the thread pool is alimited resource.Thread pool exhaustion: When an application heavily relies on synchronous methods, the thread pool can become exhausted, especially under high load, which occurs when all available threads are blocked and no new threads are available to handleincoming requests.It is a recommendation and good practice to use asynchronous methods to improve performance and scalability. For example, when using theHttpClientobject to make a request in an API, use theHttpClient.SendAsyncmethod insteadofHttpClient.Send.Asynchronous programming allows your application to handle multiple tasks simultaneously without waiting for each task to complete before starting the next one. This is similar to how a chef in a busy kitchen might prepare multiple dishes at once, rather than finishing one dish beforestarting another.We will cover the use of asynchronous programming in more detail in theAsynchronous requests and I/O optimizationsection. Now, let’s understand another good practice in relation to HTTP requests, regarding cachingand compression.Caching and compressionRequests via the HTTP protocol have some attributes, including headers and body. During communication between an application and the backend, this information is transmitted, and the headers are used both by the client (in this case, the browser) and bythe backend.There are several types of HTTP headers, including those associated with cachingandcompression.By utilizing caching and response compression, we can reduce bandwidth usage and improve load times. Browsers also identify these headers, avoiding unnecessary requests tothe server.Caching and dating compression work similarly to how alibrary might keep frequently borrowed books readily accessible or how a vacuum-sealed package takes up less space. These practices reduce the load on your server and speed up responses touser requests.Let’s analyze the following code snippet extracted from aProgram.csclass:// Add services to the container. builder.Services.AddResponseCaching();app.UseResponseCaching();app.Use(async (context, next) => { context.Response.GetTypedHeaders().CacheControl = new Microsoft.Net.Http.Headers.CacheControlHeaderValue { Public = true, MaxAge = TimeSpan.FromMinutes(10) }; await next();});Let’s understand the preceding code. When you addapp.UseResponseCachingto the application’smiddlewarepipeline, it performs thefollowing functions:Checks forCache-Control headers:The middleware checks whether the incoming request can be cached based on the presence ofCache-Control headersIf a valid Cache-Control header is found and it allows caching, the middleware proceeds to handlethe requestStores responses inthe cache:If the response to the request can be cached, the middleware stores the response inthe cacheSubsequent requests that match the cache criteria will be served directly from the cache, bypassing the need to generate theresponse againServescached responses:For requests that match previously cached responses, the middleware serves thecached responseThis reduces the processing time and load on the server, as the response is retrieved directly fromthe cacheTheapp.Use(async (context, next)method adds the necessary parameters for the Cache-Control header to the middleware pipeline, such as the cache duration time. This is necessary so that the client can know how the response shouldbe cached.The cache is managed in the application’s memory and, therefore, it is not interesting to keep the cache for a large amount of time in memory, which could cause problems. However, it is good practice to use it. We will go into more detail about cache usage in the next section,Improving performance with a cache strategy and making theapplication resilient.ASP.NET Core 9.0 Essentialswas published in December 2024. Packt library subscribers can continue reading the entire book for free or you can buy the book here!Get the eBook for $31.99$21.99🛠️Useful Tools⚒️tach: ARust-based Python tool for enforcing modular architecture by validating dependencies, preventing cycles, and ensuring interface correctness.MetaGPT: A multi-agent framework that assigns specialized roles to GPTs, enabling AI collaboration to automate software development tasks.pandas-ai: A Python tool for querying and analyzing data using natural language, with support for visualizations, multi-dataset analysis, and more.That’s all for today.We have an entire range of newsletters with focused content for tech pros. Subscribe to the ones you find the most usefulhere.If your company is interested in reaching an audience of developers, software engineers, and tech decision makers, you may want toadvertise with us.If you have any suggestions or feedback, or would like us to find you a learning resource on a particular subject, just respond to this email!*{box-sizing:border-box}body{margin:0;padding:0}a[x-apple-data-detectors]{color:inherit!important;text-decoration:inherit!important}#MessageViewBody a{color:inherit;text-decoration:none}p{line-height:inherit}.desktop_hide,.desktop_hide table{mso-hide:all;display:none;max-height:0;overflow:hidden}.image_block img+div{display:none}sub,sup{font-size:75%;line-height:0}#converted-body .list_block ol,#converted-body .list_block ul,.body [class~=x_list_block] ol,.body [class~=x_list_block] ul,u+.body .list_block ol,u+.body .list_block ul{padding-left:20px} @media (max-width: 100%;display:block}.mobile_hide{min-height:0;max-height:0;max-width: 100%;overflow:hidden;font-size:0}.desktop_hide,.desktop_hide table{display:table!important;max-height:none!important}}
Read more
  • 0
  • 0
  • 571

Divya Anne Selvaraj
20 Feb 2025
Save for later

ProgrammingPro #90: React 19 Breaks CRA, AI-Powered Testing, Malicious Code Scanner, and Top Python Visualization Tools

Divya Anne Selvaraj
20 Feb 2025
Bite-sized actionable content, practical tutorials, and resources for programmers#90:React 19 Breaks CRA, AI-Powered Testing, Malicious Code Scanner, and Top Python Visualization ToolsJoin Snyk's Fetch the Flag CTF 2025!Snyk’s annual Capture the Flag event, Fetch the Flag 2025, is back! Hosted by Snyk and John Hammond, the event will take place on February 27, 2025, from 9am ET to 9pm ET. Engage in 20+ real-world security challenges, enhance your professional development & earn CPE credits.Register for free!Hi ,Welcome to a brand new issue of ProgrammingPro.In today’sExpert Insight, we bring you an excerpt from the recently published book, Software Architecture with Kotlin, which discusses the You Ain’t Gonna Need It (YAGNI) principle, emphasizing minimalism, avoiding over-engineering, and adapting to change by implementing only necessary features.News Highlights: React deprecates Create React App due to React 19 issues; Apiiro launches PRevent, a PR scanner for malicious code; Meta introduces ACH, an LLM-powered mutation testing tool; and Google introduces Gen AI Toolbox for Databases.My top 5 picks from today’s learning resources:Top Python Data Visualization Libraries of 2025📊From Rust to TypeScript: A New Chapter for Prisma ORM🔄2024 State of Rust Survey Results🦀The Software Event Horizon: Why Your Project Slows to a Crawl and How to Prevent It🐌Stop Conflating CQRS and MediatR📡But there’s more, so dive right in.Stay Awesome!Divya Anne SelvarajEditor-in-ChiefC++ Online Conference 2025 | 26th – 28th February – 15% Off Main Conference for ProgrammingPro Readers!🚀 Three days. 20+ expert talks. Live Q&A. Interactive sessions. Join the global C++ community from anywhere—no travel, no hassle, just top-tier learning.🎓 What’s in store?✅ Workshops (24th Feb – 7th Mar) – Master embedded systems, concurrency, coroutines, and more. Includes free main conference access.✅ Main Conference (26th – 28th Feb, 12:00 – 22:00 UTC) – Live talks, lightning sessions, interactive posters, and open community discussions.✅ Exclusive Features – Build your own agenda, access slides, join meetups, and network in an interactive virtual venue.💰 Exclusive Offer: ProgrammingPro readers get 15% off the main conference pass with code PACKT2025_15.Register now!Sign Up|Advertise🗞️News and Analysis🔎New open source tools to detect, defend against malicious code: Apiiro has released PRevent, a pull request scanner for detecting malicious code, and a Semgrep-based ruleset to help organizations combat code injection threats.React team formally deprecates Create React App (CRA) following ‘perfect storm of incompatibility’: CRA, introduced in 2016, was widely used but lacked critical features like routing, data fetching, and performance optimizations.Meta Introduces LLM-Powered Tool for Software Testing: Meta has introduced the Automated Compliance Hardening (ACH) tool, an LLM-powered mutation testing system that generates faults in code and creates targeted tests.C# Dev Kit Update: Enhancements to Solution-less Workspace and More: The latest update introduces solution-less workspace mode, .NET Aspire orchestration, and enhanced Razor/Blazor support.Feb 14, 2025: Development tools that have recently added new AI capabilities: Updates include Google’s Gen AI Toolbox for Databases, JetBrains AI Assistant’s local model support, Meta’s Imagen 3 API, and more.GitLab Release Brings Protected Container Repositories; Fixes XSS Vulnerability: GitLab 17.8 introduces protected container repositories, ML experiment tracking, VS Code SAST scanning, and enhanced deployment tracking.Type-safe C-killer Delphi hits 30, but a replacement has risen: The open-source Lazarus IDE with FreePascal has emerged as a powerful, cross-platform alternative with support for Delphi imports, which runs on Windows, Linux, macOS, and BSD.🎓Tutorials and Learning Resources💡PythonTop Python Data Visualization Libraries of 2025:pygwalkerleads as a low-code tool,matplotlib remains foundational with GPU support, and Plotly dominates dashboards. Seaborn,Bokeh, andAltaircater to statistical, streaming, and academic needs.For more Python resources, go to PythonProC# and .NET🎓How to Use Substring in C#: A Detailed Guide:Covers practical examples, edge cases, and common pitfalls, such as ArgumentOutOfRangeException , and offers solutions.🎓Create a Windows Forms app in Visual Studio with C#: Covers setting up a project, adding a button and a label, writing event-handling code, and running the application.💡Understand the .NET Framework requirements for various versions of SQL Server: Provides tables listing required .NET versions, whether they are included in SQL Server setup, and special installation steps for older Windows versions.C++ and C💡0+0 > 0: C++ thread-local storage performance: Explores TLS implementation details, including assembly-level behavior, compiler-generated overhead, and shared library implications.💡Understanding Memory Management, Part 2: C++ and RAII: Explains structs, object-oriented principles, inheritance, constructors, destructors, copy constructors, copy assignment operators, and more.💡Old C dog, new C tricks: NULL != ptr: Discusses a common C programming mistake—accidentally using = instead of == in conditionals—and how writing comparisons in reverse (e.g., if (42 == a)) prevents this error.Java🗞️Introducing the Model Context Protocol Java SDK: Discusses the SDK, explaining its features, integration with Spring AI, and how it enables seamless AI model interoperability.🎓The Hilarious World of Java Event Listeners: Humorously explains Java event listeners using relatable analogies, demonstrating how they handle button clicks, mouse movements, and keyboard inputs through practical examples.💡Deep Dive: Spring Boot with Apache Tomcat — Architecture and Request Handling: Covers architecture, request handling, connection management, thread pooling, scalability considerations, and troubleshooting.JavaScript and TypeScript🎓The Nullish Coalescing Operators: Explains the nullish coalescing operator (??) and nullish coalescing assignment (??=) in JavaScript, highlighting their benefits over || , their role in handling default values, and their applications.🎓How to Generate Insights from PDF Files with Apryse and GPT: Explains how to extract structured data from PDFs using Apryse’s data extraction module and integrate it with GPT-based LLMs to generate financial insights.💼From Rust to TypeScript: A New Chapter for Prisma ORM: Explains the motivations, architectural changes, benefits, and future opportunities for improved compatibility, deployment, and developer experience.Go💡Extensible Wasm Applications with Go: Covers Go 1.24's enhancements to Wasm support, including the go:wasmexport directive for exporting Go functions and the ability to build WASI reactors.💼We switched from Java to Go and don't regret it: Discusses Glasskube's transition from Java to Go, highlighting improved startup times, lower resource consumption, a more lightweight ecosystem, and better suitability for cloud-native applications.Rust🗞️2024 State of Rust Survey Results: Key findings include growing workplace adoption, increasing Rust expertise, concerns over slow compilation and debugging support, and a strong desire for stabilized async features.💡A survey of every iterator variant: Systematically categorizes and examines 17 different iterator variants in Rust, exploring their unique capabilities, challenges, and interactions.Swift🗞️Introducing gRPC Swift 2: The library introduces first-class concurrency support, modern APIs, and improved developer experience for building cross-platform, high-performance services in Swift.🎓Swift – Immediately Invoked Closures (IIC): Explains IIC's benefits, particularly in defining non-trivial properties and lazy initialization while ensuring maintainability and avoiding redundant code.PHP💡Learning from open source PHP projects - Part 1 - Code formatting: Examines best practices in code formatting by analyzing popular open-source PHP projects such as Flowphp, EventSauce, and Tempest.🗞️Accelerating The Adoption of Post-Quantum Cryptography: NIST has released the first Post-Quantum Cryptography (PQC) standards, prompting efforts to integrate these algorithms into PHP.SQL🎓Representing graphs in Postgresql: Explains how to represent and query graph-like data in PostgreSQL using nodes and edges tables, demonstrating simple parent-child lookups, friendship relationships, and recursive CTEs.📜The Impact of Metadata Configurations on Text-to-SQL Performance: A Comprehensive Analysis: Finds that using schema information, column descriptions, foreign keys, primary keys, and common queries yields the highest answer correctness at 84.5%.Ruby💡How I use YARD for Ruby: Introduces a documentation tool for Ruby, explaining its syntax, installation, usage, custom tags, and integration with VSCode.💡Decluttering UI Components in Ruby on Rails with ViewComponent: Explains how ViewComponent’s sidecar pattern helps declutter UI components in Ruby on Rails by consolidating related files, improving modularity, reusability, and maintainability.Kotlin🎓Android Use Cases: From Basic Implementation to Multi-Provider and Multi-Module Systems: Covers single-use cases, multi-provider implementations, and transitioning to multi-module structures.💼Kotlin Multiplatform (KMP) Scalability Challenges on a Large Project: Discusses scaling KMP in a project with over 1000 Gradle modules and 150+ developers, covering KMP migration methods, core library refactoring, and more.🌟Advanced Concepts🚀Google Titans Model Explained: The Future of Memory-Driven AI Architectures: Delves into Google's memory-driven AI model that integrates short-term, long-term, and persistent memory to improve sequence modeling.Architecture Decision Records (ADR): A Tool for Experienced Engineers: Explains ADRs, their purpose, implementation process, and benefits for engineers, highlighting how they improve transparency, and decision-making.Stop Conflating CQRS and MediatR: Clarifies the distinction between the two, explaining that CQRS is a pattern for separating read and write operations, while MediatR is a mediator pattern implementation that facilitates in-process messaging.The Software Event Horizon: Why Your Project Slows to a Crawl and How to Prevent It: Explains how unchecked technical debt, unclear interfaces, poor documentation, and increasing complexity, lead to stalled projects.API Governance: Using Patterns From PayPal, Netflix and More: Discusses different API governance models—centralized, federated, and self-governance—using real-world examples from companies, highlighting their trade-offs.🧠Expert Insight📚Here’s an excerpt from “Chapter 2: Principles of Software Architecture" in the book, Software Architecture with Kotlin, by Jason (Tsz Shun) Chow, published in December 2024.YAGNI and future-proof architectureYou Ain’t Gonna Need It(YAGNI) is a principle that states that functionalities should not be implemented until they are needed. This principle came fromExtreme Programming(XP) as an approach to improve software quality and respond to changing businessrequirements.This principle is also related to the idea of minimalism in software development, which states that we should avoid unnecessary code and complexity in exchange for clean, easy-to-understand, andextensible software.Another way to describe YAGNI is as the imperative to do the simplest thing that works. This is by no means an incomplete design or unfulfilled user requirement. It still promotes complete and functional software that satisfies user requirements with the simplestdesign available.YAGNI aims at a few practices:Simple and lean code base: By implementing only what is necessary now, a lot of complexity can be avoided. As a result, the code base is simple, clean,and maintainable.Prevention of over-engineering: Over-engineering happens when an engineer anticipates future requirements and includes unused features in the system. It not only results in wasted time on unnecessary work but also becomes a dead weight in the code base, which is then made harder to maintain. Over-engineered code also implies a design choice made before there is sufficient information to make that choice, locking in theapproach prematurely.Adaptive and flexible implementation: By delaying the implementation of a feature until it is needed, engineers have more options to adapt to changes when the feature is finally needed. It also encourages a more organic evolution of the system whereby engineers respond more effectively tochanging requirements.Productivity: By focusing on the absolute must-have requirements, engineers can deliver changes more quickly and efficiently. Any unnecessary features can be postponed, saving timeand resources.There is also an opposite idea though:future-proof architecture. It aims at creating systems that are unlikely to be obsolete or to fail in the future. This sounds very appealing. If we can build a system that can fulfill future requirements, we will have saved time and effort that would otherwise be spent continuouslyevolving it.However, there is an assumption behind this. You need to predict the new requirements and you need to be right. That is equivalent to knowing the future. Itrarely happens.If you are certain about requiring a feature in the future, then it is neither a prediction nor a future requirement. It is simply arequirement now.This does not mean that we should build systems based on short-term objectives or take shortcuts. Instead, we should build systems that are ready to adapt to new requirements but not havethese implemented.Capacity planningshould not be mistaken for future-proof architecture. Capacity planning is an operational concern related to deployment and physical resources. For instance, building a road to handle twice the current traffic is different from building a branch of the road that goes nowhere. Leaving headroom for expansion, extra volume, and extra traffic is part of the readiness for evolution. Capacity planning is an NFR, not a future requirement. We would not want the system to run on edges that may collapse in response to a fluctuation in the volumeof requests.This mindset leads to a few outcomes. The software architecture aims for modular, extensible, and flexible components that are ready to make changes when theybecome necessary.It implies that each component is highly cohesive but loosely coupled. It means that interfaces are small and specific. It also means that interactions among components are based on abstract interfaces and not concrete implementations. It further means that subclasses conform to the behaviors of their superclasses and are ready to be extended. Furthermore, it means that each component has only one reason to change. It also means that modifying a component does not require recompiling the entire system. It also means that concerns are separated so that when we want to adjust system quality attributes, we can address the particular concernin isolation.Software Architecture with Kotlinwas published in December 2024. Packt library subscribers can continue reading the entire book for free or you can buy the book here!Get the eBook for $31.99$21.99🛠️Useful Tools⚒️mastra: A TypeScript AI framework with workflows, agents, RAG, and LLM integrations, supporting OpenAI, Anthropic, and Google Gemini.CodeWeaver: A CLI tool that generates a Markdown document of your codebase, outlining its structure and embedding code for easy analysis.OmniParser: A vision-based screen parsing tool from Microsoft that converts UI screenshots into structured data for precise GUI automation with vision models.That’s all for today.We have an entire range of newsletters with focused content for tech pros. Subscribe to the ones you find the most usefulhere.If your company is interested in reaching an audience of developers, software engineers, and tech decision makers, you may want toadvertise with us.If you have any suggestions or feedback, or would like us to find you a learning resource on a particular subject, just respond to this email!*{box-sizing:border-box}body{margin:0;padding:0}a[x-apple-data-detectors]{color:inherit!important;text-decoration:inherit!important}#MessageViewBody a{color:inherit;text-decoration:none}p{line-height:inherit}.desktop_hide,.desktop_hide table{mso-hide:all;display:none;max-height:0;overflow:hidden}.image_block img+div{display:none}sub,sup{font-size:75%;line-height:0}#converted-body .list_block ol,#converted-body .list_block ul,.body [class~=x_list_block] ol,.body [class~=x_list_block] ul,u+.body .list_block ol,u+.body .list_block ul{padding-left:20px} @media (max-width: 100%;display:block}.mobile_hide{min-height:0;max-height:0;max-width: 100%;overflow:hidden;font-size:0}.desktop_hide,.desktop_hide table{display:table!important;max-height:none!important}.reverse{display:table;width: 100%;
Read more
  • 0
  • 0
  • 637
Subscribe to Packt _ProgrammingPro
A weekly Programming newsletter that helps to keep you up to date on industry trends and advance your skills as a developer or software engineer. ProgrammingPro combines original ideas and curated content, deep dives and tools, all in one place.

Divya Anne Selvaraj
13 Feb 2025
Save for later

ProgrammingPro #89: Python 3.14’s 30% Speed Boost, VS Code’s AI Upgrades, Go 1.24 Released, and Building a Rust Driver

Divya Anne Selvaraj
13 Feb 2025
Bite-sized actionable content, practical tutorials, and resources for programmers#89Python 3.14’s 30% Speed Boost, VS Code’s AI Upgrades, Go 1.24 Released, and Building a Rust DriverHi ,Welcome to a brand new issue of ProgrammingPro.In today’sExpert Insight, we bring you an excerpt from the recently published book, Minimal CMake, which explains how to simplify project onboarding using ExternalProject_Add to automate dependency management, reducing manual setup and improving build efficiency by consolidating multiple steps into a single command.News Highlights: Python 3.14’s interpreter boosts performance by 30%; VS Code 1.97 makes Copilot an “out-of-the-box” feature with predictive edits; JetBrains AI Assistant adds local LLM support; Go 1.24 introduces generic type aliases and runtime improvements.My top 5 picks from today’s learning resources:How I Built a Deep Learning Library from Scratch Using Only Python, NumPy & Math🧠We Replaced Our React Frontend with Go and WebAssembly🔄Writing a Simple Driver inRust⚙️Surviving Google’s JavaScript rendering shift: one month later🌍How to Prevent Bugs From Reaching Production🛡️But there’s more, so dive right in.Stay Awesome!Divya Anne SelvarajEditor-in-ChiefPS:We're conducting market research to better understand the evolving landscape of software engineering and architecture – including how professionals like you learn, grow and adapt to the impact of AI.We think your insights would be incredibly valuable, and would love to hear what you have to say in aquick 1:1 conversationwith our team.What's in it for you?✅ Abrief 20–30 minute conversationat a time that’s convenient for you✅ An opportunity toshare your experiences and shape the future of learning✅A free credit to redeem any eBook of your choicefrom our library as a thank-youHow to Participate:Schedule a quick call at your convenience using the link provided after the form:https://forms.office.com/e/Bqc7gaDCKqLooking forward to speaking with you soon!Thank you,Team Packt.Sign Up|Advertise🗞️News and Analysis🔎What you need to know about Python 3.14’s faster interpreter: Theinterpreter aims to improve performance by up to 30% without requiring code changes and is based on tail call improvements at the C level.Go 1.24 is released!: The versionintroduces full support for generic type aliases, runtime performance improvements, a new map implementation, enhanced tool tracking, a test analyzer in go vet , and more.JetBrains AI Assistant can now use local LLMs: The update allows developers with strict privacy requirements to run models locally and adds support for Claude 3.5 Sonnet, Claude 3.5 Haiku, and OpenAI’s o1, o1-mini, and o3-mini models.Microsoft Visual Studio and C# DevKit updates bring long-awaited fixes: Microsoft Visual Studio 2022 17.13 introduces setting UTF-8 without a BOM as the default text file encoding, resolving a 2017 issue.VS Code update treats Copilot as “out-of-the-box” feature: VS Code 1.97 now has a free Copilot plan, and introduces predictive edit suggestions, auto-accept for AI edits, and experimental agent mode for end-to-end tasks.JDK 24 and JDK 25: What We Know So Far: JDK 24, set for release on March 18, includes 24 new features spanning core libraries, security, and HotSpot; JDK 25, expected September 2025, may finalize structured concurrency and HTTP/3 support.AWS CodeBuild Now Supports Fastlane to Simplify iOS Deployments: The CI service now includes Fastlane by default, simplifying iOS, iPadOS, watchOS, tvOS, and macOS app deployments. MacOS CodeBuild images also support Xcode and various programming languages.🎓Tutorials and Learning Resources💡Python💼How I Built a Deep Learning Library from Scratch Using Only Python, NumPy & Math:Explains the motivation, abstraction layers, and technical design, and delves into comparisons with PyTorch, covering key components like tensors, autograd, neural network modules, and optimizers.For more Python resources, go to PythonProC# and .NET🗞️VisualStudio.Extensibility: Managing .NET runtime versions: Explains how the SDK manages .NET runtime version updates, ensuring extensions remain compatible as Visual Studio transitions to newer .NET versions.💡Integrating AI into Your Existing Applications Using Semantic Kernel and C#: Explores how Microsoft's Semantic Kernel enables AI integration in C# applications, covering its capabilities, use cases, challenges, and strategies.🎓Integrating Azure Service Bus Emulator in .NET Aspire: Covers setting up the emulator, configuring SQL Server, integrating with .NET Aspire, and managing service connections for local development.C and C++🎓Fun with C++26 reflection - Keyword Arguments: Provides a guide on implementing order-independent keyword arguments in C++26 using reflection features, along with alternative approaches, code examples, and explanations.🎓Creating a Code Obfuscation Program For C: Outlines techniques such as renaming variables and functions, adding junk macros, altering code structure, and formatting manipulations while maintaining functionality.🎓Write your own C++ unit testing library: Explains how to write a testing library without using existing frameworks like Google Test or Catch2 andcovers designing a simple test interface, handling failures with exceptions, and more.Java💡Evolution of Java Ecosystem for Integrating AI: Explores how the Java ecosystem is evolving to support AI integration, highlighting frameworks like LangChain4j, Spring AI, and Jlama, alongside Oracle Generative AI for enterprise solutions.🎓Making Java enums forwards compatible: Explains how to make Java enums forward-compatible in SDKs by using a wrapper class that stores both the raw API value and a safe enum representation, preventing crashes.🎓Streamline UUID v7 Generation in Spring Boot Entities with Custom Annotations(Hibernate 6.5+ & Spring Boot 3.3+): Explains how to improve database performance with time-ordered unique identifiers by creating a custom annotation and UUID generator.JavaScript and TypeScript🎓Clean room tests with JavaScript's `using` keyword: Explains how JavaScript's new using keyword can simplify test isolation by automatically managing resources like test databases and mock servers.🎓JavaScript Decorators & Annotations: A Practical Guide to Metaprogramming: Covers use cases, implementation in TypeScript, integration with the Reflect API for metadata handling, and real-world applications.🎓TypeScript: thesatisfies operator: Explains how the operator enforces type constraints without altering inferred types, its syntax, and practical use cases for validating object properties.Go💼We Replaced Our React Frontend with Go and WebAssembly: Explains why Dagger switched to a Go-based WASM UI, detailing the benefits of code unification, performance improvements, memory optimizations, and more.🎓Fast Listing of Files from Large S3 and GCS Buckets Using Go Concurrency: Covers, optimizing file traversal through parallelization, strategic range-based queries, and the rill concurrency toolkit to improve performance.Rust🎓Writing a Simple Driver inRust: Walks you through the process of writing a simple Windows kernel-mode driver in Rust, covering setup, dependencies, device creation, handling requests, and testing the driver with a C++ client.💡How Does Ada's Memory Safety Compare Against Rust?: Concludes that while Rust enforces strict compile-time guarantees to prevent common memory errors, Ada relies on safer design patterns, runtime checks, and formal verification, making it less prone to such issues.Swift🎓How to develop an app for iOS: Covers essential tools like macOS, Xcode, and optional enhancements, along with learning resources, joining Apple's Developer Program, and strategies for releasing and promoting an app.💡Protocol Extensions in Swift 6.0: New Tricks: Explores enhanced generic constraints that enable more flexible, reusable, and maintainable code in protocol-oriented programming.PHP🎓Exploring Concurrent Access Handling: Examines strategies for handling concurrent access in PHP and MySQL, covering issues like race conditions, observability, parallelization, locking mechanisms, and transactions.🎓Lazy objects in PHP 8.4: Demonstrates how to use lazy objects in PHP 8.4, explaining their benefits, implementation, and practical applications such as deserialization and I/O-bound entity fetching.SQL🎓Measuring Cross-Product Adoption Using dbt_set_similarity: Explains how to measure cross-product adoption using the Jaccard Index within dbt workflows, leveraging the dbt_set_similarity package to quantify user overlap.Ruby🎓Essential Rails 7 & 8 Commands Guide: Covers project setup, database management, component generation, testing, debugging, and asset management, production deployment, and modern frontend tools.🎓Rails Soft Delete & Audit Logging Guide: Explains how to implement soft deletion and audit logging in Rails financial applications using acts_as_paranoid for data retention and a structured audit log system.Kotlin💡Designing Effective UI Components in Jetpack Compose: Covers best practices for modifier usage, theming for consistency, customizability via slots and style classes, and preview compatibility to enhance developer experience.💡Kotlin Constants in Android: Top-level vs. Companion-enclosed: Examines the constants' differences by analyzing their impact on APK size, performance, and memory usage by decompiling bytecode and testing R8 optimizations.🌟Best Practices and Advice🚀🧟‍♂️Cell-based Architecture Explained, with Zombies: Explains cell-based architecture using a zombie-resistant city analogy, where isolated neighborhoods (cells) prevent failures from spreading.Automated Accessibility Testing at Slack: Discusses how Slack integrated automated accessibility testing using Axe within their Playwright framework to enhance compliance with WCAG standards.How to Prevent Bugs From Reaching Production: Outlines six practices used at Outbrain, including CI/CD pipelines, simulator environments, duplicate traffic testing, gradual deployments, A/B testing, and structured postmortems.Surviving Google’s JavaScript rendering shift: one month later: Reflects on the impact of Google’s new requirement on web scraping, the challenges it created for SEO tools and data collection, and how the industry is adapting with headless browsers, proxy solutions, and advanced scraping techniques.My DOs and DON’Ts of Software Architecture: Recommends developing clarity, questioning assumptions, and avoiding over-architecture, while warning against ineffective collaboration, poor decision-making, and hybrid Agile-Waterfall approaches.🧠Expert Insight📚Here’s an excerpt from “Chapter 8: Using Super Builds to Simplify Onboarding" in the book, Minimal CMake, by Tom Hulton-Harrop, published in January 2025.Using ExternalProject_Add with your own librariesIn the previous chapter, we stuck largely to manual CMake build and install commands (along with a bit of help from CMake presets) to increase our familiarity with CMake, and to work at a slightly lower level of abstraction to understand what CMake is doing behindthe scenes. Now that we’re a bit morecomfortable with these concepts, it’s time to remove the tedium of navigating to each individual library folder and running the familiar CMake commandsthat follow:cmake --preset <preset-name>cmake --build <build-folder> --target installWe can start updating our project to take advantage of the more useful features that CMake provides. To start with, we’re going to update our existing third-partyCMakeLists.txtfile to bring in not only SDL 2 and bgfx but also the libraries we created and depend on. This will remove the need for us to manually install them and allow us to run a single pair of CMake commands (configure and build/install) to retrieve all the dependencies we need for ourGame ofLifeapplication.Let’s start by looking atch8/part-1/third-party/CMakeLists.txt. The file is largely the same as before, only underneath our existingExternalProject_Addcommands, we’ve added references to our libraries foundinch8/part-1/lib.Here is an example of themc-arraylibrary:ExternalProject_Add( mc-array SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../lib/array BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/mc-array-build/${build_type_dir} INSTALL_DIR ${CMAKE_CURRENT_SOURCE_DIR}/install CMAKE_ARGS ${build_type_arg} -DCMAKE_INSTALL_PREFIX=<INSTALL_DIR> CMAKE_CACHE_ARGS -DCMAKE_DEBUG_POSTFIX:STRING=d)The command should look remarkably similar to those we covered inChapter 6,Installing Dependencies and ExternalProject_Add. The only real difference is the reference toSOURCE_DIR. Given the slightly unconventional layout of this book’s repository, we can reference the source folder directly, as the library source code is stored in thesame repository:SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../lib/arrayIt would normally be the case that we’d refer to an external library using aURLorGIT_REPOSITORYlink. If we did, for some reason, want to refer to an older version of one of the libraries at a specific moment in the Git history of our project, we could usethis approach:ExternalProject_Add( mc-array GIT_REPOSITORY https://github.com/PacktPublishing/Minimal-CMake.git GIT_TAG 18535c9d140e828895c57dbb39b97a3307f846ab SOURCE_SUBDIR ch8/part-1/lib/array ...We did the same thing inChapter 3,Using FetchContent with External Dependencies, when usingFetchContent. The preceding command will clone the entire repository into the build folder of our third-partyCMakeList.txtfile, and then treat thech8/part-1/lib/arraydirectory as the root of the repository (at least as far asExternalProject_Addis concerned). It’s not often needed but can be useful if a repository holds more than oneCMake project.While we’re making changes tothird-party/CMakeLists.txt, we’ll also make one small improvement to how we handle our bgfx dependency. When bgfx was first introduced inChapter 6,Installing Dependencies and ExternalProject_Add(seech6/part-4), we wound up needing to clone the repository twice, once for the static version of the library (needed to build the tools), and again for the shared version of the library that our application linked against. The good news is there’s a handy technique we can apply to download the library once. The following is an extract of the changes with thedifferences highlighted:ExternalProject_Add( bgfxt GIT_REPOSITORY https://github.com/bkaradzic/bgfx.cmake.git GIT_TAG v1.127.8710-464 ...ExternalProject_Get_Property(bgfxt SOURCE_DIR)ExternalProject_Add( bgfx URL "file://${SOURCE_DIR}" DEPENDS bgfxt ...The firstExternalProject_Addcall is the same as before; we let it know the repository and specificGIT_TAGto download. However, in the second version, instead of repeating those lines, we first callExternalProject_Get_Property, passing thebgfxttarget and theSOURCE_DIRproperty.SOURCE_DIRwill be populated with the location of thebgfxtsource code once it’s downloaded, and in the second command, we point thebgfxtarget to reference that source code location. As the code is identical and it’s just how we’re building it that’s different, this saves a bit of time and network bandwidth downloading the same files allover again.You might have noticed that we’re usingURL "file://${SOURCE_DIR}"as opposed toSOURCE_DIR ${SOURCE_DIR}. This is because if we tried to useSOURCE_DIR, theExternalProject_Addcommand would fail at configure time becauseSOURCE_DIRis expected to already be present when we configure. As this isn’t the case with our dependency (the source forbgfxtwill only be downloaded and made available at build time), we can use theURLoption with a local file path shown byfile://, which will cause the file path to instead be resolved atbuild time.With the addition of the three newExternalProject_Addcalls referencing our libraries, when building our project, we only need to visit two directories, as opposed to the earlier five. We can navigate toch8/part-1/third-partyand run the followingCMake commands:cmake -B build -G "Ninja Multi-Config"cmake --build build --config ReleaseThis will download, build, and install all our dependencies at once. We then only need to navigate toch8/part-1/appand runthe following:cmake --preset multi-ninjacmake --build build/multi-ninja --config ReleaseThis will build and link our application. We’ve also tidied up ourCMakePresets.jsonfile to haveCMAKE_PREFIX_PATHonly refer to${sourceDir}/../third-party/install, as opposed to the numerous install folders we had for each of our internal dependencies in thelast chapter.Finally, to launch the application, we first need to compile our shaders and then launch the application from our application rootdirectory (ch8/part-1/app):./compile-shader-<platform>.sh/bat./build/multi-ninja/Release/minimal-cmake_game-of-life_windowThis is a substantial improvement from before, but we can do better. The main build is still split across two stages (dependencies and application), and we still have the annoying issue of needing to remember to compile the shaders (an easy step to overlook). We want to achieve the holy grail of one command to bootstrap everything. Let’s start by seeing how we can solve the first problem by reducing our build steps from two to one...Minimal CMakewas published in January 2025. Packt library subscribers can continue reading the entire book for free or you can buy the book here!Get the eBook for $33.99$22.99🛠️Useful Tools⚒️OLake: An open-source tool designed for fast, scalable database replication to Apache Iceberg or data lakehouses, starting with MongoDB.Hanko: An open-source, passwordless authentication and user management solution with passkeys, SSO, and API-first design.data-formulator: An open-source AI-powered tool from microsoft for transforming data into rich visualizations using UI and natural language inputs.That’s all for today.We have an entire range of newsletters with focused content for tech pros. Subscribe to the ones you find the most usefulhere.If your company is interested in reaching an audience of developers, software engineers, and tech decision makers, you may want toadvertise with us.If you have any suggestions or feedback, or would like us to find you a learning resource on a particular subject, just respond to this email!*{box-sizing:border-box}body{margin:0;padding:0}a[x-apple-data-detectors]{color:inherit!important;text-decoration:inherit!important}#MessageViewBody a{color:inherit;text-decoration:none}p{line-height:inherit}.desktop_hide,.desktop_hide table{mso-hide:all;display:none;max-height:0;overflow:hidden}.image_block img+div{display:none}sub,sup{font-size:75%;line-height:0}#converted-body .list_block ol,#converted-body .list_block ul,.body [class~=x_list_block] ol,.body [class~=x_list_block] ul,u+.body .list_block ol,u+.body .list_block ul{padding-left:20px} @media (max-width: 100%;display:block}.mobile_hide{min-height:0;max-height:0;max-width: 100%;overflow:hidden;font-size:0}.desktop_hide,.desktop_hide table{display:table!important;max-height:none!important}}
Read more
  • 0
  • 0
  • 885

Divya Anne Selvaraj
06 Feb 2025
Save for later

ProgrammingPro #88: Go Shared Memory Fixes, 100 Common Python Errors, 10 AI-Powered Dev Tools, and a Malicious Go Package

Divya Anne Selvaraj
06 Feb 2025
Bite-sized actionable content, practical tutorials, and resources for programmers#88Go Shared Memory Fixes, 100 Common Python Errors, 10 AI-Powered Dev Tools, and a Malicious Go PackageHi ,Welcome to a brand new issue of ProgrammingPro.In today’sExpert Insight, we bring you an excerpt from the recently published book, Go Recipes for Developers, which demonstrates how to manage shared memory in Go by avoiding memory races and using mutexes to synchronize access to shared variables, instead of relying solely on channels.News Highlights: 10 AI tools gain new features, including Amazon Q’s code validation; a malicious Go package evades detection for years; Stack Exchange tests AI answers despite a past ban; and Java updates JDK, frameworks, and tooling.My top 5 picks from today’s learning resources:100 Common Python Mistakes⚠️Build Intelligent Apps with .NET and DeepSeek R1🤖How Databases Work Under the Hood: Building a Key-Value Store in Go🗄️Do Code LLMs Understand Design Patterns?🧠Building a Serverless Fan-Out-Fan-In Mechanism🪭But there’s more, so dive right in.Stay Awesome!Divya Anne SelvarajEditor-in-ChiefSign Up|Advertise🗞️News and Analysis🔎10 development tools that have recently added new AI capabilities: Covers Amazon Q’s real-time code validation, DeepSeek R1’s availability on Azure AI, JetBrains' Junie coding agent, Sourcegraph’s AI code reviewers, and more.Java News Roundup: Java Operator SDK 5.0, Open Liberty, Quarkus MCP, Vert.x, JBang, TornadoVM: Also covers updates to JDK 24 and 25, Spring Cloud, Infinispan, and JHipster Lite.Malicious package found in the Go ecosystem: The typosquat package mimicking BoltDB contains a backdoor for remote code execution and exploited the Go Module Mirror’s indefinite caching, evading detection for over three years!Rust update fixes ‘forever’ compilation: Rust 1.84.1 fixes regressions from Rust 1.84, including a severe slowdown caused by the next-gen trait solver, errors in overlapping impls, duplicate-crate diagnostics, and missing debug info.TypeScript checks returns for conditional and indexed access types: TypeScript 5.8, now in beta, introduces limited type checking for conditional and indexed access types in return statements, reducing reliance on type assertions.Apple open sources Swift Build: The engine used by Xcode, to unify build systems across Xcode and Swift Package Manager (Swift PM), is now available on GitHub under the Apache 2.0 license and supports multiple platforms.Stack Exchange dabbles with AI answers – despite Stack Overflow banning them in 2022: The experiment, limited to select sites, requires human verification before AI answers become public and aims to boost engagement.🎓Tutorials and Learning Resources💡Python💡100 Common Python Mistakes:Covers logic bugs, inefficient code, non-Pythonic practices, and best practices for readability and performance, using clear examples for each mistake.For more Python resources, go to PythonProC# and .NET💡Top 10 .NET Performance Anti-Patterns You Should Fix Today: Covers excessive object allocation, blocking async calls, inefficient database queries, and overusing reflection, and provides fixes such as using object pooling.🎓Tutorial | Build Intelligent Apps with .NET and DeepSeek R1: Using the Microsoft.Extensions.AI (MEAI) library, it provides a step-by-step guide for connecting to GitHub Models, Azure AI Foundry, or running locally with Ollama.🎓Tutorial | Writing a .NET Garbage Collector in C# - Part 2: Covers defining key interfaces (IGCHeap, IGCHandleManager, IGCHandleStore), handling GC handles, implementing memory allocation, and more.C and C++💡21st Century C++: In this article, Bjarne Stroustrup recommends modern C++ practices for performance, type safety, and maintainability, covering resource management, modularity, generic programming, and more.💡Starflate: Deflate decompression in C++23: Discusses lessons learned from the development of Starflate, a Deflate decompression implementation in C++23, covering the Deflate algorithm, project design, and more.💡I Wrote a Wasm Interpreter in C: Covers the author's experience writing Semblance, a WebAssembly interpreter in C, detailing the WebAssembly specification, interpreter design, and implementation of function calls and host imports.Java🎓Tutorial | How to Compile Java into Native Binaries with Mill and Graal: Explains the setup, build process, benefits like faster startup and lower memory usage, and limitations such as longer build times and restricted reflection support.💡The Java Streams Parallel: Provides an in-depth analysis of Java Streams' parallel execution, including its implementation, concurrency behavior, stream operation characteristics, and internal design in JDK 24.💡Java's synchronized explained: Explains how Java’s synchronized keyword works at the bytecode level, detailing monitorenter and monitorexit instructions, object monitors, and how synchronized methods differ from synchronized blocks.JavaScript and TypeScript💡Is npm Enough? Why Startups are Coming after this JavaScript Package Registry: Examines emerging competition in the JavaScript package management space, focusing on how Deno’s JSR and vlt’s vsr challenge npm’s dominance.🤯Someone got Linux running inside a PDF file, because its users are something else: The project exploits the PDF format’s JavaScript support to enable computation, with user input via a virtual keyboard and text box translating to on-screen actions.🎓Tutorial | Slots: Make your Angular API flexible: Explores how content projection in Angular can make UI components more flexible and reusable, comparing ng-content and ng-template.Go🎓Tutorial |How Databases Work Under the Hood: Building a Key-Value Store in Go: Explains how databases store and retrieve data efficiently by managing query layers and storage engines.🎓Tutorial | Dealing with Golang Data Types: Explains Golang’s data types' memory considerations, practical applications, and syntax, with examples, and concludes with coding exercises.Rust💡No-Panic Rust: A Nice Technique for Systems Programming: Discusses how, by carefully designing APIs and leveraging Rust’s optimizer, developers can write efficient, panic-free Rust code.🎓Tutorial | Making System Calls in Rust: Requesting Services from the Kernel: Explains how to use the libc crate to access low-level kernel services, with examples on file I/O, handling processes via fork() , and more.Swift💡Rethinking Our Color System: A Type-Safe Approach in Swift: Discusses rethinking a color system in Swift using type safety, generics, and property wrappers instead of subclassing UIColor .🎓Tutorial |Parameterized tests in Swift: Reducing boilerplate code: Explains how to improve test clarity, and make debugging easier by running a single test with multiple input values.PHP💡The State of PHP 2024: Reveals that PHP remains a dominant force in web development, with Laravel as the leading framework, PhpStorm as the preferred IDE, increasing AI adoption, and ongoing efforts to enhance PHP’s features.SQL🎓Tutorial | Query Tuning in DBSQL with the new V2 Query Profile: Introduces a streamlined tool for query tuning in DBSQL, helping users quickly identify bottlenecks through execution summaries, detailed scan insights, and the new "Top Operators" feature.Ruby🎓Tutorial | Setting Up a Rails 8 with Vite and Tailwind CSS 4: Covers installation, configuration, and integration of Turbo, Stimulus, and Tailwind with Vite for modern frontend development in Rails.🎓Tutorial | Ruby on Rails on WebAssembly, the full-stack in-browser journey: Details the process of "wasmifying" a Rails app, adapting database storage, leveraging service workers, and the future potential of Rails.Kotlin🎓Tutorial | Kotlin Constants in Android: Top-level vs. Companion-enclosed: Analyzes their effect on APK size, memory usage, and performance through bytecode inspection and R8 optimizations.💡10+ Common Kotlin Coroutine Mistakes Senior Android Developers Should Avoid: Covers blocking the main thread, improper exception handling, misusing coroutine scopes, overusing withContext, and more.🌟Advanced Concepts🚀Do Code LLMs Understand Design Patterns?: Examines whether Code LLMs understand design patterns by evaluating their ability to recognize, comprehend, and generate pattern-compliant code.Comprehensive Guide to AI Workflow Design Patterns with PydanticAI code examples: Covers prompt chaining, routing, parallelization, orchestrator-workers, evaluator-optimizer workflows, and autonomous agents.Building a Serverless Fan-Out-Fan-In Mechanism: Explains how to implement a serverless fan-out-fan-in mechanism using AWS Step Functions, SNS, SQS, and DynamoDB to build scalable and fault-tolerant distributed systems.How has DeepSeek improved the Transformer architecture?: Explains how DeepSeek v3 enhances the Transformer architecture through multi-head latent attention (MLA), mixture-of-experts (MoE) improvements, and multi-token prediction.🧠Expert Insight📚Here’s an excerpt from “Chapter 7: Concurrency" in the book, Go Recipes for Developers, by Burak Serdar, published in December 2024.Sharing memoryOne of the most famous Go idioms is: “Do not communicate by sharing memory, share memory by communicating.” Channels are for sharing memory by communicating. Communicating by sharing memory is done using shared variables in multiple goroutines. Even though it isdiscouraged, there are many use cases where shared memory makes more sense than a channel. If at least one of the goroutines updates a shared variable that is read by other goroutines, you have to ensure that there are no memory races.A memory race happens when a goroutine updates a variable concurrently while another goroutine reads from it or writes to it. When this happens, there is no guarantee that the update to that variable will be seen by other goroutines. A famous example of this situation is thebusy-waitloop:func main() { done:=false go func() { // Wait while done==false for !done {} fmt.Println("Done is true now") }() done=true // Wait indefinitely select{}}This program has a memory race. Thedone=trueassignment is concurrent with thefor !doneloop. That means, even though the main goroutine runsdone=true, the goroutine readingdonemay never see that update, staying in theforloop indefinitely.Updating shared variables concurrentlyThe Go memory model guarantees that the effect of a variable write is visible to instructions that come after that write within that goroutine only. That is, if you update a shared variable, you have to use special tools to make that update visible to other goroutines. A simple way to ensure this is to use a mutex. Mutex stands for “mutual exclusion.” A mutex is a tool you can use to ensurethe following:Only one goroutine updates a variable at anygiven timeOnce that update is done and the mutex is released, all goroutines can seethat updateIn this recipe, we show how thisis done.How to do it...The section of a program that updates shared variables is a “critical section.” You use a mutex to ensure that only a single goroutine can enter itscritical section.Declare a mutex to protect acritical section:// cacheMutex will be used to protect access to cachevar cacheMutex sync.Mutexvar cache map[string]any = map[string]any{}A mutex protects a set of shared variables. For instance, if you have goroutines that update a single integer, you declare a mutex for the critical sections that update that integer. You must use the same mutex every time you read or write thatinteger value.When updating the shared variable(s), first lock the mutex. Then perform the update and unlockthe mutex:cacheMutex.Lock()cache[key]=valuecacheMutex.Unlock()With this pattern, if multiple goroutines attempt to updatecache, they will queue atcacheMutex.Lock()and only one will be allowed. When that goroutine performs the update, it will callcacheMutex.Unlock(), which will enable one of the waiting goroutines to acquire the lock and update thecache again.When reading the shared variable, first lock the mutex. Then perform the read, and then unlockthe mutex:cacheMutex.Lock()cachedValue, cached := cache[key]cacheMutex.Unlock()if cached { // Value found in cache}Go Recipes for Developerswas published in December 2024. Packt library subscribers can continue reading the entire book for free or you can buy the book here!Get the eBook for $31.99$21.99🛠️Useful Tools⚒️lume: Alightweight CLI and local API server for managing macOS and Linux virtual machines with near-native performance on Apple Silicon, using Apple's Virtualization.Framework.klarity: Analyzes uncertainty in generative model outputs using probability entropy and semantic understanding to reveal model behavior and hallucination risks.iterm-mcp: A Model Context Protocol (MCP) server that enables models to inspect, interact with, and control an active iTerm session efficiently.That’s all for today.We have an entire range of newsletters with focused content for tech pros. Subscribe to the ones you find the most usefulhere.If your company is interested in reaching an audience of developers, software engineers, and tech decision makers, you may want toadvertise with us.If you have any suggestions or feedback, or would like us to find you a learning resource on a particular subject, just respond to this email!*{box-sizing:border-box}body{margin:0;padding:0}a[x-apple-data-detectors]{color:inherit!important;text-decoration:inherit!important}#MessageViewBody a{color:inherit;text-decoration:none}p{line-height:inherit}.desktop_hide,.desktop_hide table{mso-hide:all;display:none;max-height:0;overflow:hidden}.image_block img+div{display:none}sub,sup{font-size:75%;line-height:0}#converted-body .list_block ol,#converted-body .list_block ul,.body [class~=x_list_block] ol,.body [class~=x_list_block] ul,u+.body .list_block ol,u+.body .list_block ul{padding-left:20px} @media (max-width: 100%;display:block}.mobile_hide{min-height:0;max-height:0;max-width: 100%;overflow:hidden;font-size:0}.desktop_hide,.desktop_hide table{display:table!important;max-height:none!important}}
Read more
  • 0
  • 0
  • 786

Divya Anne Selvaraj
30 Jan 2025
Save for later

ProgrammingPro #87: C++ Bit Counting Tricks, JetBrains’ ‘Junie’ AI, Tailwind CSS 4.0’s Rust Boost, and Rust’s Async Closures

Divya Anne Selvaraj
30 Jan 2025
Bite-sized actionable content, practical tutorials, and resources for programmers#87C++ Bit Counting Tricks, JetBrains’ ‘Junie’ AI, Tailwind CSS 4.0’s Rust Boost, and Rust’s Async ClosuresHi ,Welcome to our very first issue for the year 2025.In today’sExpert Insight, we bring you an excerpt from the recently published book, Debunking C++ Myths, which discusses different approaches to counting set bits in a 32-bit integer, comparing manual bitwise operations, the C++20 std::popcount function, and the CPU-level POPCNT instruction.News Highlights:JetBrains launches ‘Junie’ for AI coding in Python, Kotlin, and Java; Tailwind CSS 4.0’s Rust-powered build engine boosts incremental builds up to 100x; Rust 1.85 stabilizes async closures and enhances Linux kernel support; and 11 new languages like Mojo, Wing, and Jakt target AI, memory safety, and edge computing.My top 5 picks from today’s learning resources:JavaScript Temporal is coming⏳3 Python web frameworks for beautiful front ends🎨Rust: Investigating a Strange Out-of-Memory Error🕵️‍♂️The Architecture of Open Source Applications🏛️Inside Atlassian Lithium: How a Dynamic ETL Platform is Transforming Data Movement and Cutting Costs⚡But there’s more, so dive right in.Stay Awesome!Divya Anne SelvarajEditor-in-ChiefSign Up|Advertise🗞️News and Analysis🔎11 cutting-edge programming languages to learn now: Covers languages focused on theorem proving (Coq), AI-assisted coding (Plang), Python performance enhancements (Mojo, Erg), edge computing (MoonBit, Wing), and memory safety (Rust, Zig, Jakt, Odin, Mojo).JetBrains debuts agentic AI coding with ‘Junie’, but reviews for existing AI Assistant are poor: Junie supports Python, Kotlin, and Java and can develop features, fix bugs, update documentation, add tests, and resolve failed tests.Tailwind CSS 4.0 released with ‘ground-up rewrite’ for faster Rust-powered build: The versionintroduces a Rust-powered build engine (Oxide), achieving up to 5x faster builds (100x for incremental builds), alongside new CSS features.Async closure support is stable for Rust 1.85: The new version, releasing on February 20, will resolve issues like the “Send”-bound problem and make progress on Linux kernel integration, return type notation, and more.Java News Roundup: Stable Values, Payara Platform, Oracle Critical Patch Update, GraalVM, BellSoft: Also covers BellSoft's Liberica JDK, updates on Jakarta EE 11, Spring, Hibernate, Infinispan, Eclipse Vert.x, and Gradle.State of JavaScript: Highlights of the JavaScript developer survey: The results reveal growing adoption of AI code generators, new language features (nullish coalescing, Promise.allSettled), and build tools (Vite, esbuild).Java-based organizations mostly use Java for AI development – report: The Azul 2025 State of Java Report finds that 50% of Java-based organizations use Java for AI development, ahead of JavaScript (44%) and Python (41%).🎓Tutorials and Learning Resources💡Python💡3 Python web frameworks for beautiful front ends: Introduces Anvil, Reflex, and NiceGUI—which allow developers to build interactive front-end applications using only Python, eliminating the need for JavaScript.For more Python resources, go to PythonProC# and .NET🎓Tutorial | Writing a .NET Garbage Collector in C# - Part 1: Demos writing a custom .NET garbage collector in C# using NativeAOT, detailing initialization challenges, debugging methods, and workaround strategies to resolve conflicts.💡Making SIMD Operations in C# Easier: Introduces F8, an open-source C# SIMD library that optimizes floating-point operations by leveraging AVX 256-bit intrinsics, demonstrating its performance benefits over scalar computations.🎓Tutorial | SQL Server Native Vector Search for .NET Developers: Coversembedding generation, vector storage, similarity search, and document classification using C# and T-SQL for AI-powered search and retrieval.C and C++💡Understanding Memory Management, Part 1: C: Covers fundamental concepts like the stack, heap, malloc, free, and fragmentation, while demonstrating manual memory allocation through a simple file-reading program.🗞️C++26: pack indexing: The update allows direct access to specific elements in parameter packs using the subscript operator (T...[index] ), simplifies previously cumbersome methods, and improves readability.💡The surprising struggle to get a UNIX Epoch time from a UTC string in C or C++: Delves into issues with strptime(), locales, daylight saving time, and the best available solutions, including timegm() and C++20’s time zone library.Java🎓Tutorial | How JVM Executable Assembly Jars Work: Explains how the Mill build tool generates directly executable assembly JARs by prepending a launcher script to a ZIP-based JAR, allowing execution without java -jar .💡Making Java nullable fields backwards compatible: Explains how making a Java field nullable can break source and binary compatibility and provides a solution using method overloading to ensure backwards compatibility in SDKs.🎓Tutorial | How To Do Logging In Java: Covers legacy and modern logging libraries, best practices for logging, log levels, centralized logging, and how to choose the right logging approach for different applications.JavaScript and TypeScript🗞️JavaScript Temporal is coming: JavaScript's new Temporal API is being introduced in experimental browser releases, offering a modern, built-in way to handle dates, times, durations, and calendars.💡How long is a second in JavaScript?: Explains how JavaScript measures time using POSIX time, why it ignores leap seconds, the impact of step adjustments vs. smearing, and how this affects applications that require precise time synchronization.💡TypeScript enums: use cases and alternatives: Examines TypeScript enums, their structure, use cases, limitations, and alternative patterns like object literals, string literal unions, and symbol-based approaches.Go🎓Tutorial |Modeling Complex Data Structure in Golang Using Pointers, References, and Reverse Indices: Demonstrates how memory management techniques optimize performance, reduce redundancy, and simplify complex graph lookups.💡Go 1.24'sgo tool is one of the best additions to the ecosystem in years: Discusses Go 1.24’s new go tool command and tool directive in go.mod , which improves dependency management by reducing bloat.Rust🎓Tutorial | Parsing PDFs (and more) in Elixir using Rust: Demonstrates how to efficiently parse PDFs in Elixir using Rust via Native Implemented Functions (NIFs), leveraging the Extractous library.💼Case Study | Rust: Investigating a Strange Out-of-Memory Error: Investigates an unexpected out-of-memory issue in a Rust service, revealing that the anyhow library captures a backtrace on every error.Swift💡The Swift Runtime: Your Silent Partner: Explores how the Swift Runtime (libswiftCore) interacts with compiled Swift programs, managing memory, dynamic dispatch, and core language features through the ABI and system calls.🎓Tutorial | Network Link Conditioner: Simulating Slow Networking: Explains how to use Apple's Network Link Conditioner to simulate slow network conditions on macOS and iOS and introduces RocketSim as a better alternative.PHP🎓Tutorial | Say Goodbye to Hard-Coding: Manage Laravel Model Columns Efficiently: Introduces a Laravel Artisan command that automatically generates model column constants, reducing hard-coded field names.SQLComposable SQL: Critiques SQL's testability, duplication, and denormalization issues, then introduces functors as a structured way to define reusable query components that improve performance, maintainability, and abstraction.Ruby🎓Tutorial | Supercharge SQLite with Ruby Functions: Covers how to enhance SQLite with user-defined Ruby functions (UDFs) to extend query capabilities, automate data processing, and perform custom computations.💡Instrumenting Thread Stalling in Ruby Applications: Introduces GC.total_time for tracking GC impact, gvltools for measuring GVL wait time, and Linux /proc metrics for monitoring CPU scheduling.Kotlin🎓Tutorial | The Liskov Substitution Principle (LSP) in Kotlin — Deep Dive: Provides an in-depth exploration of the Liskov Substitution Principle (LSP) in Kotlin, explaining how subclass behavior must remain consistent with its superclass.💡Modern Android Security Tools: ProGuard, DexGuard, and R8 with Kotlin & Jetpack Compose: Covers protection strategies, configuration rules, best practices, and performance considerations for modern Android development.🌟Best Practices and Advice🚀📖The Architecture of Open Source Applications: Acollection of books where developers of dozens of open source projects explain their software architecture, design choices, and key lessons learned.The End of the Bronze Age: Rethinking the Medallion Architecture: Advocates for the Shift Left approach, which moves data processing upstream to create reliable, reusable data products that support both operational and analytical workloads.Inside Atlassian Lithium: How a Dynamic ETL Platform is Transforming Data Movement and Cutting Costs: Duscusses how Atlassian's platform's ephemeral pipelines, Kafka-based architecture, and modular Workplans enable efficient, scalable data movement.Integration timelines: How to plan for success without surprises: explores SaaS integration challenges, emphasizing realistic timelines, scalability, security, and in-house vs. third-party solutions to prevent resource strain.🧠Expert Insight📚Here’s an excerpt from “Chapter 8: The Fastest C++ Code is Inline Assembly" in the book, Debunking C++ Myths by Alexandru Bolboacă and Ferenc-Lajos Deák, published in December 2024.One instruction to rule them allDear reader. In our previous section of this chapter, unfortunately, we exhausted the only pompous introduction we could borrow from various cultural sources concerning technical interviews, career and life choices, and whether should we take the red pill or the blue one, so let’s focus our attention on more technicalquestions that our candidates might face at a technical interview (the word technical appears four times in this shortintroductory paragraph).One of these questions, served to the author of these lines a few years ago, was to write a short code snippet that will count the number of 1 bits (the on bits) in a 32-bit integer. Let’s draft up a quick application todo this:int countOneBits(uint32_t n) { int count = 0; while (n) { count += n & 1; n >>= 1; } return count;}Here’s what happens. Firstly, we initialize a counter, starting with0. The next step is to loop through the bits. Whilenis non-zero, we add the least significant bit ofnto the counter (n&1gives us this value). Following this, we shiftnright by one bit (discarding the leastsignificant bit).Once all bits are processed (whennbecomes0), return the total count of 1 bits. Not a very complicated process, justraw work.It seems that this procedure of counting bits in numbers must be of a very peculiar interest in computing circles, such as for the purpose of error detection and correction, data compression, cryptography, algorithmic efficiency, digital signal processing, hardware design, and performance metrics, so no wonder it managed to creep itself into the STL (C++ STL, which is the standard template library) too in the form ofstd::popcountfromC++ 20.The interesting part of the story is that not only in the STL do we find this handy operation, but it was deemed so useful that it even exists at the level of the processors, under the infamousPOPCNT mnemonic. Infamous it is, due to the fact that in 2024, it was effectively used in hindering the installation of Windows 11 on older machines that were not officiallysupported (https://www.theregister.com/2024/04/23/windows_11_cpu_requirements/).But what that means for our candidate, who has to write code to impress the interviewers, is that they can simply replace the complicated code from before with the following veryhandy snippet:int countOneBits(uint32_t n) { return std::popcount(n);}Not forgetting to include the<bit>header, after feeding the preceding program intogcc.godbolt.org’s compilers, we get a strange mishmash of results. The code compiled by GCC, regardless of the optimization level, always generates a variation ofthe following:countOneBits(unsigned int): sub rsp, 8 mov edi, edi call __popcountdi2 add rsp, 8 retSo, the code at some level disappears from our eyes into a strange call deep inside the libraries offered by GCC, called__popcountdi2 (https://gcc.gnu.org/onlinedocs/gccint/Integer-library-routines.html). In order to convince GCC to fully utilize the power of the processor that we are running the code on, we need to utilize some of the not-so-well-known command-line options, such as-march(or-mpopcntfor thisspecific purpose).According to the official documentation, (https://gcc.gnu.org/onlinedocs/gcc/x86-Options.html) this command will select the appropriate processor instruction set in order to use the available extensions of the specific processor. Since, at this stage, we know that the POPCNTinstruction was introduced in the early Core i5 and i7 processors, in the Nehalem family, we should simply specify the following to GCC:-march=nehalem. And now, not surprisingly, the compiler generatesthe following:countOneBits(unsigned int): popcnt eax, edi retInterestingly, if we provide the compiler with just the-mpopcntflag, then it generates an extraxor eax, eax(meaning it nulls the EAX register) so maybe we have witnessed some processor-specific extra optimizations by choosing theNehalem architecture:countOneBits(unsigned int): xor eax, eax popcnt eax, edi retWe cannot squeeze more than this out of GCC; there is simply no lower level for this functionality, so we focus our attention on the next compiler onour list.Without explicitly asking to optimize the code, Clang also generates a generic call to astd::popcountfunction, found somewhere in its libraries; however, explicitly asking to optimize the generated code, Clang at various levels of optimization yieldsthe following:countOneBits(unsigned int): mov eax, edi shr eax and eax, 1431655765 sub edi, eax mov eax, edi and eax, 858993459 shr edi, 2 and edi, 858993459 add edi, eax mov eax, edi shr eax, 4 add eax, edi and eax, 252645135 imul eax, eax, 16843009 shr eax, 24 retSurprising as it seems, there is a perfectly logical explanation for this code, found at the bit-twiddling site (https://graphics.stanford.edu/~seander/bithacks.html#CountBitsSetParallel) of Sean Eron Anderson at Stanford. Not considering this extra detour, Clang behaves identically to GCC when it comes to handling architecture and specifying the subset of CPU extensions to use while generating code.The last of the big three, Microsoft’s own (we know, tiny, squishy) C++ compiler handles the situation very similarly to Clang. When asking to optimize the code while we specify an architecture that does not support thePOPCNTinstruction, it generates code like the one generated by Clang with low-level bit hacks, while if the architecture has support for thePOPCNTinstruction, it will adjust to the correct type and will callPOPCNTfor the proper parameters (/std:c++latest /arch:SSE4.2 /O1).Good work, tiny,squishy compiler.Debunking C++ Mythswas published in Decemver 2024. Packt library subscribers can continue reading the entire book for free or you can buy the book here!Get the eBook for $31.99$21.99🛠️Useful Tools⚒️DeepSeek-Coder-V2: An open-source MoE code model rivaling GPT-4 Turbo, supporting 338 languages with a 128K context length.Web-Dev-For-Beginners: A 12-week, 24-lesson curriculum by Microsoft covering HTML, CSS, and JavaScript through hands-on projects, quizzes, and assignments.MudBlazor: A Material Design component framework for Blazor, built entirely in C# for ease of use, clear structure, and seamless .NET integration.That’s all for today.We have an entire range of newsletters with focused content for tech pros. Subscribe to the ones you find the most usefulhere.If your company is interested in reaching an audience of developers, software engineers, and tech decision makers, you may want toadvertise with us.If you have any suggestions or feedback, or would like us to find you a learning resource on a particular subject, just respond to this email!*{box-sizing:border-box}body{margin:0;padding:0}a[x-apple-data-detectors]{color:inherit!important;text-decoration:inherit!important}#MessageViewBody a{color:inherit;text-decoration:none}p{line-height:inherit}.desktop_hide,.desktop_hide table{mso-hide:all;display:none;max-height:0;overflow:hidden}.image_block img+div{display:none}sub,sup{font-size:75%;line-height:0}#converted-body .list_block ol,#converted-body .list_block ul,.body [class~=x_list_block] ol,.body [class~=x_list_block] ul,u+.body .list_block ol,u+.body .list_block ul{padding-left:20px} @media (max-width: 100%;display:block}.mobile_hide{min-height:0;max-height:0;max-width: 100%;overflow:hidden;font-size:0}.desktop_hide,.desktop_hide table{display:table!important;max-height:none!important}}
Read more
  • 0
  • 0
  • 954

Divya Anne Selvaraj
12 Dec 2024
Save for later

ProgrammingPro #86: Python Debugging Best Practices, Go’s API Surge, Google's Jules Coding Agent, and Netflix's Scalable Counters

Divya Anne Selvaraj
12 Dec 2024
Bite-sized actionable content, practical tutorials, and resources for programmers🎄#86🥂Python Debugging Best Practices, Go’s API Surge, Google's Jules Coding Agent, and Netflix's Scalable CountersHi ,"It's the Most Wonderful Time of the Year🌟...It's the hap-happiest season of all" 🎵 - Andy WilliamsWelcome to our very last issue, for the year 2024! We will be taking our usual year end break and return again on the 16th of January 2025. In the meanwhile, do keep any eye out. Packt x Santa🎅 are busy working on some unmissable deals for you to unwrap over the holidays! Now let's get down to business.In today’sExpert Insight, we bring you an excerpt from the recently published book, Learn Python Programming - Fourth Edition, which demonstrates best practices for creating custom debugging functions in Python.News Highlights:Python is set to win Tiobe's "Language of the Year" for its growth in AI and data mining; Go overtakes Node.js in API requests with a 40% rise; Google introduces Gemini 2.0 and AI coding agent Jules; and SQLite is re-implemented in Rust for async I/O and memory safety.My top 5 picks from today’s learning resources:Linear Regression in Python📈How AMD Is Taking Standard C/C++ Code To Run Directly On GPUs🚀Data structures as jigs for Go programmers🧩Inside Netflix’s Distributed Counter: Scalable, Accurate, and Real-Time Counting at Global Scale🌍How to Become a Principal Engineer🏗️But there’s more, so dive right in.Before signing off, I would like to say thank you to all readers who have been on this journey with me this year. A very Merry Christmas and Wonderful New Year 2025 to you all!Don't forget to Stay Awesome!Divya Anne SelvarajEditor-in-ChiefSign Up|Advertise🗞️News and Analysis🔎Python a shoo-in for Tiobe language of the year: Python is expected to win Tiobe’s "Programming Language of the Year" for 2024 due to a significant 10% increase in popularity ratings, driven by its dominance in AI, data mining, and ease of learning.Go eclipses Node.js in web API requests, Cloudflare reports: Go has overtaken Node.js as the leading language for automated API requests, accounting for 11.8% of traffic, with Go's share rising 40% and Node.js declining 30%.Ruby on Rails 8.0 Released, Introduces Kamal 2 for Improved Deployments: Key updates also include SQLite-based adapters, a new asset pipeline, enhanced authentication tools, and deprecated feature removals.Java News Roundup: JDK 24 in Rampdown, JDK 25 Expert Group, Jakarta EE 11 Core Profile, Spring Cloud: Other highlights include updates to frameworks like GlassFish, Open Liberty, Quarkus, Apache Camel, and others.Google announces Gemini 2.0 Flash and new coding agent: Jules, an AI-powered coding agent, is designed to assist with Python and JavaScript tasks, including debugging, modifying multiple files, and creating pull requests.SQLite re-implemented in Rust to achieve asynchronous I/O and other changes: Turso is re-implementing SQLite in Rust as "Limbo" to enable asynchronous I/O, memory safety, and modern architecture while ensuring compatibility with SQLite.OpenSilver 3.1 adds new drag-and-drop XAML designer for VS Code: The designer comes with over 100 controls, cross-platform compatibility, a modern UI theme, expanded WPF feature support, and full .NET 9 compatibility.React 19 is stable, team directs devs towards frameworks – especially Next.js: React 19 is now stable, introducing server components to the main channel, improved pre-rendering APIs, and enhanced suspense features.🎓Tutorials and Learning Resources💡Python🎓Tutorial |Linear Regression in Python:Demonstrates implementing simple, multiple, and polynomial regression in Python using libraries like scikit-learn and statsmodels, covering key concepts such as underfitting and overfitting.For more Python resources, go to PythonProC# and .NET🎓Tutorial | Using vectorization in C# to boost performance: Explains how vectorization in C# was used to optimize the Sum method in .NET 8, leveraging SIMD principles and advanced techniques like loop unrolling.🎓Tutorial | Building a Multi-Tenant Configuration Management System with .NET Core, Redis, and Dependency Injection: Combines local disk caching for quick access, Redis for distributed caching, and a Pub/Sub model.🎓Tutorial | Central Package Management (CPM) in .NET — Simplify NuGet Dependencies: Explains how CPM achieves simplification by centralizing package version control in a single Directory.Packages.props file.C and C++💼Case Study | How AMD Is Taking Standard C/C++ Code To Run Directly On GPUs: AMD is working on porting LLVM's C/C++ run-times to GPUs, bypassing the need for GPU-specific languages like OpenMP or OpenACC.🎓Tutorial | Learning to read C++ compiler errors: Nonsensical errors from a function declaration: Explains how conflicting macros in C++ projects can lead to compiler errors, using the case of a macro named ErrorMessage .🎓Tutorial | Refactoring in C++: Top Techniques and Best Practices: Covers methods such as renaming variables, extracting functions, simplifying conditionals, and reducing duplication, along with best practices.Java💼Case Study | QCon SF 2024: Refactoring Large, Stubborn Codebases: Stripe engineers share strategies for refactoring large, stubborn codebases leveraging centralized teams, tools like Sorbet for Ruby, and more.🗞️Malicious Maven Package Impersonating 'XZ for Java' Library Introduces Backdoor Allowing Remote Code Execution: Socket researchers have uncovered a malicious Maven package, io.github.xz-java:xz-java, impersonating the legitimate XZ for Java library (org.tukaani:xz).🎓Tutorial | Peering through the peephole: build a peephole optimiser using the new Java Class-File API: Demonstrates building an optimizer that removes redundant instructions (e.g., unnecessary zero addition) and more.JavaScript and TypeScript💡What is TypeScript? Strongly typed JavaScript: Introduces TypeScript as a strongly typed superset of JavaScript, highlighting its enterprise-level features, compatibility, and advantages for large-scale application development.💡Everything AboutBarrel ExportsInJavaScript: Examines the benefits, challenges, and best practices of using barrel exports to simplify imports, improve code organization, and balance performance and maintainability.🗞️Malicious npm Package Typosquats Popular TypeScript ESLint Plugin, Exfiltrates Data and Enables Remote Exploitation: A secondary malicious package, @typescript_eslinter/prettier, remains live, escalating the risk.Go🎓Tutorial | Data structures as jigs for programmers: Discusses implementations including basic and dynamic arrays, multidimensional arrays, bitsets, binary heaps, and hash tables, with practical use cases and code examples.🗞️Coming in Go 1.24: testing/synctest experiment for time and concurrency testing: Introduces the experimental testing/synctest package in Go 1.24, designed to improve testing involving time and concurrency.Rust💼Case Study |I spent 2 years rebuilding my algorithmic trading platform in Rust. I have no regrets: Discusses the author's experience transitioning their algorithmic trading platform from Typescript to Rust.💡Thoughts on Rust hashing: Critiques Rust's hashing model, which separates Hash and Hasher traits for flexibility, highlighting inefficiencies in handling block-wise hashing, variable-length inputs, and more.Swift🎓Tutorial | Migrating XCTest to Swift Testing: Provides a migration guide using modern features of Swift Testing, such as concurrency and macros, its improved test setup, teardown processes, and flexible assertion macros.🎓Tutorial | SF Symbol: How to for Swift & SwiftUI: Explains how to use, customize, and animate Apple's SF Symbols in Swift and SwiftUI, leveraging the SF Symbols app for integration and design consistency in apps.PHP🎓Tutorial | Parsing HTML with PHP 8.4: Discusses the new HTML5 parser, CSS selector support, and updated DOM classes in PHP 8.4, which improve HTML parsing, DOM manipulation, and web development efficiency.🎓Tutorial | Implementing Dependency Inversion Principle (DIP) using Laravel: Demonstrates implementing DIP by decoupling UserService from specific repository dependencies through a RepositoryManagerInterface .SQL💡Some useful SQL(ite) tips I've learned: Includes tips such as splitting data into buckets, advanced ordering without additional columns, JSON querying with shorthand operators, string concatenation, and default values for NULLs.🎓Tutorial | A Beginner’s Guide to Procedural Programming Beyond SQL with Toad for Oracle: Covers the fundamentals of PL/SQL, its advantages for database programming, and practical tips for efficient PL/SQL development.Ruby🎓Tutorial | Mastering Ruby Debugging: From puts to Professional Tools: Provides a comprehensive guide to debugging in Ruby, covering basic techniques like puts statements, interactive consoles, and advanced tools.💡Advent of Criminally Bad Ruby Code: Humorously chronicles the author's exploration of unconventional and experimental Ruby coding practices, showcasing creative abuses of Ruby features.Kotlin💡When to Use Retrofit and When to Use Ktor: A Guide for Android Developers: Compares two popular HTTP clients for Android, detailing their strengths and scenarios for use.🎓Tutorial | 5 steps to implement MVI architecture with Jetpack Compose: Covers setting up dependencies, defining the Model, ViewState, and Intent layers, managing the state and events in a ViewModel, and creating a reactive UI layer following MVI principles.🌟Best Practices and Advice🚀Inside Netflix’s Distributed Counter: Scalable, Accurate, and Real-Time Counting at Global Scale: Explains the system which balances performance, accuracy, and cost through configurable modes and event-driven architecture.Beat the Plan: Probabilistic Strategies for Successful Software Delivery at Scale: Advocates for adaptive systems over rigid plans, leveraging continuous processes, prioritization, constraints, and a culture of learning.How to Become a Principal Engineer: Discusses the required technical and leadership skills, strategies for career growth, and how companies can define and support the role for maximum impact.On over-engineering; Architecture Edition: Discusses balancing over-engineering and under-engineering in architectural decisions, using the author’s project, Collecto, as an example.🧠Expert Insight📚Here’s an excerpt from “Chapter 11: Debugging and Profiling" in the book, Learn Python Programming - Fourth Edition by Fabrizio Romano and Heinrich Kruger, published in November 2024.Debugging with a custom functionHaving a custom debugging function saved in a file somewhere that you can quickly grab and paste into the code can be particularly useful. If you are fast, you can also code one on the fly. The important thing is to write it in such away that it will not leave anything behind when you eventually remove the calls and their definitions. Therefore, it is important to code it in a way that is completely self-contained. Another good reason for this requirement is that it will avoid potential name clashes with the rest of the code.Let us see an example of such a function:# custom.pydef debug(*msg, print_separator=True): print(*msg) if print_separator: print("-" * 40)debug("Data is ...")debug("Different", "Strings", "Are not a problem")debug("After while loop", print_separator=False)$ python custom.pyData is ...----------------------------------------Different Strings Are not a problem----------------------------------------After while loopAs you can see, there is no separator after the last line.This is just one easy way to augment a simple call to theprint()function. Let us see how we can calculate a time difference between calls, using one of Python’s tricky features to our advantage:# custom_timestamp.pyfrom time import sleepdef debug(*msg, timestamp=[None]): from time import time # local import print(*msg) if timestamp[0] is None: timestamp[0] = time() # 1 else: now = time() print(f" Time elapsed: {now - timestamp[0]:.3f}s") timestamp[0] = now # 2debug("Entering buggy piece of code...")sleep(0.3)debug("First step done.")sleep(0.5)debug("Second step done.")This is a bit more complicated. First, notice that we used animportstatementinsidethedebug()function to import thetime()function from thetimemodule. This allows us to avoid having to add thatimportoutside the function and risk forgetting to remove it.Look at how we definedtimestamp. It is a function parameter with a list as its default value. InChapter 4,Functions, the Building Blocks of Code, we warned against using mutable defaults for parameters because the default value is initialized when Python parses the function, and the same object persists across different calls to the function. Most of the time, this is not the behavior you want. In this case, however, we are taking advantage of this feature to store a timestamp from the previous call to the function, without having to use an external global variable. We borrowed this trick from our studies onclosures, a technique that we encourage you to read about.After printing the message, we inspect the content of the only item intimestamp. If it isNone, we have no previous timestamp, so we set the value to the current time (#1). On the other hand, if we have a previous timestamp, we can calculate a difference (which we neatly format to three decimal digits), and finally, we put the current time intimestamp(#2).Running this code outputs the following:$ python custom_timestamp.pyEntering buggy piece of code...First step done.Time elapsed: 0.300sSecond step done.Time elapsed: 0.500sUsing a custom debug function solves some of the problems associated with just usingprint(). It reduces duplication of debugging code and makes it easier to remove all your debugging code when you no longer need it. However, it still requires modifying the code and running it in a console where you can inspect the output. Later in this chapter, we will see how we can overcome those difficulties by adding logging to our code.Learn Python Programming - Fourth Editionwas published in Novemver 2024. Packt library subscribers can continue reading the entire book for free or you can buy the book here!Get the eBook for $35.99$24.99🛠️Useful Tools⚒️Holos: A Go CLI tool using CUE to replace YAML templating in Kubernetes, streamlining Helm and Kustomize configurations with type-safe, unified management.cal.com: An open-source, self-hosted alternative to Calendly, offering complete control over scheduling, data, and workflows, with extensive customizability.sqlfluff: A highly configurable, dialect-flexible SQL linter and auto-formatter that supports templating systems like Jinja and dbt, ensuring error-free SQL code.That’s all for today.We have an entire range of newsletters with focused content for tech pros. Subscribe to the ones you find the most usefulhere.If your company is interested in reaching an audience of developers, software engineers, and tech decision makers, you may want toadvertise with us.If you have any suggestions or feedback, or would like us to find you a learning resource on a particular subject, just respond to this email!*{box-sizing:border-box}body{margin:0;padding:0}a[x-apple-data-detectors]{color:inherit!important;text-decoration:inherit!important}#MessageViewBody a{color:inherit;text-decoration:none}p{line-height:inherit}.desktop_hide,.desktop_hide table{mso-hide:all;display:none;max-height:0;overflow:hidden}.image_block img+div{display:none}sub,sup{font-size:75%;line-height:0}#converted-body .list_block ol,#converted-body .list_block ul,.body [class~=x_list_block] ol,.body [class~=x_list_block] ul,u+.body .list_block ol,u+.body .list_block ul{padding-left:20px} @media (max-width: 100%;display:block}.mobile_hide{min-height:0;max-height:0;max-width: 100%;overflow:hidden;font-size:0}.desktop_hide,.desktop_hide table{display:table!important;max-height:none!important}}
Read more
  • 0
  • 0
  • 7277

Divya Anne Selvaraj
05 Dec 2024
Save for later

ProgrammingPro #85: Blazor Routing in C#, Kotlin 2.1's when Expressions, GraalVM JIT for Java, and Python Speed Boosts with Cython

Divya Anne Selvaraj
05 Dec 2024
Bite-sized actionable content, practical tutorials, and resources for programmers#85Blazor Routing in C#, Kotlin 2.1's when Expressions, GraalVM JIT for Java, and Python Speed Boosts with CythonHi ,Welcome to this week’s edition of ProgrammingPro!In today’sExpert Insight, we bring you an excerpt from the recently published book, C# 13 and .NET 9 – Modern Cross-Platform Development Fundamentals - Ninth Edition, which demonstrates defining routable page components, passing route parameters, and navigating routes in Blazor.News Highlights:Kotlin 2.1.0 previews advanced when expressions; Rust 1.83 enhances Multiplatform and Gradle tools; AWS Q Developer adds AI-driven testing and modernization; and Oracle launches GraalVM JIT for its JDK only.My top 5 picks from today’s learning resources:Cython tutorial: How to speed up Python🐇Hans Wennborg: C++ switch statements under the hood in LLVM🔧Understanding JavaScript Hoisting: The Magic Behind Variable and Function Declarations🎩Reaching Your Automatic Testing Goals by Enhancing Your Test Architecture🤖Faster Features, Happier Customers: Introducing The Platform That Transformed Our Grocery App🚀But there’s more, so dive right in.Stay Awesome!Divya Anne SelvarajEditor-in-ChiefSign Up|Advertise🗞️News and Analysis🔎Kotlin previews guard conditions in when expressions: Kotlin 2.1.0 introduces guard conditions for more flexible when expressions, non-local breaks/continues, and multi-dollar string interpolation as preview features.Rust 1.83 expands const capabilities: The updates improve Kotlin Multiplatform library publishing, add Swift export, stabilize Gradle DSLs, and enhance K2 compiler checks.AWS enhances Q Developer: Test and review code, upgrade to modern .NET, migrate mainframe applications: Features include AI-driven unit testing, code reviews, operational troubleshooting, and migration tools.Microsoft fixed slow package restore in .NET 9.0, but with annoying early bugs: The SDK introduces a 15x faster package restore with NuGet 6.12, but bugs like downloading unused packages remain.Java News Roundup: Last of the JEPs Targeted to JDK 24, Quarkus 3.17, Maven 4.0-RC1, Kotlin 2.1: Updates also include Hibernate Search 7.2.2, Eclipse Vert.x 5.0, and the latest JDKUpdater version.Oracle Ships GraalVM Java JIT Compiler - but Only in Its Own JDK: The compiler offers better performance and maintainability than standard OpenJDK JIT compilers.New report finds signs of slowing supply chain security momentum, plateaued DevOps maturity: According to Snyk's State of Open Source report, organizations report reduced adoption of new tools and training due to security fatigue.JavaScript-based APIs have the lowest quality scores among all languages: The 2024 treblle Anatomy of an API report also notes explosive AI-driven API growth, rising complexity, and the critical need for better governance.🎓Tutorials and Learning Resources💡Python🎓Tutorial | Cython tutorial: How to speed up Python: Provides step-by-step guidance on optimizing Python functions, integrating Cython with Python libraries, compiling code, and profiling for speed improvements.💡Goodbye Make and Shell, Hello... Python?:Advocates using Python for build and project tooling over traditional Makefiles and shell scripts, emphasizing its benefits for maintainability, debuggability, and flexibility.For more Python resources, go to PythonProC# and .NET🎓Tutorial | How to use ref structs in C# 13: Covers the implementation, benefits, limitations, and extended capabilities of ref structs in C# 13 for high-performance, stack-only memory management.🎓Tutorial | File Operations C# .NET: Part 01 — File and Directory Handling: Covers path manipulation, copying, moving, deleting, exception handling, and best practices, using .NET 8, C# 12, and Visual Studio 2022.🎓Tutorial | Deep Dive into .NET Hosted Services: Delves into the BackgroundService class, its lifecycle methods (StartAsync, StopAsync), and integration with the Host class for managing long-running tasks.C and C++🎥Hans Wennborg: C++ switch statements under the hood in LLVM: Explains how LLVM uses clustering, jump tables, bit masking, and binary search trees for efficient code generation and addresses edge cases.💡Legacy Safety: The Wrocław C++ Meeting: Discusses the challenges of improving C++ memory safety focusing on the tension between two approaches: Profiles, incremental safety rules for existing code, and Safe C++, a borrow-checking approach.🎓Tutorial | Build Your Own In-Memory Data Store with C: A Step-by-Step Guide (Part 2): Provides guidance for creating the table, inserting, retrieving, deleting, and cleaning up data, basic test setup, and compiling with CMake.Java🗞️Oracle's Java price hikes push CIOs to brew new licensing strategies: Many are exploring open-source Java alternatives, which could cut costs by 50%, but the transition requires top-level involvement to assess risks.🎓Tutorial | Spring Security Guide:Part 1: Provides an overview of how security works in Spring-based web applications, focusing on middleware for authentication (identifying users) and authorization (checking permissions).🎓Tutorial | Linked List Complexity: Delves into the efficiency of linked list operation for insertions and deletions compared to array-based structures, and provides examples of using Java's LinkedList class and more.JavaScript and TypeScript🎓Tutorial | Understanding JavaScript Hoisting: The Magic Behind Variable and Function Declarations: Explains thedifferences between var, let, const , function declarations, and function expressions.🎓Tutorial | React file nesting design pattern: Introduces thedesign pattern using the VSCode extension File Nesting Explorer, enabling a hierarchical folder structure that mirrors the UI/UX tree of the application.💼Case Study | A leap in the evolution of Airtable’s codebase: Scaling TypeScript to thousands of projects: Discusses how Airtable scaled its codebase from 50 to nearly 3000 projects, reducing typechecking time by 65%.Go🎓Tutorial | Building a distributed log using S3 (under 150 lines of Go): Demonstrates how to build a durable, distributed log, covering its design for appending, reading, checksums, crash recovery, and failover handling.💡Dependency management fatigue, or why I forever ditched React for Go+HTMX+Templ: Focuses on how the Go+HTMX+Templ stack allows developers to focus on feature development and minimize maintenance.Rust💼Case Study | Optimization adventures: making a parallel Rust workload 10x faster with (or without) Rayon: Dicusses optimization by replacing Rayon with a custom thread pool and work-stealing implementation.📖Open Access Book | Writing NES Emulator in Rust: Covers essential topics such as emulating the NES CPU, memory management, picture processing unit (PPU), audio processing unit (APU), and input handling.Swift🎓Tutorial | Native Swift on Android, Part 2: Your First Swift Android App: Demonstrating how to build a "Hello Swift" app that integrates native Swift functionality and Kotlin/Jetpack Compose via bridging.🎓Tutorial | Enum explained in-depth with code examples in Swift: Covers definitions, raw values, associated values, CaseIterable protocol, Equatable conformance, advanced usage with if/guard case, and more.PHP🎓Tutorial | Exploring PHP Lazy Objects: A Practical Implementation: Introduces PHP Lazy Objects, a new feature in PHP 8.4 that optimizes object initialization using two strategies: Ghost Objects and Virtual Proxies.🎓Tutorial | Graceful Error Handling with Laravel’s rescue Function: Delves into Laravel’s rescue function which offers a concise and readable way to handle exceptions without disrupting application flow.SQL🎓Tutorial | Writing Composable SQL using Knex and Pipelines: Explains how to write composable SQL queries using Knex, a Node.js query builder, and pipelines for a functional programming approach.🗞️AWS announces Aurora DSQL, a new distributed SQL database that promises virtually unlimited scalability: This serverless distributed SQL database offers 99.999% availability, strong consistency, and PostgreSQL compatibility.Ruby🎓Tutorial | Speeding up Ruby by rewriting C… in Ruby: Explores the challenges and progress in optimizing Ruby's performance, especially through rewriting C-based methods in Ruby to leverage Yet Another Ruby JIT.🎓Tutorial | Calculating the largest known prime in Ruby: Explains how Ruby 3.4 introduces support for calculating large numbers like the largest known prime, which previously returned infinity.Kotlin🎓Tutorial | Kotlin Flows Animated (Scan, Fold, Reduce): Delves into Kotlin Flows' state accumulation operators, explaining their use cases with examples.🎓Tutorial | Deploy Kotlin Mutliplatform WasmJS to Github Pages: Demonstrates using a GitHub Actions workflow to automate building and deploying a Kotlin/wasmJs project from a structured directory.🌟Best Practices and Advice🚀How to Use Programming Rules and Guidelines: Discusses the proper use of programming rules and guidelines, emphasizing their impact on code consistency and readability.Navigating Responsible AI in the FinTech Landscape: Discusses the EU AI Act, balancing transparency and efficiency, cross-functional collaboration, and risk management, highlighting FinTech’s potential to lead in ethical AI adoption.Reaching Your Automatic Testing Goals by Enhancing Your Test Architecture: Discusses integrating technical tools and human collaboration, focusing on trends over individual failures, using ML for auto-triaging, and more.Faster Features, Happier Customers: Introducing The Platform That Transformed Our Grocery App: Discusses how Picnic transformed its app by adopting React Native, enabling faster feature delivery through cross-platform development, modular architecture, and real-time rule evaluation.🧠Expert Insight📚Here’s an excerpt from “Chapter 14: Building Interactive Web Components Using Blazor" in the book, C# 13 and .NET 9 – Modern Cross-Platform Development Fundamentals - Ninth Edition by Mark J. Price, published in November 2024.How to define a routable page componentTo create a routable page component, add the@pagedirective to the top of a component’s.razorfile, as shown in the following markup:@page "/customers"The preceding code is the equivalent of a mapped endpoint inProgram.cs, as shown in the following code:app.MapGet("/customers", () => ...);TheRoutercomponent scans the assembly specifically in itsAppAssemblyparameter for Blazor components with the@pagedirective, registering their URL paths as endpoints.At runtime, a page component is merged with any specific layout that you have specified in theRoutes.razorfile<RouteView>component. By default, the Blazor Web App project template definesMainLayout.razoras the layout for page components.Pro Tip: Good Practice: By convention, put routable page Blazor components in theComponents\Pagesfolder.How to navigate routes and pass route parametersMicrosoft provides a dependency service namedNavigationManagerthat understands Blazor routing and theNavLinkcomponent. TheNavigateTomethod is used to go to the specified URL.Blazor routes can include case-insensitive named parameters, and your code can most easily access the values passed by binding the parameter to a property in the code block, using the[Parameter]attribute, as shown in the following markup:@page "/customers/{country}"<div>Country parameter as the value: @Country</div>@code { [Parameter] public string Country { get; set; }}The recommended way to handle a parameter that should have a default value when it is missing is to suffix the parameter with?and use the null-coalescing operator in theOnParametersSetmethod, as shown in the following markup:@page "/customers/{country?}"<div>Country parameter as the value: @Country</div>@code { [Parameter] public string Country { get; set; } protected override void OnParametersSet() { // If the automatically set property is null, then // set its value to USA. Country = Country ?? "USA"; }}C# 13 and .NET 9 – Modern Cross-Platform Development Fundamentals - Ninth Editionwas published in Novemver 2024. Packt library subscribers can continue reading the entire book for free or you can buy the book*{box-sizing:border-box}body{margin:0;padding:0}a[x-apple-data-detectors]{color:inherit!important;text-decoration:inherit!important}#MessageViewBody a{color:inherit;text-decoration:none}p{line-height:inherit}.desktop_hide,.desktop_hide table{mso-hide:all;display:none;max-height:0;overflow:hidden}.image_block img+div{display:none}sub,sup{font-size:75%;line-height:0}#converted-body .list_block ol,#converted-body .list_block ul,.body [class~=x_list_block] ol,.body [class~=x_list_block] ul,u+.body .list_block ol,u+.body .list_block ul{padding-left:20px} @media (max-width: 100%;display:block}.mobile_hide{min-height:0;max-height:0;max-width: 100%;overflow:hidden;font-size:0}.desktop_hide,.desktop_hide table{display:table!important;max-height:none!important}}
Read more
  • 0
  • 0
  • 7038

Divya Anne Selvaraj
28 Nov 2024
Save for later

ProgrammingPro #84: TypeScript 5.7's Never-Initialized Checks, Angular v19's Server Performance, and Cython 3.1's No-GIL Builds

Divya Anne Selvaraj
28 Nov 2024
Bite-sized actionable content, practical tutorials, and resources for programmers#84TypeScript 5.7's Never-Initialized Checks, Angular v19's Server Performance, and Cython 3.1's 'No-GIL' BuildsHi ,Welcome to this week’s edition of ProgrammingPro andHappy Thanksgiving if you celebrate! We're grateful for your continued support and passion for learning.In today’sExpert Insight, we bring you an excerpt from the recently published book, Mastering Angular Test-Driven Development, which explains the concept of code smells in Angular applications—indicators of potential issues in code that hinder maintainability and scalability.News Highlights: TypeScript 5.7 adds never-initialized checks and ECMAScript 2024 support; Vite 6.0 debuts with modern Sass API and asset updates; Cython 3.1 supports Python's "no-GIL" builds for better parallelism; and USPTO petitioned to cancel Oracle's JavaScript trademark over alleged abandonment.My top 5 picks from today’s learning resources:Top 65+ Data Science Projects with Source Code📊Replaying Kafka messages: Practical guide with sample code🔄Concepts in C++20💡Architectural Intelligence – The Next AI🏛️The top 25 weaknesses in software in 2024🚨But there’s more, so dive right in.Stay Awesome!Divya Anne SelvarajEditor-in-ChiefP.S.:Thank you all who participated in this month's survey. With this issue, we have fulfilled all content requests made this month.Sign Up|Advertise🗞️News and Analysis🔎Announcing TypeScript 5.7: The version introduces new features like checks for never-initialized variables, path rewriting for relative imports, support for ECMAScript 2024, and validated JSON imports in Node.js.Release Vite 6.0: Updates include an Experimental Environment API for improved development-production parity, enhanced JSON handling, expanded HTML asset referencing, and modern Sass API as default.Uno Platform Launches Hot Design, a Cross-Platform Visual Designer for .NET Apps: The suite also includesHot Reloadfor code updates andDesign-to-Code, a Figma plugin generating XAML and C# from prototypes.Java News Roundup: OpenJDK and Jakarta EE 11 Updates, Payara Platform, Vert.x, Log4j, JobRunr: Updates also includeMicronaut 4.7.1,JobRunr 7.3.2, and Gradle 8.11.1 maintenance releases.Python to C: What’s new in Cython 3.1: The version introduces significant updates, including experimental support for Python's free-threaded "no-GIL" builds in Python 3.13, enhancing parallelism for CPU-bound threads.USPTO petitioned to cancel Oracle’s JavaScript trademark: Deno Land has petitioned the USPTO to cancel Oracle's ownership of the JavaScript trademark, accusing Oracle of abandonment and fraud, citing no active role since 2009.Kotlin to lose scripting features: JetBrains plans to phase out certain scripting features in Kotlin, including REPL functionality, Java Specification Request 223 support, the KotlinScriptMojo Maven plugin, and kotlin-scripting-ide-services.🎓Tutorials and Learning Resources💡Python💡Top 65+ Data Science Projects with Source Code: Covers diverse areas like machine learning, NLP, deep learning, web scraping, and data visualization with real-world datasets and practical challenges.🎓Tutorial | Speed Up Your Python Program With Concurrency: Explains threading, asynchronous tasks, and multiprocessing, demonstrating how to optimize I/O-bound and CPU-bound tasks for improved performance.For more Python resources, go to PythonProNoSQL and Spark🎓Tutorial | Evolving a NoSQL Database Schema: Covers creating a single-table design, optimizing queries with keys and indexes, handling sharding for scalability, and enabling efficient cross-partition querying.💡Spark structured streaming — Checkpointing: Explains how Checkpointing aids in fault tolerance by maintaining stream state and offsets along with implementation details and surprising behaviors when configuring parameters.C# and .NET🎓Tutorial | Master Cache in C#: Covers IMemoryCache,IDistributedCache, andHybridCache and discusses when to use caching, its benefits, challenges, and patterns, including cache invalidation and metrics.🎓Tutorial | My process for creating API clients: Outlines a structured process for creating API clients in C# using Flurl, balancing automation and control between tools like HttpClient, Refit, and Kiota.💡C# puzzles: Presents two C# puzzles focusing on unconventional behavior: making modifications to StringBuilderobjects through aSecretSaucefunction without unsafe operations or external interference.C and C++🎓Tutorial | Concepts in C++20:Explains how C++20 concepts simplify template constraints, replacing SFINAE with readable, expressive syntax and highlights four ways to apply concepts for enhanced error clarity.🎥💡How Designing Carbon C++ Interop Taught me About C++ Variadics & Bound Members - Chandler Carruth: Introduces Carbon's type-checked variadic functions, enabling safer and more reliable templates.🎓Tutorial | Bubble Sort Implementation Using a Single for Loop in C: Presents an alternative implementation of Bubble Sort in C using a single forloop instead of nested loops.Java🎓Tutorial | Replaying Kafka messages: Practical guide with sample code: Covers three approaches: offset-based replay, mirror topics, and custom replay services and explains use cases with sample Java code.💡How Fast Does Java Compile?: Examines the speed of Java compilation, revealing that the Java compiler (javac)can process over100,000 lines of code per second on a single core when warmed up.Reactive Real-Time Notifications with SSE, Spring Boot, and Redis Pub/Sub: Highlights the advantages of a reactive approach, such as improved scalability and resource utilization, along with practical integration guidance.JavaScript and TypeScriptDevelop AI apps with JavaScript: Includes quickstart guides, libraries, templates, and training for tasks like text generation, image analysis, and NLP, focusing on Azure OpenAI Service and other Azure AI services.🎓Tutorial | JavaScript Sets and Maps: Beyond Arrays and Objects: Discusses Sets and Maps' advantages over arrays and objects, when to use them, and their ability to handle unique values and maintain key types.🎓Tutorial | Almost Perfect tsconfig.json Options for Your Angular Projects: Provides a step-by-step guide to optimizing the tsconfig.json file for Angular 18 projects, covering configurations for TypeScript compiler options.Go🎓Tutorial | Go Production Performance Gotcha - GOMAXPROCS: Discusses a performance issue in a Go-based workload caused by not explicitly setting the GOMAXPROCS parameter, leading to high CPU usage.💼Case Study | Are Golang Generics Simple or Incomplete? A Design Study: Explores the simplicity versus incompleteness of Go's generics by presenting a case study involving Map,MutableMap, andIndextypes in a version-controlled SQL database.Rust🎓Tutorial | Rust for AWS Lambda, the Docker Way: Walks you through using Cargo Lambda for simplified Rust Lambda development and presents two Dockerfile configurations including one supporting cross-compilation.💼Case Study | Making Rust a first-class citizen for Xen: Discusses Vates' efforts to integrate Rust into the Xen Project by developing pure-Rust alternatives to C-based libraries, creating safer, more efficient tools.Swift🎓Tutorial | Calling Hidden Swift Functions: Delves into techniques for calling hidden Swift functions, specifically those within Apple's frameworks, which are not directly accessible due to access level restrictions.🎓Tutorial | Mock Your Remote Config🧑‍💻: Provides a step-by-step guide on using protocols, dependency injection, and mock implementations.PHP🎓Tutorial | Step-by-Step Guide to Installing PHP 8.4 on Ubuntu 24.04 with Nginx & MySQL: Covers system updates, adding the Ondřej PHP repository, installing PHP with necessary extensions and configuring PHP-FPM with Nginx.SQL📜Towards Optimizing SQL Generation via LLM Routing: This paper introduces the first LLM routing approach for Text-to-SQL, dynamically selecting cost-effective LLMs for accurate SQL generation based on query complexity.Ruby💡10 Costly Ruby on Rails Upgrade Mistakes to Avoid in 2025: Identifies common pitfalls and provides actionable strategies to ensure a secure, performant, and seamless transition, reducing costs and enhancing stability.Powershell💡Attacking PowerShell CLIXML Deserialization: Explores vulnerabilities which can lead to remote code execution through untrusted data and recommends including patching systems, limiting third-party PowerShell modules, and more.Kotlin🎓Tutorial | Kotlin for Java developers: Concurrency with coroutines: Covers Kotlin's concurrency model using coroutines, demonstrating key features like scopes, dispatchers, contexts, channels, and flows.🌟Best Practices and Advice🚀Architectural Intelligence – The Next AI: Advocates for using traditional trade-off analysis to evaluate the appropriateness of AI for specific scenarios, distinguishing between suitable, questionable, and inappropriate use cases.What if AI eventually makes programmers smarter, not dumber: Argues that AI, particularly through LLMs, is transforming programming by reducing the time spent on repetitive coding tasks and enabling you to focus on problem-solving.How McDonald Sells Millions of Burgers Per Day With Event-Driven Architecture:Discusses how the architecture facilitates asynchronous operations, transactional processing, and real-time event handling.State of Software Architecture Report — 2024: Discovered widespread use of diagramming tools (96%) and collaborative wikis (79%) for documenting architecture, with microservices (67%) and event-driven patterns (62%) being the most common.The top 25 weaknesses in software in 2024: This year’s list, based on 31,779 CVEs, emphasizes classic weaknesses alongside notable changes, including upward movements for Cross-Site Request Forgery (CSRF) and Code Injection.🧠Expert Insight📚Here’s an excerpt from “Chapter 11: Refactoring and Improving Angular Code through TDD" in the book, Mastering Angular Test-Driven Development by Ezéchiel Amen AGBLA, published in October 2024.Identifying code smells and areas for improvement in Angular applicationsWhile your Angular application might seem functional on the surface, there could be underlying issues waiting to erupt. These issues, known as code smells, don’t necessarily causeimmediate problems but indicate areas in your codebase that could benefit from refactoring. Just like a cluttered room can be stressful and unproductive, smelly code can make it difficult to maintain, understand, and extend your application. This section delves into the world of code smells in Angular applications. We’ll explore what they are, why they matter, and how to identify them proactively. By understanding these code smells, you’ll be equipped to prioritize refactoring efforts using TDD, ultimately leading to a cleaner, more maintainable, and robust code base.What are code smells?Imagine walking into a kitchen where dirty dishes are piled up high in the sink, spices are scattered across the counter, and expired food lingers in the fridge. This unpleasant scene might not prevent you from cooking a basic meal, but it certainly wouldn’t be an enjoyable or efficient experience. Code smells are analogous to this messy kitchen in the softwaredevelopment world.Coined by Martin Fowler in his book,Refactoring: Improving the Design of Existing Code, code smells are indicators of potential problems within your code base. They don’t necessarily represent functional bugs that cause the application to crash. Instead, they signify areas that could be improved for better readability, maintainability, and long-term health ofyour code.Code smells are not bugs, but they can attract bugs in the future. They act like red flags, warning you of potential trouble spots that could become problematic as yourapplication evolves.Why should we care about code smells in Angular?Ignoring a messy kitchen might lead to unpleasant odors, fruit flies, and frustration when you need to cook a meal. Similarly, neglecting code smells in your Angular application can have severalnegative consequences:Decreased maintainability: Smelly code becomes difficult to understand and modify over time. As your application grows and features are added, the complexity of tangled code can make changes cumbersome anderror prone.Increased debugging time: When bugs arise in smelly code, it can be challenging to pinpoint the root cause. The lack of clear structure and organization makes it like searching for a needle in a haystack, wasting valuabledeveloper time.Reduced team productivity: Working with smelly code can be frustrating and demotivating for developers. The cognitive overhead of deciphering tangled logic slows down development andhinders collaboration.Technical debt: Unattended code smells accumulate over time, creating a technical debt that needs to be addressed eventually. This debt can become a significant burden, requiring dedicated resources and potentially delaying newfeature development.By proactively identifying and refactoring code smells, you can dothe following:Improve code readability: Clean and well-structured code is easier to understand for both you and other developers working on the project. This reduces onboarding time for new team members and fostersbetter collaboration.Enhance maintainability: Refactored code is easier to modify and adapt as your application’s requirements evolve. This allows you to introduce new features and bug fixesmore efficiently.Reduce debugging time: Cleaner code with a clear separation of concerns makes it easier to isolate and fix problems whenbugs arise.Boost team productivity: Working with well-structured code improves developer experience and satisfaction. This leads to higher productivity and a more positivedevelopment environment.Minimize technical debt: By addressing code smells early on, you prevent them from accumulating and becoming a significant burden inthe future.In essence, prioritizing code smell refactoring is an investment in the long-term health and maintainability of yourAngular application.Identifying the most common code smells in Angular applicationsNow that we understand the importance of identifying code smells, let’s take a look at some of the most common offenses you might encounter in yourAngular application:The long and winding method: Imagine a method in your service that stretches across dozens of lines, handling various tasks. This is a prime example of a long method, a code smell suggesting a lack of modularity. These methods can be difficult to understand, test, and modify. Refactoring involves breaking down such behemoths into smaller, well-defined functions, each focusing on a specific task. This enhances code readabilityand maintainability.The god component: Have you encountered a component overloaded with responsibilities? This is a “god component,” handling everything from data fetching to complex UI logic. Such components become maintenance nightmares as changes in one area can ripple through the entire component, causing unintended consequences. Refactoring can involvethe following:Creating dedicated services: Extract functionalities related to data access, business logic, or calculations into separate services. These services can be reused by multiple components, promotingbetter organization.Splitting the component: Break down the god component into smaller, more focused components, each handling a specific aspect of the UIor functionality.The code duplication monster: Seeing the same block of code copy-pasted across different parts of your application? This code duplication not only wastes space but also makes maintenance a challenge. Any bug fix in one instance needs to be replicated across all copies. Refactoring involves identifying these repetitive code snippets and creatingthe following:Reusable components: If the duplicated code deals with UI elements, consider creating a reusable component that can be used inmultiple places.Services or utility functions: For duplicated logic unrelated to the UI, extract them into services or utility functions that can be sharedacross components.The magic number mystery: Scattered numeric constants with no clear meaning throughout your code base are like magic tricks; they are confusing and difficult to maintain. Imagine having a constant10used for pagination but its purpose is unclear. Refactoring involves replacing these magic numbers with named variables or constants. For example, useITEMS_PER_PAGEinstead of10, making the code more self-documenting and easierto understand.The spaghetti code maze: Imagine code that winds and twists, lacking clear structure and organization. This is spaghetti code, making it a challenge to navigate, understand, and modify. TDD can be a powerful tool to combat spaghetti code. By writing tests first and then refactoring the code to meet those tests, you can introduce structure and improve the overall organization of yourcode base.Mastering Angular Test-Driven Developmentwas published in October 2024. Packt library subscribers can continue reading the entire book for free or you can buy the bookhere!Get the eBook for $30.99$20.98🛠️Useful Tools⚒️superflex-vscode: AI-driven VSCode tool turning Figma, images, and prompts into production-ready frontend code.jekyll-sqlite: A a plugin enabling SQLite as a data source for dynamic Jekyll sites using SQL queries.lovable: AI-driven full-stack assistant that rapidly converts ideas into production-ready apps, enabling fast prototyping, editing, and deployment.That’s all for today.We have an entire range of newsletters with focused content for tech pros. Subscribe to the ones you find the most usefulhere.If your company is interested in reaching an audience of developers, software engineers, and tech decision makers, you may want toadvertise with us.If you have any suggestions or feedback, or would like us to find you a learning resource on a particular subject, just respond to this email!*{box-sizing:border-box}body{margin:0;padding:0}a[x-apple-data-detectors]{color:inherit!important;text-decoration:inherit!important}#MessageViewBody a{color:inherit;text-decoration:none}p{line-height:inherit}.desktop_hide,.desktop_hide table{mso-hide:all;display:none;max-height:0;overflow:hidden}.image_block img+div{display:none}sub,sup{font-size:75%;line-height:0}#converted-body .list_block ol,#converted-body .list_block ul,.body [class~=x_list_block] ol,.body [class~=x_list_block] ul,u+.body .list_block ol,u+.body .list_block ul{padding-left:20px} @media (max-width: 100%;display:block}.mobile_hide{min-height:0;max-height:0;max-width: 100%;overflow:hidden;font-size:0}.desktop_hide,.desktop_hide table{display:table!important;max-height:none!important}}
Read more
  • 0
  • 0
  • 7423

Divya Anne Selvaraj
22 Nov 2024
Save for later

ProgrammingPro #83: Unreal Engine 5's AI Perception, Fil-C's Memory Safety for C++, and Go's AI Evolution

Divya Anne Selvaraj
22 Nov 2024
Bite-sized actionable content, practical tutorials, and resources for programmers#83Unreal Engine 5's AI Perception, Fil-C's Memory Safety for C++, Go's AI Evolution, and Python In-Memory ComputingScale your scrapers with Apify’s Black Friday Boost plan!Get a 30% prepaid usage bonus on Apify this Black Friday. Scrape data for app integrations, performance tracking, competitive research, or custom pipelines. Use pre-built scrapers, build your own from scratch, or use quick-start code templates.The Boost plan ends December 5 - grab it while you can!Claim your bonus now!Hi ,Welcome to this week’s edition of ProgrammingPro!In today’sExpert Insight, we bring you an excerpt from the recently published book, Artificial Intelligence in Unreal Engine 5, which introduces Unreal Engine 5's AI Perception System, detailing its components, predefined sense configurations, and how developers can use or customize it.News Highlights: Fil-C tackles memory safety in C/C++ without requiring a new language; Go advances for AI and hardware efficiency with improved garbage collection; Rust Foundation enhances C++ interoperability with better tools and collaboration; and F# 9 introduces nullable reference types, computation expressions, and library upgrades.My top 5 picks from today’s learning resources:Researchers develop Python code for in-memory computing — in-memory computation comes to Python code🧠Speeding up the Rust edit-build-run cycle⚡C# 13 and .NET 9: Personal Highlights🎯Clean Architecture: The Missing Chapter🏗️How I Used Event-Driven Architecture in the Wrong Way🔄But there’s more, so dive right in.Stay Awesome!Divya Anne SelvarajEditor-in-ChiefP.S.:This month'ssurvey is still live. Do take the opportunity to leave us your feedback, request a learning resource, and earn your one Packt credit for this month.Sign Up|Advertise🗞️News and Analysis🔎Java News Roundup: Spring Framework 6.2, OpenJDK JEPs, Micronaut 4.7, Gradle 8.11: Other highlights include Project Reactor 2024.0.0, with enhancements spanning dependency upgrades and other new features.Rust haters, unite! Fil-C aims to Make C Great Again: Fil-C, a memory-safe variant of C and C++ developed by Filip Pizlo aims to address memory safety vulnerabilities, without requiring developers to learn a new language.F# 9 adds nullable reference types: The version also introduces empty-bodied computation expressions, and standard library enhancements like random sampling and shuffling functions.Go language evolving for future hardware, AI workloads:The Go team is working on improving garbage collection, introducing hardware-efficient features, and integrating AI SDKs like LangChainGo.Rust Foundation moves forward on C++ and Rust interoperability: The initiative focuses on enhancing tools, building consensus for long-term solutions, and collaborating with the C++ community to address challenges.JetBrains releases IntelliJ IDEA 2024.3 and other IDEs, still struggles to convince devs of benefits of new UI: Updates have been made to PHPStorm, PyCharm, and GoLand. Improvements include Logical code structure view.Uno Hot Design aims to meet demand for a visual designer for modern .NET: Hot Design isa visual design tool in the Uno Platform Studio suite to address the lack of a designer for modern .NET development, including WinUI.🎓Tutorials and Learning Resources💡Python🗞️Researchers develop Python code for in-memory computing — in-memory computation comes to Python code:Technion researchers have developedPyPIM, a tool that translates Python code into machine code for in-memory computing, enabling programmers to use Python without adaptation.For more Python resources, go to PythonProC# and .NET🎓Tutorial | Events and Delegates in C#: Covers the definition, implementation, and practical use of events and delegates in C#, including their benefits, use cases, and challenges, with examples and best practices.💡C# 13 and .NET 9: Personal Highlights: Reviews highlights of C# 13 and .NET 9, including enhanced performance, AI integration, improved params collections, new thread synchronization tools, and implicit index access.🎓Tutorial | Mastering Divide and Conquer (D&C): A Fundamental Algorithmic Paradigm: Explains the paradigm, detailing its practical applications with examples like Merge Sort and curated LeetCode problems.C and C++💼Case Study | Retrofitting spatial safety to hundreds of millions of lines of C++: Outlines Google's efforts to enhance spatial memory safety in its vast C++ codebase by retrofitting hardened libc++ with bounds checking.🎓Tutorial | Non-allocating Circular Buffer in C++: Explains circular buffers in C++, highlighting their fixed capacity and ability to overwrite the oldest data when full.🎓Tutorial | You can use C-Reduce for any language: Demonstrates the versatility of C-Reduce, a tool initially designed to minimize C compiler bug reproducers, with an example involving RustPython.Java🎓Tutorial | A Basic Introduction to the Classfile API: Introduces the Classfile API, providing a basic guide to generating JVM bytecode by constructing class files programmatically.🎓Tutorial | The Ultimate Linked List Guide: Become a Hero with All Methods and Theory in Java (Part-2): Introduces methods for inserting nodes at the start, end, or a specific index in the list to maintain the structure.💼Case Study | Java Backend Observability with OpenTelemetry Traces and Minimal Code: Explores how the MY.GAMES team integrated OpenTelemetry into their Java backend for Rush Royale to improve system observability.JavaScript and TypeScript🎓Tutorial | Importing a frontend Javascript library without a build system: Covers the three main types of JavaScript files (classic, ES Modules, and CommonJS), their characteristics, and methods for importing them.🗞️Meet Angular v19: Key updates include incremental hydration for server-side rendering, event replay stabilization, route-level render modes, and experimental zoneless support.💼Case Study | Adopting Bazel for Web at Scale: details Airbnb's migration of its large-scale web monorepo to Bazel, highlighting challenges, custom solutions, and performance gains in CI processes and developer workflows.Go🎓Tutorial | Constraints in Go: Explores constraints as tools for enhancing type safety and functionality in generic programming by defining permissible operations for types through method sets, unions, and approximations.🎓Tutorial | Testing with Go and PostgreSQL: ephemeral DBs: Explains how to integrate ephemeral PostgreSQL instances into Go testing workflows, optimizing setup for convenience, resource efficiency, and reduced test times.Rust🎓Tutorial | Speeding up the Rust edit-build-run cycle: Showcases steps like using faster linkers (e.g., Mold), minimizing debug information, and creating non-position-independent executables.🎓Tutorial | Build your own SQLite, Part 3: SQL parsing 101: Introduces tokenization and parsing concepts, implements a tokenizer to process SQL strings, defines an AST structure for SQL statements, and more.Swift🎓Tutorial | Syntax Highlighting SwiftUI Code with Swift Syntax: Demonstrates how to implement native SwiftUI syntax highlighting in an app using the swift-syntax library.🎓Tutorial | MainActor usage in Swift explained to dispatch to the main thread: Explains the usage of @MainActor in Swift, a global actor introduced in Swift 5.5 to ensure tasks are executed on the main thread.PHP📜Fuzzing the PHP Interpreter via Dataflow Fusion: Presents FlowFusion, the first automated fuzzing framework, validated by PHP developers, tailored to detect memory errors in the PHP interpreter.🗞️PHP 8.4.0 Released!: The major update introduces property hooks for computed properties, asymmetric visibility for enhanced property access control, the #[\Deprecated] attribute for user-defined deprecation warnings, and more.SQL💼Case Study | Presto® Express: Speeding up Query Processing with Minimal Resources: Delves into Uber's Presto Express which optimizes short-running SQL queries and reduces end-to-end SLA.💡SQL Style Guide: Covers best practices for naming conventions, query syntax, and formatting, aiming to enhance code clarity and facilitate collaboration among developers.Ruby🗞️2024 Ruby on Rails Community Survey Results: Highlights include a growing focus on maintaining applications with the latest Ruby and Rails versions despite challenges like dependency management.💡Elixir-like pipes in Ruby (oh no not again): Explores an experimental implementation of an Elixir-style pipe operator in Ruby, leveraging abstract syntax tree (AST) transformations to enable pipeline-style coding.Kotlin🗞️State of Kotlin Scripting 2024: Highlights that while Kotlin scripting remains a vital part of the Kotlin ecosystem, its adoption has been limited.🎓Tutorial | Understanding Properties in Kotlin: Covers mutable and read-only properties, custom getters and setters, backing fields, compile-time constants, late-initialized properties, and delegated properties.🌟Best Practices and Advice🚀Transforming Legacy Healthcare Systems: A Journey to Cloud-Native Architecture: Examines the challenges of modernizing legacy healthcare systems into cloud-native architectures, using Livi's transformation of its MJog platform as an example.Clean Architecture: The Missing Chapter: Critiques traditional layer-based structures for scattering related components, advocating instead for organizing code by features or components.To Dare or Not to Dare: the MVA Dilemma: Explores the challenges of balancing business and technical risks when developing a Minimum Viable Product (MVP) and its supporting Minimum Viable Architecture (MVA).How I Used Event-Driven Architecture in the Wrong Way: Reflects on the challenges of implementing event-driven architecture, highlighting issues such as managing two-way communication and handling complex event chains.🧠Expert Insight📚Here’s an excerpt from “Chapter 10: Improving Agents with the Perception System" in the book, Artificial Intelligence in Unreal Engine 5 by Marco Secchi, published in October 2024.Presenting the Perception System...One of the key components when creating intelligent and reactive AI agents in Unreal Engine is the AI Perception System; this powerful system allows AI controllers – and, consequently, AI agents – to perceive and respond to different stimuli intheirvirtual environment.At the core of the AI Perception System aresensesandstimuli. A sense – such as sight or hearing – represents a way for an AI agent to perceive its surroundings and is configured to detect specific types of stimuli, which are sources of perception data emanating from other actors in thegame world.As an example,sight senseis preconfigured to detect any visible pawn actors, whiledamage sensetriggers when the associated AI controller’s pawn takes damage from anexternal source.NoteAs a developer, you can create custom senses tailored to your game’s specific needs by extending theAISense class, if you are working with C++, or the AISense_Blueprintclass, if you are workingwith Blueprints.Presenting the Perception SystemThe AI Perception System consists of the followingmain classes:AIPerceptionSystem: This is the core manager that keeps track of all AIstimuli sources.AIPerceptionComponent: This represents the AI agent’s mind and handles processing perceived stimuli. It needs to be attached to an AI controller toproperly work.AIPerceptionStimuliSourceComponent: This component is added to actors that can generate stimuli and is in charge of broadcasting perception data tolistening elements.AIPerceptionSenseConfig: This defines the properties of a specific sense, what actors can be perceived, and how perception decays over timeor distance.When an actor withAIPerceptionStimuliSourceComponentgenerates a stimulus, nearbyAIPerceptionComponentsdetect it through their configured senses. This perceived data is then processed by the AI controller to triggerdesired behaviors.Once you have addedAIPerceptionComponentto an AI controller, you will need to add one or moreAIPerceptionSenseConfigelements in order to give your AI agent dedicated senses.Figure 10.1shows an example where perception is basedon touch:Figure 10.1 – The touch sense configFrom the previous screenshot, you may have noticed aDominant Senseproperty; this property allows you to designate a specific sense that takes priority over others when determining the location of asensed actor.Let’s explore the available sense configs that, as mentioned earlier, define the properties of eachspecific sense:AIPerceptionSenseConfig typesUnreal Engine offers a range of predefinedAIPerceptionSenseConfigclasses that are highly likely to meet your specific requirements. Let’s take a look at theavailable options:AIDamage: Use this configuration if your AI agent needs to respond to damage events such asAny Damage,Point Damage, orRadial DamageAIHearing: Use this configuration if you need to detect sounds generated in thesurrounding environmentAIPrediction: Use this configuration when you need to predict the target actor location in the nextfew momentsAISight: Use this configuration when you want your AI agent to see things inthe levelAITeam: Use this configuration if you want to notify the AI agent that some allyis nearbyAITouch: Use this configuration when the AI agent touches some other actor or, vice versa, when something is touching theAI agentStimuli sourceTheAIPerceptionStimuliSourceComponentclass allows an actor to register itself as a source of stimuli for one or more senses. For instance, you can register an actor as a stimuli source for sight. This registration allows an AI agent to visually perceive the actor in thegame level.A stimuli source can be registered – or unregistered – for a sense, making it detectable – or undetectable – by thePerception System.Artificial Intelligence in Unreal Engine 5was published in October 2024. Packt library subscribers can continue reading the entire book for free or you can buy the bookhere!Get the eBook for $39.99$27.98🛠️Useful Tools⚒️fast-graphrag: Acost-efficient, dynamic, and interpretable framework for building scalable, agent-driven retrieval-augmented generation pipelines.pglite-fusion: A PostgreSQL extension that embeds SQLite databases into table columns, offering streamlined multitenancy and efficient data isolation.fireproof: An open-source live-update database enabling real-time collaboration, seamless integration with any stack, and deployment anywhere.That’s all for today.We have an entire range of newsletters with focused content for tech pros. Subscribe to the ones you find the most usefulhere.If your company is interested in reaching an audience of developers, software engineers, and tech decision makers, you may want toadvertise with us.If you have any suggestions or feedback, or would like us to find you a learning resource on a particular subject, take the surveyor just respond to this email!*{box-sizing:border-box}body{margin:0;padding:0}a[x-apple-data-detectors]{color:inherit!important;text-decoration:inherit!important}#MessageViewBody a{color:inherit;text-decoration:none}p{line-height:inherit}.desktop_hide,.desktop_hide table{mso-hide:all;display:none;max-height:0;overflow:hidden}.image_block img+div{display:none}sub,sup{font-size:75%;line-height:0}#converted-body .list_block ol,#converted-body .list_block ul,.body [class~=x_list_block] ol,.body [class~=x_list_block] ul,u+.body .list_block ol,u+.body .list_block ul{padding-left:20px} @media (max-width: 100%;display:block}.mobile_hide{min-height:0;max-height:0;max-width: 100%;overflow:hidden;font-size:0}.desktop_hide,.desktop_hide table{display:table!important;max-height:none!important}}
Read more
  • 0
  • 0
  • 7714
Divya Anne Selvaraj
18 Nov 2024
Save for later

Essential Guides to C# 13 and .NET 9, AI in Unreal Engine 5, and Angular TDD

Divya Anne Selvaraj
18 Nov 2024
Curated for software engineers, game developers, and frontend specialistsEssential Guides to C# 13 and .NET 9, AI in Unreal Engine 5, and Angular TDDHi ,This week, we’re bringing you three new books for developers working with today’s most in-demand tools. Master C# 13 and .NET 9 for cross-platform development, create smarter AI-driven games with Unreal Engine 5, or deliver high-quality code with test-driven development in Angular—each now at upto 30% off.Bundle up & save more!Buy 2 eBooks – save an additional 10%Buy 3 eBooks – save an additional 15%Buy 5 eBooks – save an additional 20%Here’s what’s on offer:C# 13 and .NET 9 – Modern Cross-Platform Development Fundamentals - Ninth Edition by Mark J. PriceStart building websites and services with ASP.NET Core 9, Blazor, and EF Core 9>Explore the newest additions to C# 13, the .NET 9 class libraries, and Entity Framework Core 9>Build professional websites and services with ASP.NET Core 9 and Blazor>Enhance your skills with step-by-step code examples and best practices tipsGet the eBook for $35.99$24.99Get the Print book for $44.99Artificial Intelligence in Unreal Engine 5 by Marco SecchiUnleash the power of AI for next-gen game development with UE5 by using Blueprints and C++>Adopt AI techniques for developing immersive gameplay experiences>Learn how to use the Unreal Engine gameplay framework system with C++ and Blueprints>Plan and develop AI behaviors carefully from start to finishGet the eBook for $39.99$27.98Get the Print book for $49.99Mastering Angular Test-Driven DevelopmentbyBuild high-quality Angular apps with step-by-step instructions and practical examples>Implement test-driven development practices in Angular using tools like Jasmine, Karma, and Cypress>Understand end-to-end testing through real-world scenarios and practical examples>Discover best practices for incorporating TDD into continuous integration and deployment (CI/CD) processesGet the eBook for $30.99$20.99Get the Print book for $37.99*{box-sizing:border-box}body{margin:0;padding:0}a[x-apple-data-detectors]{color:inherit!important;text-decoration:inherit!important}#MessageViewBody a{color:inherit;text-decoration:none}p{line-height:inherit}.desktop_hide,.desktop_hide table{mso-hide:all;display:none;max-height:0;overflow:hidden}.image_block img+div{display:none}sub,sup{font-size:75%;line-height:0}#converted-body .list_block ol,#converted-body .list_block ul,.body [class~=x_list_block] ol,.body [class~=x_list_block] ul,u+.body .list_block ol,u+.body .list_block ul{padding-left:20px} @media (max-width: 100%;display:block}.mobile_hide{min-height:0;max-height:0;max-width: 100%;overflow:hidden;font-size:0}.desktop_hide,.desktop_hide table{display:table!important;max-height:none!important}}
Read more
  • 0
  • 0
  • 8387

Divya Anne Selvaraj
14 Nov 2024
Save for later

ProgrammingPro #82: Domain-Driven Design for Micro Frontends, .NET 9's JSON Boost, and Python Automation Scripts

Divya Anne Selvaraj
14 Nov 2024
Bite-sized actionable content, practical tutorials, and resources for programmers#82Domain-Driven Design for Micro Frontends, .NET 9's JSON Boost, and Python Automation ScriptsHi ,Welcome to this week’s edition of ProgrammingPro!In today’sExpert Insight, we bring you an excerpt from the recently published book, The Art of Micro Frontends - Second Edition, which explains how Domain-Driven Design principles can help define and organize boundaries for micro frontends to ensure modular, isolated, and efficient architecture.News Highlights: .NET 9 launches with major performance boosts, including a 50% JSON processing gain; Java 24 targets memory savings with smaller object headers via Project Lilliput; the US urges developers to move from C and C++ for security; and GitHub Copilot chat adds prompt rewording guidance.My top 5 picks from today’s learning resources:20 Python scripts to automate common daily tasks⚙️Implementing the Repository Pattern with Multiple Databases in C# Clean Architecture🏗️Optimize Database Performance in Ruby on Rails and ActiveRecord🚄Top 50 System Design Terminologies You Must Know📚Netflix’s Distributed Counter Abstraction📊But there’s more, so dive right in.Stay Awesome!Divya Anne SelvarajEditor-in-ChiefP.S.:This month'ssurveyis now live. Do take the opportunity to leave us your feedback, request a learning resource, and earn your one Packt credit for this month.Sign Up|Advertise🗞️News and Analysis🔎.NET 9 is now available with several performance improvements:The version introduces a 15% increase in requests per second, optimized Server GC, faster LINQ operations, and a 50% boost in System.Text.Jsonprocessing.Java 24 to Reduce Object Header Size and Save Memory: This optimization is part of Project Lilliput and aims to improve memory density, reduce garbage collection pressure, and benefit workloads with small object sizes.Go language rises in Tiobe popularity index: The Google-developed Go language has reached its highest rank, seventh, in November 2024. Go aims to overtake JavaScript (ranked sixth) within three years.OpenJDK News Roundup: Instance Main Methods, Flexible Constructor Bodies, Module Import Declarations: With 19 JEPs targeted so far, JDK 24 is set for release in March 2025, featuring a robust set of updates aimed at performance, security, and language flexibility.The US government wants developers to stop using C and C++: While CISA mandates roadmaps for migration by 2026, widespread adoption is unlikely in the near future due to resistance, cost, and existing industry priorities.GitHub Copilot chat now provides guidance on rewording prompts: The updated chat suggests more specific prompts when a query lacks context, available in Visual Studio 2022 17.12 Preview 3 and aboveCloudflare Advocates for Broader Adoption of security.txt Standard for Vulnerability Reporting: Cloudflare has introduced a dashboard to create and manage security.txt files for vulnerability reporting, aligning with the RFC9116.🎓Tutorials and Learning Resources💡Python💡20 Python scripts to automate common daily tasks:Lists scripts for tasks such as sending emails, scraping news, downloading stock prices, backing up files, posting to social media, fetching weather updates, and resizing images.For more Python resources, go to PythonProC# and .NET🎓Tutorial | Pushed Authorization Requests (PAR) in ASP.NET Core 9: Explains how the new support for PAR enhances security in OAuth and OpenID Connect by moving sensitive data to secure back-channel requests.💡You Probably Don’t Need Those Interfaces: Challenges the common practice of using interfaces for every dependency, arguing that interfaces may be unnecessary for unit testing (due to modern mocking frameworks).🎓Tutorial | Implementing the Repository Pattern with Multiple Databases in C# Clean Architecture: Demonstrates using separate DbContext instances for different data types and a RepositoryFactory .C and C++🗞️A new chapter, and thoughts on a pivotal year for C++: Herb Sutter, the ISO C++ committee chair, has joined Citadel Securities, where he will lead C++ training and strategy while continuing his C++ standards work.🎓Tutorial | Around the World in C++: Exploring Time Zones with std::chrono: Explores time zone handling using C++20’s <chrono> library, demonstrating how to identify unusual time zones with non-hour UTC offsets.🧾The Design of a Self-Compiling C Transpiler Targeting POSIX Shell: Presents pnut, a C-to-POSIX shell transpiler designed to counteract software supply chain risks by enabling reproducible builds without relying on precompiled binaries.Java📖Open Access Book | Modern Java by Ethan McCue: Provides a structured introduction to Java, covering basics like data types, control flow, and methods, then progressing to complex topics such as classes and data structures.🎓Tutorial | How to Handle Errors Cleanly in Java: Principles for Scalable, Maintainable Code: Covers using custom exceptions, avoiding generic catch-all blocks, leveraging checked exceptions, and utilizing Optional to handle nulls.🎓Tutorial | Creating GenAI Apps in Java with SD4J (Stable Diffusion for Java) and the ONNX Runtime — Part 1: Details the setup of prerequisites such as JDK, ONNX Runtime, and Hugging Face tools, followed by step-by-step instructions to generate custom images from text prompts.JavaScript and TypeScript🎓Tutorial | JavaScript's ??= Operator: Default Values Made Simple: Explains the operator'sfunctionality, benefits over previous methods, and practical use cases for retaining meaningful falsy values.🎓Tutorial | Generating Random Mazes with JavaScript: Walks you through building a random maze generator in JavaScript using a three-step process with tips on handling blocked paths and using helper functions to manage grid cells.🎓Tutorial | Exploring Effect in TypeScript: Simplifying Async and Error Handling: Showcases how Effect can replace multiple libraries like Zod and Lodash, improving code readability and robustness in complex applications.Go🎓Tutorial | Functional programming in Go: Focuses on using functions as the primary control structures, enabling operations likemap,filter, andreduceto simplify and streamline data processing tasks.🎓Tutorial | ML in Go with a Python sidecar: Explores using ML in Go applications, focusing on techniques to integrate Python-based ML models, from cloud-based APIs to local sidecar servers.Rust💼Case Study | Why I love Rust for tokenising and parsing: Covers the author’s development experience using Rust to buildsqleibniz , a static analysis tool for SQLite, focusing on Rust’s macro system, testing frameworks, and more.🎓Tutorial | How to rewrite a C++ codebase successfully: Provides a structured guide for incrementally rewriting a legacy C++ codebase in Rust, focusing on real-world challenges such as cross-platform compatibility.Swift🎓Tutorial | Migrating to Swift 6: Provides a comprehensive framework for migration, including strategies for enabling concurrency checking, resolving common compiler errors, and incrementally adopting concurrency features.💡Problematic Swift Concurrency Patterns: Highlights common pitfalls and patterns to avoid when using Swift’s concurrency features, addressing issues like split isolation, excessive reliance on Task.detached , and more.PHP💡New error messages in PHP 8.4: Key updates include stricter handling of nullable parameters, limitations on unsetting hooked properties, and clearer messaging on invalid operations.SQL🎓Tutorial | 8 Steps in Writing Analytical SQL Queries: Steps covered include defining goals in plain language, inspecting and confirming basic data, incrementally adding joins without calculations, and using CTEs for summations.Ruby🎓Tutorial | Optimize Database Performance in Ruby on Rails and ActiveRecord: Covers best practices in ActiveRecord query optimization, indexing, reducing N+1 queries, batching, and caching techniques.💼Case Study | How we made a Ruby method 200x faster: Details how the team at Campsite identified and resolved a specific performance issue in their codebase, providing insights into their debugging process.Kotlin🎓Tutorial | Modeling ViewModel State in Android: A Guide to Clean, Scalable Patterns: Critiques using plain data classes with multiple Boolean flags, as this approach can lead to conflicting states and increased boilerplate.🌟Best Practices and Advice🚀Efficient Resource Management with Small Language Models (SLMs) in Edge Computing: Covers model optimization, latency reduction, and memory efficiency to support AI capabilities on limited hardware.Netflix’s Distributed Counter Abstraction: Delves into Netflix's Distributed Counter Abstraction, a system that enables high-throughput, low-latency counting within distributed applications.Top 50 System Design Terminologies You Must Know: Outlines essential system design terms covering key concepts like scalability, microservices, CAP theorem, sharding, and more.📖Open Access Book | Architectural Metapatterns by Denys Poltorak: Delves into over a hundred architectural patterns and structures, such as monoliths, layers, services, proxies, orchestrators, and more.🧠Expert Insight📚Here’s an excerpt from “Chapter 4: Domain Decomposition" in the book, The Art of Micro Frontends - Second EditionbyFlorian Rappl, published in October 2024.Principles of DDDThe idea of DDD was first popularized by Eric Evans. In his book, he describes the basic pillars that form DDD, according to his vision. While the book certainly has a lot of truth to it, the entire army of ideas was probably rarely—if ever—realized in real-world projects. Let’s try to distill the most importantideas for our use inmicro frontends.When we refer to DDD in the context of micro frontends, we will not include parts such as value objects or the need for a ubiquitous language. Instead, we almost exclusively take DDD as a blueprint to help us with the followingtwo things:Defining micro frontends withclear boundariesComing up with a strategy to establishthese boundariesWhile DDD uses the wordmodules, which was back then an alias forpackages, we will refer to this unit as amicro frontend. The other thing that DDD introduces is a so-called bounded context. Finally, DDD defines a context map to make sense of it. But let’s back off and look at eacharea separately.ModulesAmoduleserves as a container for a specific set of functionalities in your application. For a web application, this could relate to a full page or parts of a page. For instance, a module dealing with the order process could be responsible for showing a cart symbol on the pages of a web shop, such as the product catalog orproduct details.As mentioned, a module in DDD is usually what we will bring to the table in the form of a micro frontend. Nevertheless, keeping to a general notation here makes sense; after all, this helps us to see that good architectures rarely have anything to do with specific implementations but actually would work in multiple variants. In micro frontends, the functionality will be mostly designedaround components.A module is, however, a part of the full problem domain, focused on a specific area (or subdomain). The general design principles for modules are low coupling and high cohesion. As such, a micro frontend should represent a single unit to solve one problem without relying on any other microfrontend directly.In reality, we will be tempted to rely on other micro frontends to simplify the code. The one strong advice here is to avoid doing that, as the immediate simplification will usually backfire in a more complicated and less flexible solution later. When we start looking at the different architectural patterns later inChapter 7onward, we’ll see how to decouple themicro frontends.To help us figure out what could be part of a module, DDD introduces the theoretical concept of abounded context.Bounded contextAbounded contextis used to define the boundaries of the functionality of a subdomain. This is an area where only the functionality from a certain domainmakes sense.While this may initially seem similar to a module, it is actually quite different. Multiple modules live within the same bounded context. The bounded context is an umbrella connecting them and has nothing to do withruntime considerations.Bounded contexts are also broader than modules as they contain both unrelated concepts and shared concepts. Naturally, this will result in some overlap and duplication between differentbounded contexts.The following diagram illustrates the relationship of two bounded contexts within an exampleproblem domain:Figure 4.1 – Relation of two bounded contexts in an example problem domainHow we split a bounded context into modules is up to us. In the end, however, a more critical question is,what are the bounded contexts in our problem domain?There is no blueprint here, but a nice way to visualize and think about contexts generally is in the form of acontext map.Context mapAcontext mapis a useful tool to illustrate the involved contexts of a system, including their connections. Instead of reusing objects from other contexts, a transformation defined by the context map should be used to always createdomain-specific objects.For our design decisions, a context map can be helpful to see where sharing occurs and how to still produce isolated micro frontends. To do this, we need to first identify these self-contained domains. This is where two principal ways come into play: strategic domain design and—as an alternative—tactical design. Let’s lookat both.Strategic domain design versus tactical designWhile strategic domain design helps us to extend knowledge of a problem domain and come up with useful guidelines, tactical design tries to come up with design patterns and building blocks that form a system. In other words, strategic domain design identifies the different domains and the communication between them, while tactical design is all about structuringthese domains.In our micro frontend space, we have the choice of leaving the tactical design to the implementers of the micro frontends, giving them some guidance, or predefining a structure that needs to be followed already. We will see later on how these architectural boundaries can actuallybe decided.In contrast, strategic domain design is helpful for decomposing a full problem domain into smaller (sub) domains. Starting with a full problem domain, we derive the individual subdomains and extract their bounded contexts. The relationship between the contexts is then captured in a context map. The following diagram shows thistheoretical process:Figure 4.2 – The idealized process of deriving a full domain decomposition from a given problem domain, including a working context mapThe Art of Micro Frontends - Second Edition was published in October 2024. Packt library subscribers can continue reading the entire book for free or you can buy the bookhere!Get the eBook for $29.99$20.98🛠️Useful Tools⚒️Aide: An open-source, AI-native IDE that proactively supports developers with context-aware code edits, error fixes, and easy rollbacks.Arch: An open-source prompt gateway that helps build scalable, secure AI apps with prompt safeguards, API triggers, and built-in monitoring.Sulie: An open-source platform for advanced time series forecasting with the Mimosa foundation model, offering zero-shot and fine-tuned predictions.That’s all for today.We have an entire range of newsletters with focused content for tech pros. Subscribe to the ones you find the most usefulhere.If your company is interested in reaching an audience of developers, software engineers, and tech decision makers, you may want toadvertise with us.If you have any suggestions or feedback, or would like us to find you a learning resource on a particular subject, take the surveyor just respond to this email!*{box-sizing:border-box}body{margin:0;padding:0}a[x-apple-data-detectors]{color:inherit!important;text-decoration:inherit!important}#MessageViewBody a{color:inherit;text-decoration:none}p{line-height:inherit}.desktop_hide,.desktop_hide table{mso-hide:all;display:none;max-height:0;overflow:hidden}.image_block img+div{display:none}sub,sup{font-size:75%;line-height:0}#converted-body .list_block ol,#converted-body .list_block ul,.body [class~=x_list_block] ol,.body [class~=x_list_block] ul,u+.body .list_block ol,u+.body .list_block ul{padding-left:20px} @media (max-width: 100%;display:block}.mobile_hide{min-height:0;max-height:0;max-width: 100%;overflow:hidden;font-size:0}.desktop_hide,.desktop_hide table{display:table!important;max-height:none!important}}
Read more
  • 0
  • 0
  • 7279

Divya Anne Selvaraj
11 Nov 2024
Save for later

Microsoft Tools for Cybersecurity and App Development: 4 Essential Guides

Divya Anne Selvaraj
11 Nov 2024
Curated for cybersecurity pros, app developers, and DevOps expertsMaster Microsoft’s Best-Kept Secrets in Cybersecurity, DevOps, and App DevelopmentHi ,Whether you’re fortifying cybersecurity, streamlining app management, customizing ERP workflows, or building responsive apps, mastering Microsoft’s ecosystem is crucial. This week, we bring you four new guides that transform Microsoft’s complexity into clear, actionable skills across security, Power Platform, Dynamics 365, and Power Apps—all now at 30% off.Bundle up & save more!Buy 2 eBooks – save an additional 10%Buy 3 eBooks – save an additional 15%Buy 5 eBooks – save an additional 20%Here’s what’s on offer:Microsoft Cybersecurity Architect Exam Ref SC-100 - Second Edition by Abu Zobayer, Graham Gold, and Dwayne NatwickA high-demand certification book for IT pros focused on advancing their cybersecurity skills and passing the SC-100 exam.>Prepare for the SC-100 exam with in-depth coverage, mock tests, and practical examples.>Master zero-trust architecture, encryption standards, and threat intelligence.>Elevate your security expertise by optimizing operations with SIEM and SOAR.Get the eBook for $39.99$27.98Get the Print book for $49.99Microsoft Power Apps Cookbook - Third Edition by Eickhel MendozaAppeals broadly to app developers, IT pros, and non-developers looking to build custom business solutions in a low-code environment.>Create apps with AI-powered Copilot, custom UI components, and advanced automation.>Accelerate development using ready-made recipes for Power Apps.>Expand app functionality with Dataverse, RPA, and Power Pages integration.Get the eBook for $39.99$27.98Get the Print book for $49.99Application Lifecycle Management on Microsoft Power Platform byBenedikt BergmannA valuable resource for developers and DevOps specialists managing app deployments on the Power Platform.>Automate builds and deployments with Azure DevOps and GitHub Actions.>Implement a robust ALM strategy tailored to Power Platform solutions.>Streamline environment management across Power Apps, Power Automate, and Power Virtual Agents.Get the eBook for $35.99$24.99Get the Print book for $44.99Programming Microsoft Dynamics 365 Business Central - Seventh Edition byChristopher D. Studebaker, Natalie Karolak, Marije Brummel, and David StudebakerIdeal for ERP consultants and developers focused on customizing and extending Business Central for complex business needs.>Customize Business Central workflows using AL language and Visual Studio Code.>Integrate external systems with Business Central using API web services.>Optimize business solutions with best practices for scalability and reliability.Get the eBook for$35.99 $24.99Get the Print book for $44.99*{box-sizing:border-box}body{margin:0;padding:0}a[x-apple-data-detectors]{color:inherit!important;text-decoration:inherit!important}#MessageViewBody a{color:inherit;text-decoration:none}p{line-height:inherit}.desktop_hide,.desktop_hide table{mso-hide:all;display:none;max-height:0;overflow:hidden}.image_block img+div{display:none}sub,sup{font-size:75%;line-height:0}#converted-body .list_block ol,#converted-body .list_block ul,.body [class~=x_list_block] ol,.body [class~=x_list_block] ul,u+.body .list_block ol,u+.body .list_block ul{padding-left:20px} @media (max-width: 100%;display:block}.mobile_hide{min-height:0;max-height:0;max-width: 100%;overflow:hidden;font-size:0}.desktop_hide,.desktop_hide table{display:table!important;max-height:none!important}}
Read more
  • 0
  • 0
  • 3871
Divya Anne Selvaraj
07 Nov 2024
Save for later

ProgrammingPro #81: Debugging Linux Scripts, Tabnine's Code Review Agent, and Zed Editor's SSH Remoting

Divya Anne Selvaraj
07 Nov 2024
Bite-sized actionable content, practical tutorials, and resources for programmers#81Debugging Linux Scripts, Tabnine's Code Review Agent, and Zed Editor's SSH RemotingHi ,Welcome to this week’s edition of ProgrammingPro!In today’sExpert Insight, we bring you an excerpt from the recently published book, The Ultimate Linux Shell Scripting Guide, which explains how to use -u and set -u in shell scripts to identify uninitialized variables and prevent related errors during debugging.News Highlights:Zed editor adds SSH remoting for faster remote workflows; IBM’s AI agents automate GitHub issue resolution; Java’s JEP 491 boosts concurrency with virtual thread improvements; and Tabnine’s Code Review Agent enforces custom coding standards.My top 5 picks from today’s learning resources:Hidden Python Libraries That Will Blow Your Mind✨The magic of keeping one level of abstraction per function🎩Writing secure Go code🐹Being a Responsible Developer in the Age of AI Hype⚖️Using certifications to level up your development career🏆But there’s more, so dive right in.Stay Awesome!Divya Anne SelvarajEditor-in-Chief🚀Join this 3-hour AI Workshop (worth $399) - FREE for ProgrammingPro readers to learn AI strategies & hacks to 10X work output and grow your business.🗓️ Tomorrow | ⏱️ 10 AM ESTClick here to register (FREE for the First 100 people only)!Sign Up|Advertise🗞️News and Analysis🔎Rust-based Zed editor preview adds direct SSH remoting, a key feature for potential VS Code switchers: Zed emphasizes speed, performance, and real-time collaboration, appealing to developers seeking a faster, lighter alternative.Tabnine’s new Code Review Agent validates code based on a dev team’s unique best practices and standards: The agent is an AI tool that validates code, flags issues during code reviews, and offers fixes.IBM releases open AI agents for resolving GitHub issues: IBM’s SWE-Agent 1.0, a set of AI-powered open agents, automates GitHub issue resolution, helping developers by localizing, suggesting fixes, and executing tests.Java Evolves to Tackle Virtual Threads Pinning with JEP 491: The change would improve scalability and performance in highly concurrent applications by allowing threads to unmount from platform threads during synchronization.Apache Tomcat 11.0 Delivers Support for Virtual Threads and Jakarta EE 11: The update enhances concurrency, scalability, and security for modern web applications, with upgrades in WebSocket and Servlet performance.Microsoft Introduces Modern Web App Pattern for .NET: Accelerating App Modernization to the Cloud: The pattern guides developers in transforming monolithic applications to cloud-native architectures with a focus on scalability.Amazon Q Developer is not just for coding and not just for AWS, claims cloud giant:It includes features like multi-file edits, unit testing, and security scanning, and plans to add support for Eclipse IDE.🎓Tutorials and Learning Resources💡PythonHidden Python Libraries That Will Blow Your Mind:Introduces six powerful yet lesser-known Python libraries including Streamlit for quick app-building, PyWhatKit for task automation, and Typer for simplified CLIs.For more Python resources, go to PythonProC# and .NET🎓Tutorial | Unlocking the Power of GitHub Models in .NET with Semantic Kernel: Explains how to set up necessary packages, configure access with GitHub tokens, establish a Semantic Kernel client, and run a chat-based application.🎓Tutorial | eShop infused with AI – a comprehensive intelligent app sample: Demonstrates how to integrate AI functionalities like semantic search, summarization, classification, and sentiment analysis into business applications.🎓Tutorial | How to prevent XSS Attacks in ASP.NET Core Web API: Covers essential practices such as input validation, output encoding, and advanced measures like Content Security Policy (CSP) and secure cookies.C and C++🎓Tutorial | Deep Threads Diving Into The Core Of Concurrent Programming With C: Covers core concepts like threads vs. processes, key functions in POSIX threads (pthreads), and synchronization techniques.📖Open Access Book | Is Parallel Programming Hard, And, If So, What Can You Do About It?: Serves as a guide for programming shared-memory parallel systems, offering foundational techniques to prevent common pitfalls.C++, Complexity, and Compiler Bugs: Explores challenges such as temporary lifetime extension, differences in designated initializers between C++ and C, and inconsistent handling of template disambiguation across compilers.JavaJava-Based No-Code and Low-Code Application Bootstrapping Tools: Reviews four Java-based no-code and low-code platforms: Appsmith, Wavemaker, Openkoda, and JHipster.🎓Tutorial | Building thread-safe abstractions in Java versus Go: Through examples, the author compares Java's synchronized keyword for mutual exclusion with Go’s sync.Mutex and channels, showcasing adaptations needed.🎓Tutorial | Server-Side Rendering with Spring Boot: Explains how to use WebJars for managing client-side dependencies via Maven and Thymeleaf for server-side rendering in Spring Boot.JavaScript and TypeScript🎓Tutorial | The magic of keeping one level of abstraction per function: Advocates for breaking down complex tasks into focused, smaller functions, to achieve cleaner code that is easier to update, reuse, and understand.Summary of the AJAX frameworks comparison: Compares Vue.js, Alpine.js, HTMX, and Vaadin—across frontend skills required, team integration, setup ease, and styling flexibility.20 TypeScript Tips for Cleaner, More Efficient Code in 2024: Tips include NonNullable, Partial, Readonly, Mapped Types, Union Exhaustiveness, and Generics, with practical examples demonstrating each.Go🎓Tutorial | Writing secure Go code: Covers tools like go vet, staticcheck, golangci-lint, govulncheck, and gosec which support code analysis and vulnerability detection, and fuzz testing which helps find security flaws.🎓Tutorial | Ranging over functions in Go 1.23: Introduces Go 1.23’s new feature allowing for-range iteration over functions, enhancing custom container iteration without exposing internal data structures.RustRust's Most Subtle Syntax: Explores how Rust’s pattern-matching rules with constants can introduce subtle bugs, especially if naming conventions aren’t followed consistently.Bringing faster exceptions to Rust: Explores speeding up Rust’s panic handling by optimizing the unwinding mechanism, resulting in a 4.3x speed improvement without changing the Rust compiler or system unwinder.Swift🎓Tutorial | swift-format GitHub Action: Covers setting up swift-format as a GitHub Action to automate linting and formatting for Swift projects, including configuration tips and integration with Xcode 16.🎓Tutorial | How to Use URLSession with Async/Await for Network Requests in Swift: Covers GET and POST methods, adding parameters, and decoding JSON responses into Swift structs.PHP🎥🎓Tutorial | Laravel for Beginners:This video series offers a step-by-step introduction to Laravel, covering essentials like setting up, routing, views, Blade directives, layouts, components, and CSS integration with Tailwind.SQL🎓Tutorial | Advanced SQL for Data Professionals: Covers common table expressions (CTEs) for recursive queries, methods to remove duplicates, ways to identify new records, strategies for filling gaps in data, and more.Ruby🎓Tutorial | Understanding Ruby 3.3 Concurrency: A Comprehensive Guide: Covers Threads, Fibers, and Ractors, explaining each's distinct use cases, performance trade-offs, and resource utilization.Kotlin🎓Tutorial | Serializing SQL: Building Serializable Data Classes in Kotlin: Describes building a system in Kotlin to serialize SQL queries into data classes using JSON, enabling dynamic SQL functions like SUM, and COUNT.🌟Best Practices and Advice🚀Cell-Based Architecture Adoption Guidelines: Outlines guidelines for adopting cell-based architecture, a strategy that enhances system resilience by isolating failures, ideal for high-availability systems.Being a Responsible Developer in the Age of AI Hype: Discusses recognizing that AI models like LLMs generate plausible text rather than true reasoning, questioning claims of AI’s capabilities, and addressing biases and ethical risks.A deep look into our new massive multitenant architecture: Explores the the architectural overhaul undertaken by Glauber Costa's team at Turso, focusing on adopting Deterministic Simulation Testing (DST).Using certifications to level up your development career: Explains how obtaining relevant, vendor-neutral certifications can boost developers' careers by validating their skills, improving job prospects, and potentially increasing pay.🧠Expert Insight📚Here’s an excerpt from “Chapter 21: Debugging Shell Scripts" in the book, The Ultimate Linux Shell Scripting Guide byDonald A. Tevault, published in October 2024.Checking for Undefined VariablesAs I said at the beginning of this chapter, in theUnderstanding Common Scripting Errors section, it’s sometimes desirable to define a variable in a script without assigning an initial value to it. But, sometimes it isn’t. You can track down uninitialized variables by appending a -uto the end of your shebang line.In bashfor example, you can use#!/bin/bash -u, which will turn this feature on for the entire script. Or, you can place aset -u command any place in the script where you’d like to start checking. For example, let’s look at the unassigned_var1.sh script, which has variable checking turned off:#!/bin/bashecho "The uninitialized myvar, without setting -u, looks like this : " $myvarechomyvar=Donnieecho "I've just initialized myvar."echo "The value of myvar is: " $myvarHere’s the output:donnie@fedora:~$ ./unassigned_var1.shThe uninitialized myvar, without setting -u, looks like this :I've just initialized myvar.The value of myvar is: Donniedonnie@fedora:~$As you see, without the-usetting, the script runs to completion. It’s just that trying to echo the value of the uninitializedmyvarjust shows us a blank space. Next, let’s turn on variable checking by adding the-u option, as you see in the unassigned_var2.sh script:#!/bin/bash -uecho "The uninitialized myvar, without setting -u, looks like this : " $myvarechomyvar=Donnieecho "I've just initialized myvar."echo "The value of myvar is: " $myvarLet’s see what this does:donnie@fedora:~$ ./unassigned_var2.sh./unassigned_var2.sh: line 2: myvar: unbound variabledonnie@fedora:~$This time the script failed as soon as it saw the uninitialized variable.You can set the-uoption anywhere in the script you like, by usingset -u, as you see here in theunassigned_var3.shscript:#!/bin/bashecho "The uninitialized myvar, without setting -u, looks like this : " $myvarechoecho "I'm now setting -u."set -umyvar=Donnieecho "I've just initialized myvar."echo "The value of myvar is: " $myvarechoecho "Let's now try another uninitialized variable."echo "Here's the uninitialized " $myvar2So now, I have one uninitialized variable at the top, on line 2. (Let’s just say that for whatever reason, I want this particular variable to be uninitialized.) I then turn on variable checking on line 5. Let’s see how this runs:donnie@fedora:~$ ./unassigned_var3.shThe uninitialized myvar, without setting -u, looks like this :I'm now setting -u.I've just initialized myvar.The value of myvar is: DonnieLet's now try another uninitialized variable../unassigned_var3.sh: line 11: myvar2: unbound variabledonnie@fedora:~$Before I turn on variable checking, the uninitializedmyvarjust shows us a blank space. After I turn on variable checking, I initializedmyvarwith a value ofDonnie, and it prints out normally. But, the uninitializedmyvar2at the end crashes the script.NOTE:If you search the web for shell scripting security tutorials, you’ll find several that tell you to make either -uorset -ua permanent part of your scripts. The authors of these tutorials say that it enhances the security of your scripts, without giving any convincing explanation of why or how. Using-uorset -uis great for debugging, but it should only be used for just that—debugging! So, when you’re through debugging your scripts, be sure to remove the-uor theset -ubefore you place the script into production. Otherwise, your scripts could give you some rather unpredictable results.Also, be aware that using-ucan also help you detect typos in your scripts. For example, if you define a variable asmynum=1, but accidentally call back the value with$mymum, the-uwill detect thatmymumis an unset variable.The Ultimate Linux Shell Scripting Guidewas published in October 2024. Packt library subscribers can continue reading the entire book for free or you can buy the bookhere!Get the eBook for $43.99$29.99🛠️Useful Tools⚒️PipelineDP4j: Google’s open-source JVM library for differential privacy in Java, Kotlin, and Scala, supporting Apache Beam.Whirlwind: A high-performance, asynchronous sharded HashMap in Rust for thread-safe, concurrent data access.Modus: An open-source, serverless framework for fast APIs and AI functions using WebAssembly, with support for AssemblyScript and Go.That’s all for today.We have an entire range of newsletters with focused content for tech pros. Subscribe to the ones you find the most usefulhere.If your company is interested in reaching an audience of developers, software engineers, and tech decision makers, you may want toadvertise with us.*{box-sizing:border-box}body{margin:0;padding:0}a[x-apple-data-detectors]{color:inherit!important;text-decoration:inherit!important}#MessageViewBody a{color:inherit;text-decoration:none}p{line-height:inherit}.desktop_hide,.desktop_hide table{mso-hide:all;display:none;max-height:0;overflow:hidden}.image_block img+div{display:none}sub,sup{font-size:75%;line-height:0}#converted-body .list_block ol,#converted-body .list_block ul,.body [class~=x_list_block] ol,.body [class~=x_list_block] ul,u+.body .list_block ol,u+.body .list_block ul{padding-left:20px} @media (max-width: 100%;display:block}.mobile_hide{min-height:0;max-height:0;max-width: 100%;overflow:hidden;font-size:0}.desktop_hide,.desktop_hide table{display:table!important;max-height:none!important}}
Read more
  • 0
  • 0
  • 5565

Divya Anne Selvaraj
04 Nov 2024
Save for later

Master Python for AI, Forecasting, and Data Engineering

Divya Anne Selvaraj
04 Nov 2024
Curated for data scientists, AI engineers, and Python developersMaster Python for AI, Forecasting, and Data EngineeringHi ,This week, we’ve handpicked five essential titles, all newly published in October 2024, to advance your Python skills across AI, data science, and machine learning. From time series forecasting and pandas data manipulation to mastering Apache Airflow workflows, building large language models, and creating AI applications with OpenAI APIs, these books are designed for practical, real-world application—each now at upto 30% off.Bundle up & save more!Buy 2 eBooks – save an additional 10%Buy 3 eBooks – save an additional 15%Buy 5 eBooks – save an additional 20%Here’s what’s on offer:Modern Time Series Forecasting with Python - Second Edition by Manu Joseph and Jeffrey TackesIndustry-ready machine learning and deep learning time series analysis with PyTorch and pandas>Apply cutting-edge ML and deep learning models to boost forecasting accuracy.>Explore probabilistic forecasting methods for handling real-world uncertainties.>Master techniques for deploying robust time series models with PyTorch and pandas.Get the eBook for $46.99$31.99Get the Print book for $57.99Pandas Cookbook - Third Edition byWilliam Ayd and Matthew HarrisonPractical recipes for scientific computing, time series, and exploratory data analysis using Python>Unlock practical recipes for data manipulation, time series analysis, and data exploration.>Master the latest in pandas 2.x for streamlined data workflows.>Solve real-world data challenges with clear, structured solutions and advanced techniques.Get the eBook for $39.99$27.98Get the Print book for $49.99Apache Airflow Best Practices byDylan Intorf, Dylan Storey, and Kendrick van DoornA practical guide to orchestrating data workflow with Apache Airflow>Build resilient data workflows and pipelines using real-world Apache Airflow use cases.>Optimize workflow orchestration to scale data operations effectively.>Implement best practices for Airflow 2.x, from DAG authoring to cloud deployment.Get the eBook for $35.99$24.99Get the Print book for $44.99LLM Engineer's Handbook byPaul Iusztin, Maxime Labonne, Julien Chaumond, and Hamza TahirMaster the art of engineering large language models from concept to production>Learn how to design, deploy, and optimize LLMs for production use.>Implement data pipelines, fine-tune models, and manage deployment with MLOps techniques.>Master advanced LLM operations, including preference alignment and inference optimization.Get the eBook for$47.99Get the Print book for $59.99 $53.98Building AI Applications with OpenAI APIs - Second Edition byMartin YanevLeverage ChatGPT, Whisper, and DALL-E APIs to build 10 innovative AI projects>Develop AI-powered projects with ChatGPT, Whisper, and DALL-E APIs across 10 innovative projects.>Integrate AI seamlessly into web and desktop applications, from NLP to speech recognition.>Monetize your creations by adding payment systems and using fine-tuning for specific applications.Get the eBook for $31.99$21.99Get the Print book for $39.99*{box-sizing:border-box}body{margin:0;padding:0}a[x-apple-data-detectors]{color:inherit!important;text-decoration:inherit!important}#MessageViewBody a{color:inherit;text-decoration:none}p{line-height:inherit}.desktop_hide,.desktop_hide table{mso-hide:all;display:none;max-height:0;overflow:hidden}.image_block img+div{display:none}sub,sup{font-size:75%;line-height:0}#converted-body .list_block ol,#converted-body .list_block ul,.body [class~=x_list_block] ol,.body [class~=x_list_block] ul,u+.body .list_block ol,u+.body .list_block ul{padding-left:20px} @media (max-width: 100%;display:block}.mobile_hide{min-height:0;max-height:0;max-width: 100%;overflow:hidden;font-size:0}.desktop_hide,.desktop_hide table{display:table!important;max-height:none!important}}
Read more
  • 0
  • 0
  • 5190
Success Subscribed successfully to !
You’ll receive email updates to every time we publish our newsletters.