ProgrammingPro #65: API Design Mastery with Postman, Unifying Codebases with PythonMonkey, and Harnessing Java Virtual Threads
Bite-sized actionable content, practical tutorials, and resources for programmers.
Welcome to this week’s edition of ProgrammingPro!
In today’s Expert Insight, we bring you an excerpt from the recently published book,
API Testing and Development with Postman - Second Edition, which discusses how to design intuitive and efficient APIs that balance user needs with system simplicity.
News Highlights: PythonMonkey unifies Python and JavaScript/Wasm codebases; Google’s Genkit boosts AI development in Go; Atlassian survey highlights developer-manager productivity gaps; and Facebook prefers Mercurial over Git and Subversion for complex codebases.
My top 5 picks from today’s learning resources:
Comparing C/C++ unity build with regular build on a large codebase📏
Post-Architecture - Premature Abstraction Is the Root of All Evil🚧
But there’s more, so dive right in.
Stay Awesome!
Divya Anne Selvaraj
Editor-in-Chief
PS: This month’s survey is still open! Do take the oppotunity to give us your feedback on ProgrammingPro, request specific learning resources, and get your one Packt Credit for the month.
🗞️News and Analysis🔎
Python Meets JavaScript, Wasm With the Magic of PythonMonkey: This tool reduces code maintenance by allowing a single codebase for NodeJS and Python projects. Read to learn about the capabilities and advantages of PythonMonkey.
Microsoft moves forward with C# 13, offering overload resolution: Microsoft plans to finalize C# 13 alongside .NET 9 in November. Read to learn about a new locking mechanism with System.Threading.Lock in .NET 9.
Google’s Genkit for Go brings AI app development to Go language: The open-source framework for Go combines Go’s performance attributes with advanced AI libraries. Read to learn how it enables the creation of complex AI applications.
OpenJDK plan calls for restricting JNI usage: This initiative introduces warnings in the Foreign Function & Memory (FFM) API and aligns the use of JNI and FFM. Read to learn how the proposal adds safeguards to bolster application integrity.
Boomi takes aim at zombie APIs with control plane: The tool includes a cataloging system that governs API lifecycles and integrates AI-powered tools to design and automate integration processes. Read to learn how the tool works.
Devs say many of their hours are wasted, disagree with managers on how to fix the issue: An Atlassian-sponsored survey reveals a significant misalignment between developers and engineering leaders. Read to learn about the disparities.
Why Facebook does not use Git – and why most other devs do: Facebook transitioned from Subversion and Git to Mercurial. Read to learn why and how these decisions align with the demands of managing a large, complex codebase.
🎓Tutorials and Learning Resources💡
Python
Querying 1TB on a laptop with Python dataframes: Details the process and results of benchmarking Python dataframe libraries like DuckDB on a MacBook Pro. Read for insights into handling extensive data on relatively standard hardware.
Embedded Python - MicroPython is amazing: Celebrates MicroPython's 11th anniversary, detailing its versatility and impact in embedded systems. Read to learn about the practical applications and significant advantages of using MicroPython.
For more Python resources go to PythonPro
C# and .NET
🎓Tutorial | Implementing a native function detour in C#: Details creating a DLL that handles the detour setup and removal, providing full source code examples. Read to learn how to implement native function hooks in C#.
🎓Tutorial | Understanding the Singleton Pattern in C# and Unity: Covers the pattern's usefulness for managing shared resources and coordinating system-wide actions. Read for specific implementation examples for C# and Unity environments.
🎓Tutorial | ASP.NET8 using DataTables.net — Part1 — Foundation: Provides a guide on integrating the jQuery DataTables.net component into an ASP.NET 8 MVC app. Read to understand the component's utility for handling tables with AJAX.
C and C++
C++ Must Become Safer: Argues that the legacy and prevalence of C++ code make it essential to focus on enhancing its safety without complete rewrites. Read to learn about related ongoing efforts and discussions within the tech community.
C++ design patterns for low-latency applications: Reviews a a study highlighting optimizations such as prewarming CPU caches, using constexpr, and more. Read to gain insight into advanced C++ programming techniques.
💼Case Study | Comparing C/C++ unity build with regular build on a large codebase: Evaluates performance using the open-source project Inkscape as a case study. Read to learn about the efficiency gains possible with unity builds in large C/C++ projects.
Java
💼Case Study | Java Virtual Threads: Delves into the performance of Java Virtual Threads in comparison with Open Liberty's existing thread pool. Read to learn about its potential and limitations in real-world applications.
🎓Tutorial | TreeMap in Java - A Must-Know Data Structure: Delves into a Red-Black tree-based implementation of the NavigableMap interface, part of the Java Collections Framework. Read to learn how it provides efficient data management.
🎓Tutiorial | Structured Concurrency is More Than ShutdownOnFailure: Introduces EnhancedTaskScope and ListTaskScope from the Virtually project. Read to learn how these scopes optimize task execution in parallel programming.
JavaScript and TypeScript
🎓Tutorial | Frequently sought solutions for JavaScript: Addresses topics such as array manipulation, DOM interaction, asynchronous programming, and more, with examples. Read to learn effective JavaScript techniques and best practices.
Master Article on Scientific Computation in JavaScript: Details Javascript’s application across fields such as ML, fluid dynamics, equation solving, and robotics. Read to learn how JavaScript can facilitate complex analyses and visualizations.
A TypeScripter's Take on Zig: Highlights Zig's advantages in low-level programming and suggests how TypeScript could benefit from similar concepts. Read to learn about the unique strengths and potential improvements.
Go
Introducing Quartz - A Deterministic Time Testing Library for Go: Introduces a new Go library for deterministic time testing, aimed at reducing test flakiness. Read to l learn how Quartz can simplify the testing process.
🎓Tutorial | Go range iterators demystified: Explores the new capabilities of Go 1.23 which allow custom collection types to utilize the 'range' keyword for iteration. Read to learn how to implement and use these new range iterators.
Rust
🎓Tutorial | Safety off - Programming in Rust with unsafe: Explores the use of unsafe code in Rust, highlighting its necessity for bypassing some of Rust's stringent safety rules. Read to learn about its specific applications and limitations.
📖Open Access Course| Introduction to Numerical Computations in Rust: Guides those with basic C knowledge through high-performance computing in Rust. Read to deepen your understanding of high-performance computing.
Swift
🎥An interview with the creator Of LLVM, Clang, Swift, and Mojo: Highlights Chris Lattner’s approach to balancing innovation with practicality. Watch for insighst into value semantics, simplicity, and the practicalities of modern architecture.
🎓Tutorial | Swift Switch And If Expressions: Swift 5.9 allows using if and switch statements as expressions, enabling you to return values or assign them to variables directly. Read to learn how to use switch expressions.
PHP
🎓Tutorial | New without parentheses in PHP 8.4: This change simplifies code by eliminating the need for wrapping new object instantiations in parentheses. Read to learn how this new feature streamlines object instantiation and method chaining.
SQL
🎓Tutorial | Structured Query Language for the Web - Schema: Introduces a JavaScript database class and a JSON-based SQL variant called json-fetch. Read to learn how to create and manage SQL database schemas using JSON.
Ruby
Ruby methods are colorless: Explores how Ruby methods do not differentiate between synchronous and asynchronous calls, a concept known as "colorless" methods. Read to learn about the benefits of colorless programming.
Kotlin
🎓Tutorial | Which Map Transformation Should I Use?: Explains functions like map(), mapNotNull(), mapIndexed(), mapIndexedNotNull(), mapKeys(), mapValues(), and mapTo(). Read to learn how to use these functions.
🌟Best Practices and Advice🚀
Are You Done Yet? Mastering Long-Running Processes in Modern Architectures: Emphasizes strategies for managing processes that require waiting due to human actions or other factors.
Evaluating the ROI of AI implementation: Emphasizes understanding the problem AI aims to solve, using proxy metrics like time saved or user interactions with AI, and iterating based on metrics performance to improve AI applications.
Post-Architecture - Premature Abstraction Is the Root of All Evil: Promotes using procedural and functional programming techniques to maintain simplicity and reduce unnecessary complexity.
Document It - Architecture Decision Log: Proposes creating an Architecture Decision Log (ADL) close to the codebase, where each decision is documented in a structured format.
Take the Survey, Get a Packt Credit!
🧠 Expert Insight 📚
Here’s an excerpt from “Chapter 2: API Documentation and Design” in the book, API Testing and Development with Postman - Second Edition, by Dave Westerveld, published in June 2024.
Creating usable APIs
Usability is about the balance between exposing too many controls and too few. This is a very tricky thing to get right. On the extremes, it is obvious when things are out of balance. For example, the Metropolitan Museum of Art has an API that
gives you information about various art objects in their possession. If all the API did was provide one call that gave you back all that data, it would be providing too few controls. You would need to do so much work after getting the information that you might as well not use the API at all. However, if, on the other hand, the API gave you a separate endpoint for every piece of metadata in the system, you would have trouble finding the endpoint that gave you the particular information you wanted. You would need to comprehend too much in order to use the system.
You need to think carefully about this if you want to get the balance right. Make sure your API is providing users with specific enough data for the things they need (this is where knowing the purpose comes in handy) without overwhelming them. In other words, keep it as simple as possible.
Usable API structure
One thing that can help create a usable API is to use only nouns as endpoints. If you want users to be able to understand your API, structure it according to the objects in your system. For example, if you want to let API users get information about the students in a learning system, don’t create an endpoint called /getAllStudents. Create one called /students and call it with the GET method. One of the reasons for doing this has to do with creating new students. If your endpoint is called /students, you can easily call it with a POST method to create a new student. However, if you had named it /getAllStudents, it would feel very unnatural to call that with a method to create new items. You can think about it in terms of saying it out loud. Saying “I want to create a new student object” sounds natural, but saying “I want to create a get all student object” does not.
Creating endpoints based on nouns will also help you more naturally structure your data. For example, if you have /students as an endpoint, you can easily add an endpoint for each student at /students/{studentId}. This kind of categorization structure is another helpful API design principle to keep in mind.
Creating a structure like this maps the layout of the API to the kinds of things that the API user needs information about. This makes it much easier to know where to find the relevant information.
A structure like this works nicely, but does it really match up with how users will interact with the API? If I am looking for information about a student, am I going to know what their ID is in the API? Perhaps, but more likely I will know something like their name. So, should we modify the structure to have an additional endpoint like /students/name? But what if we are looking at all the students of a certain age? Should we add another endpoint, /students/age? You can see where I am going with this. It can get messy quickly.
This is where query parameters are helpful. A query parameter is a way of getting some subset of the category based on a property that it has. So, in the examples that I gave earlier, instead of making “name” and “age” endpoints under the “students” category, we could just create query parameters. We would call /students?name='JimJones' or /students?age=25. Query parameters help keep the endpoints simple and logical but still give the users the flexibility to get the information they are interested in effectively.
Good error messages
A usable API helps the users when they make mistakes. This means that you give them the correct HTTP codes when responding to a call. If the request is badly formatted, the API should return a 400 error code. I won’t list all the HTTP codes here as they are easily searchable online, but ensuring that your API is returning codes that make sense for the kind of response you are getting is an important quality consideration.
In addition to the HTTP codes, some APIs may return messages that let you know what possible steps you can take to correct this issue. This can be very helpful, although you will want to be careful that you don’t reveal too much information to those who might be bad actors.
API Testing and Development with Postman - Second Edition was published in June 2024. Packt library subscribers can continue reading the entire book for free or you can buy the book here!
🛠️ Useful Tools ⚒️
GraphRAG: a Microsoft open-source project that builds knowledge graphs from datasets to improve generative AI accuracy by incorporating specific organizational data into responses.
dropbase: a platform that helps developers quickly build and prototype web apps with AI, combining drag-and-drop simplicity with code flexibility for easy customization and learning from AI-generated code.
git-credential-manager: a secure, cross-platform Git credential helper built on .NET that supports multi-factor authentication and integrates with major source control platforms like GitHub, GitLab, Bitbucket, and Azure DevOps.
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. Complete ProgrammingPro archives can be found here. Complete PythonPro archives are 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.
If you have any comments or feedback, take the survey, or leave a comment below.




