ProgrammingPro #20: Java 21 preview, Rails 7.0.7, AI documentation bot, and beyond React
Bite-sized actionable content, practical tutorials, and resources for programmers.
Hi,
The art of programming is the art of organizing complexity, of mastering multitude and avoiding its bastard chaos as effectively as possible.
Edsger W. Dijkstra - Notes on Structured Programming (1970)
Welcome to this week’s issue of our programmer focused newsletter with fresh news you can use, insights, tools, and guides, from around the web to help you in your art of organizing complexity.
In this issue, we bring you a sneak peek into Java 21's upcoming features including Project Amber's record patterns, virtual threads, and more. Also, is it time to look beyond React for frontend development? Rails 7.0.7 and Redis 7.2 launched last week and we can hope for shinier gems and faster Redis applications. Supavisor for Supabase projects promises to do away with the too many connections problem with Postgres. There is also a new playground in town: LiveCodes, compatible with 80+ languages.
We have found a handy guide if you have been wondering about which testing strategy to use. And Knip has got your back if you are tired of dealing with unused files, exports, and dependencies in your projects.
Our tutorials this time round take you through using Python Polars, the memory-efficient DataFrame library. Also, how would one go about building an AI enabled chatbot for complex documentation navigation? Transitioning from Django to NestJS and missing automated testing?
Find out all this and more.
Our promise with this newsletter is to help you navigate and keep up-to-date with what's happening in the world of programming and software development. Feel free to check out our older issues as well. What did you think of today's newsletter? Please consider taking the short survey below to share your thoughts and you will get a free PDF of the Python Workshop eBook upon completion.
Stay awesome!
Divya Anne Selvaraj
Editor-in-Chief
Tell Us What You Think, Get a Packt eBook!
⚡ TechWave: News and Analysis
Java 21 sneak peek: Get ready for the upcoming Java 21 release, set to launch on September 19, 2023. With 15 JEPs(Java Enhancement Proposals) to explore, this version promises some exciting features. Highlights include Project Amber's record patterns and pattern matching for switch, as well as groundbreaking virtual threads. Also, expect user-friendly sequenced collections and long-awaited features like string templates, unnamed patterns, and unnamed variables, all available in preview mode. If you're eager to try it out, you can experiment with Java 21early-access builds using the jshell tool.
Rails 7.0.7 has been released: The official launch announcement highlights changes in various gems like Action Cable, Action Mailbox, and more.
Redis 7.2 sets new experience standards across Redis products: The new release addresses increasing demands for faster applications, real-time inferencing, and AI adoption. The release provides capabilities for LLMs and generative AI, enhances search capabilities, aids in building LLM-powered applications, introduces server-side Triggers and Functions for real-time data manipulation, and improves geospatial features and sorted set performance.
ReductStore 1.6.0 has been released with new license and client SDK for Rust: Featuring a new Business Source License (BUSL-1.1), the new version
allows free usage for development, research, and testing. The release also introduces a Rust Client SDK, enabling asynchronous integration of the database into Rust applications. HTTP API 1.6 adds a DELETE endpoint for removing entries from a bucket and a limit parameter for querying a maximum number of records. Python, C++, and JavaScript SDKs have also been updated to align with the latest API.
Supavisor: Scaling Postgres to 1 Million Connections: A cloud-native Postgres connection pooler developed in Elixir, capable of handling millions of connections, has been rolled out for Supabase projects and can enhance scalability and performance in Postgres applications. It addresses the connection limitations of Postgres and offers features like query caching, read-replica load balancing, and query blocking. Benchmarks tested Supavisor's scaling capabilities, with a single instance handling 250,000 concurrent connections and 20,000 queries per second with positive results.
Introducing LiveCodes: This feature-rich client-side playground supports over 80 languages and frameworks, setting itself apart with its extensive language support, client-side processing, and focus on developer tools. Unlike traditional social coding platforms, LiveCodes is a backendless developer tool, making it ideal for embedding in documentation and educational websites. It's free, open-source, and available for self-hosting under the MIT license.
Forward Compatibility and Toolchain Management in Go 1.21: The new version enhances forward compatibility by enforcing the go line ingo.mod as a rule, ensuring code isn't miscompiled with newer Go versions. Older code that may work with newer versions but shouldn't be compiled can now be explicitly marked with go lines in go.mod. Additionally, toolchain management is introduced, allowing different modules to use different Go toolchains.
Announcing .NET 8 Preview 7: .If you haven’t heard of this yet, Preview 7 is out and brings System.Text.Json and codegen changes before release candidates which are due to launch during the .NET Conf2023 in November. While the preview is incompatible with C# Dev Kit momentarily, ASP.NET Core, .NET MAUI, and Visual Studio 2022 17.7 updates have been made available.
📚 Secret Knowledge: Learning Resources
Things you forgot (or never knew) because of React: Collinworth, in this insightful article says, “Developer experience (DX) shouldn’t ever supersede user experience (UX).” And this should be enough to give reading this a go, especially if React is something you have been into for a while or if you have been exploring your frontend development options.
Writing CSS In 2023: Is It Any Different Than A Few Years Ago?: The fast-paced evolution of CSS continues to reshape the way we code, but with varying degrees of adoption. Container queries are a game-changer, allowing scoping child elements to a parent container's size and the new color function syntax has simplified color value definitions. Despite the exciting advancements, practical application of some features in production remains limited.
Why Tailwind CSS Won: Tailwind CSS leaves behind an entire generation of sites built using Twitter Bootstrap and changes the game. Here is a to the point post that explains its popularity.
Pyramid or Crab? Find a testing strategy that fits: Here is a handy comparison of strategies like the Test Pyramid, Test Diamond, and even newer adaptations like the Test Diamond, Honeycomb, and Trophy. The main takeaway: choose a strategy that aligns with your project's architecture, requirements, and most importantly, user needs.
How to manage Python projects with Pipenv: Struggling with managing Python projects? Pipenv offers a streamlined solution by combining virtual environments and package management, ensuring proper versions and dependencies. It simplifies development, generates dependency lists, and facilitates project replication.
Knip: An Automated Tool For Finding Unused Files, Exports, and Dependencies: As projects grow, finding these artifacts becomes challenging, impacting maintainability. Knip scans your projects, locating unused components. Unlike existing tools, Knip handles monorepos and offers extensive support for JavaScript and TypeScript.
🔍 HackerHub: Tools & Launches
deserve: An asynchronous and lightweight nano framework for serving ML model, which supports easy serialization and deserialization of various content types like JSON, text, image, and audio for handling Python objects and returning results.
git-appraise: A distributed code review system that stores reviews in Git repositories, enabling developers to have their review history within the repository and facilitating collaboration without relying on external servers.
outlines: A neural text generation library that provides flexible control over outputs, including regex-guided and JSON schema-guided generation, enhancing reliability and integration with various models for better-controlled language generation tasks.
retake: An AI-powered document search and analysis tool. By directly connecting to Postgres, Retake handles indexing, embedding, and syncing data changes, to provide low-code SDKs for Python and TypeScript applications, and ensures rapid query results with cached semantic vectors.
infisical: An open-source, end-to-end encrypted secret management platform designed to centralize and secure secrets like API keys and credentials. It offers a user-friendly dashboard, client SDKs for fetching secrets, CLI for local development, integrations with platforms like GitHub, and more.
dpv: Open-source Python library designed to streamline data processing and validation tasks, enabling developers to easily handle common data manipulation challenges, such as cleaning, transforming, and validating data.
briefcase: Open-source tool that allows developers to convert Python projects into standalone native applications. Briefcase supports various platforms, including macOS, Windows, Linux, iOS, and Android.
rubocop: Open-source Ruby static code analyzer and code formatter that identifies violations of a defined set of coding conventions and can automatically correct many of the issues it detects.
pyecharts: Open-source Python library that provides a seamless interface to ECharts. Leveraging the capabilities of ECharts, Pyecharts allows developers to create visually appealing and interactive charts and graphs. directly within their Python environment.
✨ Tutorials and Guides
Python Polars: A Lightning-Fast DataFrame Library: In the realm of data analysis, Python has been the preferred choice, backed by libraries like NumPy, pandas, PySpark, and Dask. A newcomer, Polars, is making waves with its high-speed DataFrame capabilities, catering to memory-intensive tasks. This guide covers the reasons behind Polars' efficiency, DataFrame manipulation, the innovative lazy API, integration with Python's ecosystem, and prerequisites for diving in.
Create a Langchain alternative from scratch using OceanBase: Wouldn’t it be nice to have an AI enabled chatbot that makes navigating and understanding complex documentation a breeze? Here is a comprehensive step-by-step guide to building a document chatbot leveraging OceanBase's own vectors in lieu of Langchain. The guide takes you through the model’s training, storage, and retrieval process. The project built using Node.js and Express.js, using Sequelize and OpenAI's API, is available on GitHub for you to get creative with.
How to Store Images in SQLite with PHP: Use this comprehensive tutorial to create an API with PHP's Mezzio framework which uploads, deletes, and manages images. Learn to utilize Imagick for image data extraction and SQLite for simplicity. Discover the process of building afunctional image management system.
How to send Emails with a CC and BCC using Node.js and Twilio SendGrid: Need to build a Node.js app that needs a programmatic emailing feature? Here is a tutorial that will help you set this up to send emails with CC and BCC using Node.js and Twilio SendGrid. Learn how to save the API key as an environment variable. Install the SendGrid helper library and write code to send emails.
Async Lazy In C# – With Great Power Comes Great Responsibility: Looking to sharpen your C# skills? Discover async lazy initialization in C# with Nick Cosentino's balanced walkthrough. He introduces Lazy<T> for deferred object creation, and then dives into using Lazy<Task<T>> for asynchronous initialization to boost responsiveness and startup speed.
Level Up Your NestJS Testing by Automating Test Database Creation: Transitioning from Django to NestJS can be a challenge, especially when it comes to test database setup. This guide offers a solution. Leveraging the typeorm-extension library, the author demonstrates how to establish a test database for NestJS. By creating and dropping databases, synchronizing configurations, and applying migrations, the approach emulates Django's automated testing behavior.
📢 If your company is interested in reaching an audience of developers, software engineers, and tech decision makers, you may want to advertise with us.
If you have any comments or feedback, just respond to this email!
Kind Regards,
Divya