Bite-sized actionable content, practical tutorials, and resources for programmers#76:Python 3.13 RC 3, Django’s MVT Architecture, and PostgreSQL 17 Performance EnhancementsIntroducing A Market-Changing Approach to Mobile App Protection by GuardsquareMobile applications face constant, evolving threats; to address these challenges, Guardsquare is proud to announce the launch of our innovative guided configuration approach to mobile app protection.By combining the highest level of protection with unparalleled ease of use, we empower developers and security professionals to secure their applications against even the most sophisticated threats.Guardsquare is setting a new standard for mobile app protection and we invite you to join us on this journey to experience the peace of mind that comes with knowing your mobile applications are protected by the most advanced and user-friendly product on the market.Learn MoreHi ,Welcome to this week’s edition of ProgrammingPro!In today’sExpert Insight, we bring you an excerpt from the recently published book, Django 5 for the Impatient - Second Edition, which introduces Django's MVT architecture, briefly outlining how Models, Views, and Templates work together to build a scalable web application.News Highlights:Python 3.13.0 RC 3 introduces features like free-threaded mode and JIT; PostgreSQL 17 enhances performance, storage, and JSON support; OpenAI reveals Realtime API, prompt caching, and AI updates; and MongoDB 8.0 boosts read throughput, time series handling, and sharding efficiency.My top 5 picks from today’s learning resources:Python 3.13: Cool New Features for You to Try✨Lesser known tricks, quirks, and features of C🕵️♂️Comparative Study of Java Native, Platform, and Virtual Threads🧵Planning, Automation and Monorepo: How Monzo Does Code Migrations across 2800 Microservices🚀021 - the tortoise and the hare - building faster with low level programming🐢🐇But there’s more, so dive right in.Stay Awesome!Divya Anne SelvarajEditor-in-ChiefPS:The October survey is now live. Do take the opportunity to leave us your feedback, request a learning resource, and earn your one Packt credit for this month.BOOK NOW AT $399.99 $239.99Use code LASTCHANCE40 at checkoutSign Up|Advertise🗞️News and Analysis🔎Python 3.13.0 release candidate 3 released: It includes new features like a free-threaded build mode, an improved interpreter, experimental JIT, and typing enhancements. The final release is now scheduled for October 7, 2024.JRuby 10 due to arrive in early-2025: The Ruby implementation for the JVM, is set to release in early 2025 and will support Ruby 3.4.0, Rails 7.1+, and require Java 17 or 21 to leverage modern JVM features.Java News Roundup: Proposed Schedule for JDK 24, SecurityManager Disabled, Commonhaus Foundation: Also covers JEP 475 (G1 garbage collector changes), updates in Spring Framework, and more.PostgreSQL 17 adds performance gains, storage optimizations and more: The version also introduces expanded JSON support, including SQL/JSON standards for data manipulation.OpenAI announces Realtime API, prompt caching, and more at DevDay: Vision fine-tuning, model distillation, and the company's recent $6.6 billion funding round were also discussed.MongoDB 8.0 offers significant performance improvements to read throughput, bulk writes, and more: It also offers improved handling of time series data, more efficient sharding, and control over query performance.The SQLite team is preparing an efficient remote replication tool: The tool uses ssh for secure data transfer, optimizes bandwidth by only transmitting changed data pages, and targets scenarios needing read-heavy access.🎓Tutorials and Learning Resources💡PythonPython 3.13: Cool New Features for You to Try: Releasing finally on October 7th, Python 3.13 introduces several improvements, including an enhanced REPL, clearer error messages, and progress on removing the GIL.For more Python resources, go to PythonProC# and .NETWhich .NET ORM - Dapper or Entity Framework?: Helps you decidewhen to choose Dapper or EF based on project size, database requirements, and adaptability.🎓Tutorial | Embracing DRY Principle to Streamline Test Automation: Contrasts tests with and without DRY, demonstrating how reusable utility functions and base classes enhance code efficiency and readability.🎓Tutorial | Dotnet Source Generators in 2024 Part 1 - Getting Started: Introduces .NET source generators, focusing on their purpose, types, and usage, particularly for code generation and reducing boilerplate in C# projects.C and C++Lesser known tricks, quirks and features of C: Covers topics ranging from advanced array manipulation and memory usage to uncommon syntactic constructs and obscure type qualifiers.It is never too late to write your own C/C++ command-line utilities: Discusses how a custom C++ command-line utility greatly outperformed a Python script in querying JSON files, improving performance tenfold.std::initializer_list in C++ 2/2 - Caveats and Improvements: Explores the issues and limitations of std::initializer_list in C++, and suggests alternatives like variadic factory functions to reduce copies and improve efficiency.Java🎓Tutorial | How to use generics in your Java programs: Demonstrates generics with collections, type safety benefits, examples of generic classes, and discusses raw types versus generics.Class File API - Not Your Everyday Java API: Introduces the Class-File API, a modern Java library for bytecode manipulation, aimed primarily at framework, tooling, and advanced Java developers.Comparative Study of Java Native, Platform and Virtual Threads: Highlights how virtual threads introduced by Project Loom improve performance and resource management.JavaScript and TypeScriptA guide to destructuring in JavaScript: covers binding patterns, default values, rest properties, and the spread operator for working with complex data structures.Strict mode: Outlines how to invoke strict mode, its restrictions on syntax and behavior, and the advantages over "sloppy mode."📖Open Access Book | The Concise TypeScript Book: Provides a clear and comprehensive overview of TypeScript, covering its type system, advanced features, and latest language updates.GoSome Go web dev notes: Discusses recent learnings from developing a website in Go, covering improved routing in Go 1.22, SQL query handling using sqlc , performance tips for SQLite, and memory management enhancements.CPU Throttling for containerized Go applications explained: Covers Kubernetes CPU limits, Go's concurrency model, how CPU quotas are enforced, and strategies to mitigate throttling, including configuring GOMAXPROCS.RustCode Generation in Rust vs C++26: Explores Rust’s derive procedural macro for code generation and how the upcoming C++26 reflection feature, with introspection and annotation capabilities, offers an equally powerful approach.Should you use Rust in LLM based tools for performance?: Discusses why Rust was chosen for building Swiftide, a text-processing toolchain, and its performance compared to Python's Langchain.SwiftURLSession in Swift: The Essential Guide [with Examples]: Explains the use of URLSession for network requests, handling protocols like HTTP and FTP, and parsing JSON data.Using the #expect macro for Swift Testing: Discusses the #expect macro in Swift Testing, Apple's new framework for writing tests which replaces various XCTest assertions, simplifying debugging.PHPLaravel 11.26 Released: The version introduces features like graceful stopping of process pools, using Enums for rate limiting, an Artisan command to create job middleware, and enhanced factory annotations for model factories.SQLTroubleshooting SQL queries with omni_id: Discusses how by creating new types for primary keys (e.g., user_id, product_id), omni_id helps identify issues, such as incorrect column comparisons, and enhances query accuracy.RubyBuilding a Vector Database in Ruby Using Hash and PStore: Shows how to build a vector database for semantic search and provides an overview of generating embeddings with OpenAI's API, and calculating cosine similarity.KotlinPushing the Boundaries of Compose Multiplatform with AGSL Shaders: Covers the anatomy of shaders, their use in Kotlin Multiplatform, and demonstrates applying effects like vignetting in the Photo-FX app.🌟Best Practices and Advice🚀How to Minimize Latency and Cost in Distributed Systems: Discusses optimizing distributed systems to reduce data transfer costs and latency through zone-aware routing.Planning, Automation and Monorepo: How Monzo Does Code Migrations across 2800 Microservices: Discusses how Monzo efficiently migrates services without downtime, enabling gradual rollouts and quick rollbacks.021 - the tortoise and the hare - building faster with low level programming: Argues that while initially slower, low-level programming offers full control and fewer trade-offs, potentially leading to more optimal results.Five Common Misconceptions About Event-Driven Architecture (EDA): Debunks 5 common misconceptions about EDA, highlighting its distinct characteristics, differences from related concepts, and benefits.🧠Expert Insight📚Here’s an excerpt from “Chapter 1: Installing Python and Django, and Introducing the Movies Store Application” in the book, Django 5 for the Impatient - Second Edition by Daniel Correa and Greg Lim, published in September 2024.Introducing the Django MVT architectureThere are various methodologies and approaches to design and code web applications. One approach involves consolidating all code into a single file toconstruct the entire web application.However, finding errors within such a file, often comprising thousands of lines of code, can be incredibly challenging. Alternatively, other strategies distribute code across different files and directories. Additionally, some approaches segment an application into multiple smaller applications dispersed across several servers, although managing the distribution of these servers presents its own set of challenges.Organizing your code effectively presents challenges. This is why developers and computer scientists have created software architectural patterns.Software architectural patternsoffer structural frameworks or layouts to address common software design issues. By leveraging these patterns, start-ups and inexperienced developers can avoid reinventing solutions for every new project. Various architectural patterns exist, includingModel-View-Controller(MVC),Model-View-Template(MVT), layers, service-oriented, and microservices. Each pattern comes with its own set of pros and cons. Many frameworks, such as Django, adhere to specific patterns in constructingtheir applications.In the case of Django, Django is based on the MVT pattern. This pattern is similar to MVC but with some differences in the responsibilities ofeach component:Models: The model represents the data structure. In Django, models are Python classes that define the structure of the data and how it interacts with the database. Models handle tasks such as querying a database, performingCRUD(Create, Read, Update, Delete) operations, and enforcing data validation. In the case of theMovies Storeapp,Movie,Review,Orderand the other classes from our class diagram will be coded asDjango models.Views: Views in Django are responsible for processing user requests and returning appropriate responses. Views typically receive HTTP requests from clients, fetch data from the database using models, and render templates to generate HTML responses. In Django, views are Python functions or classes that accept HTTP requests and return HTTP responses. In the case of theMovies Storeapp, we will create views and functions to handle the movies, accounts, and cart,among others.Templates: Templates are used to generate HTML dynamically. They contain the application’s user interface and define how data from the views should be displayed to the users. In the case of theMovies Storeapp, we will create a template to allow users to log in, a template to list movies, and a template to display the shopping cart,among others.The MVT pattern offers several benefits such as enhanced code separation, facilitated collaboration among multiple team members, simplified error identification, increased code reusability, and improved maintainability.Figure 1.11illustrates the software architecture of theMovies Store, which we will develop throughout this book. While it may seem overwhelming now, you will understand the intricacies of this architecture by the book’s conclusion. We will delve deeper into the architecture in thefinal chapters.Figure 1.11 – The Movies Store software architecture diagramLet’s briefly analyzethisarchitecture:Positioned on the left are the clients, which are the users of our application, who use browsers on mobile or desktop devices. These clients establish connections with the application via theHypertext Transfer Protocol(HTTP), providing users with a means to interact with ourweb application.On the right side, we have the server, which hosts ourapplication code.All client interactions first pass for a project-level URL file calledurls.py. This file is located in the main project folder calledmoviesstore/. URLs will be explored inChapter 2. This project folder also contains atemplates/folder in which we will design a reusable base template. Base templates will be explored inChapter 3.The project-level URL file passes the interaction to an app-level URL file. For this project, we will design and implement four Django apps –home,movies,cart, andaccounts. Django apps will be explored inChapter 2.Each app-level URL file passes the interaction to aviews.pyfile. Views will be explored inChapter 2.Views communicate with models, if required, and pass information to the templates, which are finally delivered to the clients as HTML, CSS, and JS code. Templates will be explored inChapter 2, and models will be explored inChapter 5.Django 5 for the Impatient - Second Edition was published in September 2024. Packt library subscribers can continue reading the entire book for free or you can buy the bookhere!Get the eBook for $27.99$18.99Get the Print book for $34.99 $23.99🛠️Useful Tools⚒️iceoryx2 v0.4.0: An IPC library for fast inter-process communication with decentralized architecture, modularity, and advanced QoS.dust-core: An Apache-licensed Java library for creating efficient, scalable actor-based systems using lightweight threading.Quadratic: A modern spreadsheet merging JavaScript, Python, SQL, and formulas for dynamic data analysis, API integration, and visualizations.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{line-height:0;font-size:75%}#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