ProgrammingPro #78: API-First Development Trends, Google’s New LLM Algorithm, and AI-Powered PHP
Welcome to this week’s edition of ProgrammingPro!
In today’s Expert Insight, we bring you an excerpt from the recently published book, Bare-Metal Embedded C Programming, which briefly compares UART, SPI, and I2C communication protocols in embedded systems.
News Highlights: Postman's 2024 survey shows 74% of developers adopting an API-first approach; Google unveils an LLM self-correction algorithm; StackBlitz's Bolt.new allows Node.js projects in the browser via AI prompts; and Google’s Code Assist Enterprise now trains on internal code with GitHub and GitLab.
My top 5 picks from today’s learning resources:
Unlocking AI Magic: 10 Ways to Supercharge Your PHP Apps with OpenAI✨
The imperative of artifact management in modern software development📦
Building a Global Caching System at Netflix: a Deep Dive into Global Replication🌍
But there’s more, so dive right in.
Stay Awesome!
Divya Anne Selvaraj
Editor-in-Chief
PS: The October survey 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.
🗞️News and Analysis🔎
Report: Developers are increasingly adopting an API-first approach: Postman’s 2024 survey reveals 74% of respondents adopted this method, citing faster production and recovery times.
Ephemeral IDs: Cloudflare's Latest Tool for Fraud Detection: Cloudflare's new fraud detection feature tracks client behavior instead of IP addresses to detect fraudulent activities.
Google Publishes LLM Self-Correction Algorithm Self-Correction via Reinforcement Learning (SCoRe): Google's new algorithm is designed to improve LLMs' ability to self-correct math and coding problems.
Ktor 3.0 switches to kotlinx.io library: The Kotlin-based framework for building asynchronous applications, now uses the multiplatform kotlinx.io library for handling data sources, improving byte transformation efficiency.
TypeScript 5.7 improves error reporting: The version, now in beta, improves error reporting by detecting never-initialized variables, addressing gaps in the type system's checks.
StackBlitz Bolt.new blurs boundaries between web development and skilled use of AI prompts: Bolt.new allows developers to create projects using Node.js directly in the browser, guided by precise AI prompts.
Google’s Code Assist Enterprise can be trained on internal source code, is focused on Google services: Announced at the Google Cloud Summit, Gemini Code Assist Enterprise, supports integrations with GitHub and GitLab.
🎓Tutorials and Learning Resources💡
Python
Python 3.12 vs Python 3.13 – performance testing: Tests on AMD Ryzen 7000 and Intel 13th-gen processors show Python 3.13 generally performs faster, especially in asynchronous tasks, but there are slowdowns in certain areas.
🎓Tutorial | Get started with the free-threaded build of Python 3.13: Introduces Python 3.13’s new "no-GIL" or free-threaded build, allowing true parallelism by removing the GIL for better concurrency.
For more Python resources, go to PythonPro
C# and .NET
Engineering the Scalable Vector Extension in .NET: Covers the new SVE APIs, code generation techniques, and challenges like register handling and context switches.
The Role of the Checked Keyword in Managing Overflow in C#: Covers how the
checked
keyword in C# helps manage arithmetic overflow and ensures reliable type conversions by throwing exceptions when overflow occurs.Func vs. Predicate vs. Expression in C# .Net: Helps you choose the correct delegate type for efficient method encapsulation, condition checking, and expression handling in C# programming.
C and C++
C++ String Conversion: Exploring std::from_chars in C++17 to C++26: Highlights how
std::from_chars
provides high-performance, low-level text-to-number conversions with features like non-throwing behavior, and more.Opaque Pointer Pattern in C++: Discusses the the pattern in C++ (also known as the Pimpl Idiom or Bridge Pattern), which helps hide implementation details from clients while maintaining a stable interface.
Self-referential variable initialization in C: Highlights that in C, variables are in scope as soon as they are declared, allowing code like
int x = x + 1;
despite the variable being uninitialized at that point, which leads to undefined behavior.
Java
🎓Tutorial | How to use Java generics to avoid ClassCastExceptions: Covers upper bounds, wildcard usage, generic methods, type inference, and type erasure, highlighting how generics prevent runtime exceptions.
🎥Continuations: The magic behind virtual threads in Java by Balkrishna Rawool: Explains how virtual threads differ from platform threads, and ithe continuation mechanism that pauses and resumes thread execution.
🎥Practical LLM Inference in Modern Java by Alfonso² Peterssen, Alina Yurenko: Discusses implementing a fast LLM inference engine in pure Java using GraalVM.
JavaScript and TypeScript
🎓Tutorial | Time duration in JS: Explains how JavaScript's Temporal API, specifically Temporal.Duration, handles time durations, offering a modern solution to complexities like leap years, time zones, and Daylight Saving Time.
The greatness and limitations of the js-framework-benchmark: Covers the benchmark's strengths in measuring JavaScript framework performance, and its limitations in areas like server-side rendering, hydration, and more.
🎓Tutorial | TypeScript for Functional Programmers: Introduces TypeScript's type system to functional programmers familiar with Haskell or ML, highlighting its unique features and differences.
Go
🎓Tutorial | Practical guide for building a blockchain from scratch in Go: Covers the foundational concepts and practical steps to build a blockchain from scratch in Go using gRPC.
Go's New Iterators Smell (A Little) Funny, but It's Probably OK: Discusses Go's new iterators, introduced in Go 1.23, and how they work, including potential issues with early loop exits causing panics.
Rust
💼Case Study | Challenges and Lessons Porting Code from C to Rust: Describes how engineers used c2rust to convert code step-by-step, addressing threading, memory safety, and performance optimizations.
🎓Tutorial | Improve an algorithm's performance step by step: Covers profiling techniques, memory optimization, SIMD use, and iterating over different performance-enhancing approaches, including Rust-specific features and tools.
Swift
Security-scoped bookmarks for URL access: Discusses how security-scoped bookmarks allow macOS apps to store and regain access to user-selected directories across sessions.
🎓Tutorial | Write Swift Like Apple: Emphasizes using clear, descriptive naming for variables, methods, and protocols, favoring Apple's own style over other coding standards.
PHP
🎓Tutorial | Unlocking AI Magic: 10 Ways to Supercharge Your PHP Apps with OpenAI: Provides a step-by-step guide to integrating OpenAI's API with PHP applications, explaining how to leverage AI-powered features.
SQL
💼Case Study | Uber Completes Major MySQL Fleet Upgrade, Boosting Performance and Security: Details Uber's successful MySQL upgrade from version 5.7 to 8.0, involving over 2,100 clusters and a side-by-side process.
Ruby
The Hidden Power of Symbols in Ruby: When to Use Symbols Instead of Strings: Highlights their efficiency as immutable identifiers, particularly for hash keys and method references.
Kotlin
🎓Tutorial | Testing Coroutines — Simplified: Details the setup for testing coroutine functions, including the use of
StandardTestDispatcher
to manage coroutine execution and ensure proper assertions.
🌟Best Practices and Advice🚀
The imperative of artifact management in modern software development: Highlights how artifact management platforms streamline development, enhance security, and automate dependency management.
Scaling Uber’s Batch Data Platform: a Journey to the Cloud with Data Mesh Principles: Details the migration which aims to enhance scalability, security, and operational efficiency while decentralizing data ownership.
How Cell-Based Architecture Enhances Modern Distributed Systems: Explores how cell-based architectures improve scalability, fault isolation, and resiliency in modern distributed systems.
Building a Global Caching System at Netflix: a Deep Dive into Global Replication: Explains how Netflix built a global caching system using EVCache to ensure data availability across multiple regions.
🧠Expert Insight📚
Here’s an excerpt from “Chapter 4: Crossing the Language Barrier with the Arrow C Data API” in the book, Bare-Metal Embedded C Programming, by Israel Gbati, published in September 2024.
Comparing UART, SPI, and I2C
Let’s start with UART.
UART
Here are some key features of UART:
Asynchronous communication: UART doesn’t require a clock signal. Instead, it uses start and stop bits to synchronize data transmission.
Full-duplex: UART can send and receive data simultaneously, which is ideal for many applications requiring real-time communication.
Simple and cost-effective: With minimal hardware requirements, UART is easy to implement and cost-effective.
The following are some of its advantages:
Ease of use: Setting up UART communication is straightforward, making it a popular choice for beginners and simple applications
Wide support: UART is universally supported by most microcontrollers and peripheral devices
Low overhead: The lack of a clock signal means fewer pins are used, reducing complexity
However, it also has some disadvantages:
Speed limitations: UART is generally slower compared to SPI and I2C, making it less suitable for high-speed data transfer
Limited distance: Susceptibility to noise over long distances can limit the range of reliable communication
Point-to-point only: UART is designed for direct, point-to-point communication, which can be a limitation if multiple devices need to communicate
Next, we have SPI.
SPI
Here are some key features of SPI:
Synchronous communication: SPI uses a clock signal along with data lines, ensuring synchronized data transfer
Full-duplex: It allows data to be sent and received simultaneously
Master-slave architecture: One master device controls multiple slave devices, with dedicated lines for each
The following are some of its advantages:
High speed: SPI supports high-speed data transfer, making it ideal for applications requiring fast communication
Versatility: SPI can connect multiple devices with different configurations, providing flexibility in design
However, it also has some disadvantages:
More pins required: Each slave device needs a separate select line, which can increase the pin count significantly
No standardized acknowledgment: Unlike I2C, SPI does not have a built-in acknowledgment mechanism, which can make error detection more challenging
Limited multi-master capability: SPI is not designed for multi-master systems, which can be a limitation in some scenarios
The final common communication protocol we’ll cover is I2C.
I2C
Here are some key features of I2C:
Synchronous communication: I2C uses a clock signal for synchronized data transfer
Multi-master capability: Multiple master devices can share the same bus, which is useful in more complex systems
Two-wire interface: I2C requires only two lines (SDA and SCL) for communication, minimizing the pin count
The following are some of its advantages:
Simplicity in wiring: The two-wire interface reduces the complexity and number of pins required
Multi-device support: I2C easily connects multiple devices on the same bus, each with a unique address
Built-in addressing: I2C has a built-in addressing mechanism, making communication with multiple devices straightforward
However, it does have some disadvantages:
Slower speed: I2C is generally slower than SPI, which can be a limitation for high-speed applications
Complex protocol: The protocol is more complex than UART and SPI, requiring more sophisticated handling of data transfers and addressing
Susceptible to noise: Like UART, I2C can be susceptible to noise over longer distances, potentially affecting communication reliability
Choosing the right communication protocol depends on your specific application needs. If you need simple, straightforward communication and can tolerate slower speeds, UART is a great choice. For high-speed applications with a need for full-duplex communication, SPI is ideal, especially if you can manage the higher pin count. When you need to connect multiple devices with minimal wiring and have a complex communication setup, I2C is your go-to protocol. To help you better understand when to choose which protocol, let’s explore some common use cases.
Bare-Metal Embedded C Programming was published in September 2024. 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⚒️
pan: A privacy-focused PHP analytics library for tracking events like impressions, hovers, and clicks in Laravel without collecting personal data.
Parsek: A modular back-end platform that boosts development efficiency with reusable plugins while optimizing speed and performance.
arch: A Layer 7 gateway for LLM applications that optimizes prompt handling, API interactions, and security.
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 useful here.
If your company is interested in reaching an audience of developers, software engineers, and tech decision makers, you may want to advertise with us.