ProgrammingPro #57: AI Enhancements in .NET, Kotlin 2.0 Multiformat Compiler, AI in DevOps, and GitLab’s CI/CD Innovations
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, DevOps Unleashed with Git and GitHub, which discusses how AI tools integrate with coding environments to offer contextually relevant suggestions and generate code from natural language.
News Highlights: Microsoft Build unveils AI innovations in .NET with an OpenAI .NET library; Kotlin 2.0 launches with a multiplatform K2 compiler; Windows development gets an AI upgrade with Copilot Runtime and native PyTorch; and GitLab 17 introduces GitLab Duo Enterprise and new CI/CD catalogue.
My top 5 picks from today’s learning resources:
But there’s more, so dive right in.
Stay Awesome!
Divya Anne Selvaraj
Editor-in-Chief
PS: Our monthly survey is still in progress. If you haven’t yet, we invite you to take the opportunity to tell us what you think about ProgrammingPro so far, request a learning resource for future issues, tell us what you think about a recent development in the Programming world, and earn a Packt Credit each month to buy a book of your choice.
🗞️News and Analysis🔎
.NET at Microsoft Build - AI innovations, cloud-native development improvements, and more: At the ongoing Microsoft Build, the company showcased updates in the .NET ecosystem, including AI innovations such as the introduction of an OpenAI .NET library. Read to learn more.
Celebrating Kotlin 2.0 - Fast, Smart, and Multiplatform: Kotlin 2.0 introduces the K2 compiler, designed for multiplatform support and faster code compilation, enhancing its robustness and smart code analysis features. Read to learn more.
C# 13 enhances params, introduces extension types: Set for release with .NET updates in November, C# 13 enhances the params parameter to support a wider range of collection types. Read for specific insights into the new functionalities.
Windows development revamped with Copilot Runtime, native PyTorch – and the surprising comeback of WPF: These significan updates for Windows development, highlight the integration of AI capabilities and modern hardware support. Read for more.
Parasoft offers new capabilities for API, microservices, and accessibility testing in latest release: Enhancements include AI-driven auto-parameterization for API testing, a unified test environment for microservices with improved code coverage metrics. Read to learn more about the advancements.
LaunchDarkly announces new features to enable smoother software releases: These include user experience updates, Release Assistant for pipeline management, Release Guardian for pre-production issue detection, and more. Read to learn about LaunchDarkly's latest tools.
GitLab 17 introduces GitLab Duo Enterprise and new CI/CD catalog: GitLab Duo Enterprise, an AI add-on for GitLab Ultimate customers, offers features for security issue detection, discussion summarization, and CI/CD bottleneck resolution. Read to learn more about the AI-driven software innovation.
JetBrains releases test automation IDE, Aqua: The IDE integrates features like code completion, refactoring, database management, an HTTP client, and Web Inspector, and is available in both commercial and free versions. Read for more.
More new features in Java 23: The latest enhancements include previews of structured concurrency, flexible constructor bodies, module import declarations, and more. Read for a more detailed sneak peek.
🎓Tutorials and Learning Resources💡
Python
The Hitchhiker’s Guide to Python!: This practical guide aimed at both novice and expert Python developers, offers best practices for Python installation, configuration, and daily usage. Read to enhance your programming skills.
Can LLMs find bugs in large codebases?: A new benchmark called Bug In The Code Stack (BICS) has been developed to evaluate how LLMs detect syntactic bugs in Python codebases. Read to learn about its limitations and strengths.
For more Python resources go to PythonPro
C# and .NET
General Availability of .NET Aspire - Simplifying .NET Cloud-Native Development: .NET Aspire integrates with Visual Studio 2022, the .NET CLI, and Visual Studio Code, offering tools, templates, and packages to simplify the development of distributed applications. Read to learn more.
🎓Tutorial | Serialising ASP.NET method calls for later execution: This article discusses a method which involves capturing the necessary components of a method call so it can be stored and later executed. Read to learn how to facilitate delayed operations or actions requiring preconditions.
🎓Tutorial | Lambda expressions and anonymous functions: Lambda expressions in C# can be converted into Action or Func delegate types based on their input parameters and return values. Read to learn how lambda expressions streamline code.
C and C++
Why Not Just Do Simple C++ RAII in C?: This article explores why C cannot simply adopt C++'s RAII (Resource Acquisition Is Initialization) system, detailing the syntactic and semantic challenges involved. Read to learn about the complexities of integrating RAII into C.
Pulling a single item from a C++ parameter pack by its index: The approach described utilizes std::tie and std::forward_as_tuple, and also discusses a C++26 proposal that simplifies this process. Read to learn how to maintain reference integrity.
Better “Goodput” Performance through C++ Exception Handling: This article discusses performance issues encountered in ScyllaDB when implementing per-partition query rate limiting. Read to learn about effective strategies for managing exceptions in C++.
Java
IBM previews watsonx Code Assistant for Enterprise Java Applications: The assistant offers advanced features like code generation, explanation, and test creation, leveraging IBM’s Granite LLMs. Read to learn about the AI-powered tool.
Comparing Java objects with equals() and hashcode(): The two methods are fundamental for comparing objects in Java. Read to learn about the relationship between equals() and hashcode() in Java.
🎓Tutorial | Dynamic Watermarking of Bitmaps in Databases: This tutorial introduces a technique using a programmable proxy, without altering the database or client applications. Read to learn how to implement the system.
JavaScript, TypeSpec, and TypeScript
A first look at progressive web apps (PWAs): These apps blend web and native app features, offering offline functionality, background syncing, and push notifications. Read to learn how PWAs utilize service workers to bridge the gap between web and native applications.
Designing and developing APIs with TypeSpec: The language builds on TypeScript and Bicep foundations to allow developers to efficiently define API operations and compile these into OpenAPI definitions. Read to learn how to use the language.
Functional TypeScript #1: Algebraic Data Types (ADTs): This article introduces ADTs, demonstrating how to model and serialize UI events like key presses, mouse clicks, and scrolls using TypeScript's type discrimination features. Read to learn how to model complex data structures effectively.
Go
So We Built A Reverse Tunnel In Go Over HTTP/3 And QUIC: This blog post discusses the development of Reverst, a reverse tunnel implementation created to enhance Flipt Hybrid Cloud's connectivity. Read to learn about the technical and practical benefits of using HTTP/3 and QUIC for building reverse tunnels.
Runtime code generation and execution in Go - Part 1: This blog post explores the concept of runtime code generation and execution in Go, distinct from JIT and AOT compilation, to avoid confusion. Read to gain an understanding of advanced runtime code generation techniques in Go.
Rust
👩🏫Open Access Course | 100 Exercises To Learn Rust: This course is designed to teach Rust from the ground up, and is aimed at programmers new to Rust but experienced in another language. Read to learn through practical exercises.
Async Rust Isn't Bad - You Are: This article critiques the prevalent use of asynchronous programming in Rust, suggesting that its widespread adoption is more a trend influenced by developer culture than a necessity. Read to evaluate whether your use of async is justified.
PHP
5 Useful Laravel Packages to Enhance Your Development: The packages discussed enhance development by simplifying database management, automating migrations, integrating Elasticsearch, and more. Read to improve your Laravel Development skills.
SQL
🎓Tutorial | How To Build Local LLM Apps With Ollama and SingleStore: This tutorial focuses on data privacy by creating an app that operating locally rather than on the cloud. Read to learn how to integrate local LLMs with database systems.
Ruby
Ruby steps toward frozen string literals: Ruby 3.4.0, now available in preview, introduces significant changes such as treating all string literals as frozen by default unless specified otherwise. Read for more more updates.
Swift
Build your next website in Swift: Swift's result builders enable the creation of domain-specific languages within Swift code, simplifying the development of websites entirely in Swift. Read to learn how to leverage Swift's result builders.
Kotlin
What's new in Kotlin 2.0.0: Key features include improved smart casts, enhanced multiplatform project handling, invoke dynamic lambda generation, and better JavaScript interoperability. Read for comprehensive insights into the most significant updates.
🌟Best Practices, Advice, and Case Studies🚀
10 more bad programming habits we secretly love: These habits include coding without comments, tolerating slow code, indulging in complex or outdated code, and embracing the freedom to break rules or optimize prematurely. Read to learn about the nuanced balance between following best practices and bending rules.
How to learn a programming language using AI: AI-powered coding assistants like Amazon Q Developer, GitHub Copilot, and JetBrains AI Assistant can significantly enhance the programming language learning process. Read to learn strategies to effectively use AI tools to accelerate learning new programming languages.
How Google Does Chaos Testing to Improve Spanner's Reliability: Google’s engineers enhance the reliability of the Spanner database by injecting faults into production-like instances to test the system's resilience against unexpected failures. Read to learn how the approach works.
Identifying and Correcting Programming Language Behavior Misconceptions: This paper presents a curated list of common misconceptions about mutable variables, scope, and higher-order functions, derived from student work. Read to discover an automated tutoring system to detect and correct these misconceptions.
Take the Survey, Get a Packt credit!
🧠 Expert Insight 📚
Here’s an excerpt from “Chapter 7: Accelerate Productivity with AI” in the book, DevOps Unleashed with Git and GitHub by Yuki Hattori.
Exploring the capabilities and interaction with AI in coding
This section is dedicated to providing developers with in-depth insights and strategies for effectively leveraging AI within their coding projects, focusing on its features and interaction dynamics. Whether
it involves integrating AI for routine coding tasks or utilizing it for the more intricate and imaginative facets of programming, this section intends to offer comprehensive guidance on making AI a transformative element in your coding practices.
Let’s explore the expansive capabilities of AI in coding and learn the best practices for interacting with AI tools, enhancing not only the productivity and quality of your projects but also your overall experience as a developer.
Code completion – The foundation of AI-powered coding
Unlike ChatGPT, which requires full context in the prompt for each interaction, code completion in programming environments is deeply integrated with the code editor. AI-powered coding tools dynamically collect necessary data from the code you are writing and seamlessly communicate with the backend LLM. This integration offers an experience akin to pair programming or mob programming with an AI collaborator.
The typical AI tool continuously analyzes the code within the editor, understanding the immediate context to offer relevant suggestions. This contextual awareness is key to the effectiveness of code completion. In AI tools, where context is important, the most important thing is how the context was collected from the editor. Sometimes, humans tend to focus on the accuracy of the model behind it. That is never a mistake; the smarter the AI, the better. However, as AI develops in the future, any tool will be able to perform certain tasks. What will stand out in that case is its excellence as a data collection tool. Therefore, in code completion, it is important to know how the AI-powered coding assistant tool collects information from the editor and to determine whether code completion should take this into account.
As developers type code, an AI-powered coding tool suggests potential code snippets that complete or extend the code. Typically, this functionality is not just about speeding up the typing process; it is about offering intelligent, contextually relevant suggestions that can improve code quality and efficiency.
Here is an example of code completion in action. Let’s create a file calc.js and write the following in JavaScript:
function calculateSum(a, b) {
// AI Suggestion Here}
For example, AI code-completion would complement the contents of a function as follows:
function calculateSum(a, b) {
const sum = a + b;
return sum;
}
The AI model behind code completion has been exposed to a vast array of code, but it is important to clarify that this exposure means it has been “trained on data” rather than having fundamentally “learned” in the traditional sense. Essentially, it has become adept at recognizing patterns unique to coding through the analysis of these extensive code repositories. By utilizing LLMs, the model can discern patterns, best practices, and common coding paradigms to generate suggestions. As a predictive engine for the next word or sequence in code, the quality of its suggestions is directly influenced by the quality of the input code. In essence, the output quality reflects the quality of the code data it was trained on, highlighting that its capability to provide relevant suggestions depends on recognizing patterns within the training data.
Code generation—the ability of AI-powered coding tools to interpret and respond to natural language—is remarkable. The breakthrough with AI is its capacity to understand natural language as it is presented, offering code suggestions based on that understanding rather than relying on static analysis, as with traditional non-AI code completion tools such as IntelliSense. Developers can detail the functionality, parameters, and expected outcomes of a code segment through comments, directing the AI to generate relevant code.
When we talk about “code generation,” it includes what was referred to in the previous section as code completion, but here we are discussing it in a broader sense, focusing on generating code from natural language and various types of information.
The effectiveness of this feature depends on the precision and clarity of the instructions provided. Well-defined and explicit comments empower AI-powered coding tools to produce more accurate and suitable code responses.
This is where the importance of your knowledge, experience, and approach to prompt crafting becomes evident. It is crucial to leverage your critical thinking and logical writing skills in a manner that the AI can comprehend.
For example, let’s create a JavaScript file named calc.js, as follows, and write the comments you want to implement:
// Function name: calculateAverage
// Function arguments: numbers (array)
// Return type of the function: number
If AI-powered tools can generate code, it will look like the following:
function calculateAverage(numbers: number[]): number {
// calculate the average of the array
const sum = numbers.reduce((a, b) => a + b);
return sum / numbers.length;
}
Providing examples within other sections of the code or in comments can be extremely helpful. Additionally, one of the strengths of AI-powered coding tools lies in their ability to generate code based on structured examples. This feature proves especially beneficial in situations such as developing models from given data examples.
For instance, consider the following comment:
# [{"id": "A1", "name": "Yoshi Yamashita"}]
Then, AI can produce the following model. The following example will output Python if you write Python in the file user.py, but similarly, if you write a specific language, such as user.js or user.rb, the same implementation would be carried out for a different language:
users = json.loads(json_data)
class User:
def __init__(self, id, name):
self.id = id
self.name = name
This indicates that the distance between the definition of the implementation and the implementation itself is getting very close.
When it comes to definitions, table definitions can be turned into SQL queries for database tables, cloud infrastructure definitions can be turned into YAML files for Terraform, and so on.
For example, from a given JSON example, it is possible to generate commands to create a model for Ruby on Rails.
Here is the given JSON example:
{
"name": "Yoshi Yamashita",
"age": 48,
"description": "Hello from Tokyo",
"country": "Japan",
"title": "Software Engineer",
"email": yoshiyamashita@example.com
}
All you have to do is provide the prompt “Generate a rails command to create a new user” for this example, and AI will create a ready-to-use command in CLI as follows:
rails g model User name:string age:integer description:text country:string title:string email:string
The code generation capability represents a significant advancement in AI-powered coding. By interpreting descriptive comments and structured examples, AI can generate accurate and functional code, reducing manual coding efforts and enhancing the efficiency of the development process.
Code explanation
AI has the capability to analyze existing code and automatically generate explanations that clarify the code’s functionality. This feature proves to be invaluable for understanding code that is not adequately documented or for demystifying complex algorithms for other developers. These generated explanations assist in simplifying complex code into more comprehensible segments, thereby facilitating a better understanding of the logic and intent behind the code for others.
Such a capability is instrumental in reducing the onboarding time for new team members, accelerating the comprehension of code for first-time viewers, and proving useful in scenarios where there is a noticeable gap between the specification and the actual code. Moreover, it enhances the value of the code by providing explanations for previously unmaintained or obscure code, thereby making its functionality clearer.
Here is an example of writing an algorithm in Python by creating a file, eratosthenes.py, and specifically considering generating explanations for the Sieve of the Eratosthenes algorithm, which was originally presented without explanation:
def eratosthenes_sieve(n):
primes = []
sieve = [True] * (n + 1)
for p in range(2, n + 1):
if sieve[p]:
primes.append(p)
for i in range(p * p, n + 1, p):
sieve[i] = False
return primes
If you write a comment at the beginning of a line, the AI will recognize that you write a comment on every new line, and the AI will automatically complete the rest by simply breaking the line. AI can generate the following comments:
# This is a function that calculates prime numbers less than n
def eratosthenes_sieve(n):
# Primes will hold all the prime numbers found
primes = []
# sieve is a list used to track prime numbers
sieve = [True] * (n + 1)
# loop through each number in the range 2 to n
for p in range(2, n + 1):
# If the number is marked as True in the sieve list
if sieve[p]:
# It is a prime number, so add it to the primes list
primes.append(p)
# Mark all multiples of this prime number as False
for i in range(p * p, n + 1, p):
sieve[i] = False
# return the list of prime numbers
return primes
In extreme cases, you do not need any specific prompt. Sometimes, all you have to do when you use GitHub Copilot is press Tab and Enter. However, if more formatting is done, it can go beyond explanation and have various possibilities, such as deriving documentation from code or reverse engineering table definitions from a database migration implementation, for example.
Code explanation by AI significantly elevates the overall quality of code by enhancing its readability and understandability. This feature plays a crucial role in narrowing the gap between intricate code and comprehensive documentation, offering an automated solution to make code accessible and intelligible to a broad spectrum of developers. By saving time and facilitating better code maintenance and collaboration, this capability highlights the transformative influence of AI in the coding process.
DevOps Unleashed with Git and GitHub by Yuki Hattori was published in April 2024. You can buy the book here! Packt library subscribers can continue reading the entire book for free here.
🛠️ Useful Tools ⚒️
Flow-IPC: an open-source Akamai project that enhances in-memory data transfers between applications, optimizing inter-process communication without sacrificing performance or design.
neosync: an open-source tool for Postgres and MySQL that anonymizes production data, generates synthetic data, and syncs it across environments to enhance testing and debugging, while maintaining referential integrity.
empirical: a tool for testing and evaluating LLMs and model configurations, enabling local testing, comparison of outputs via a web UI, and integration with CI/CD pipelines using a configuration file.
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 feedback, leave a comment below.



