ProgrammingPro #17: Custom Instructions in ChatGPT, Advanced Python Mastery, and Using Claude for Coding
Bite-sized actionable content, practical tutorials, and resources for programmers.
Hi,
“Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live”
- John Woods
Game programmer Woods minced no words emphasizing the significance of code readability. No one (except, perhaps, AI?!) likes mind-boggling complex programs that lack documentation. Tools like GitHub’s Copilot Chat Beta, now available for developers, can help craft powerful code that’ll be gladly used for years.
Welcome to yet another issue of our newsletter, which curates up-to-date developments in the field of Programming. In this edition, we’ll talk about ChatGPT introducing custom instructions to tailor AI to your needs, a new Stanford Study claiming ChatGPT's coding performance declining over time, and ChatGPT announcing pre-registrations for their Android app.
How about some handpicked resources, tutorials, and secret knowledge? Look out for the perils of shadow coding, mastering array creation with NumPy, thread-safe integers in Java, and explore the use of Claude as a Versatile AI coding assistant.
My promise with this newsletter is to act as your personal assistant and help you navigate and keep up-to-date with what's happening in the world of software development. 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.
Thanks for reading.
Kartikey Pandey, Vidhu Jain
Editor-in-Chiefs
Tell Us What You Think, Get a Packt eBook!
5 Days of Free Access
Visit our platform, browse, and get unlimited access to all 7,500+ titles!
⚡ TechWave: News and Analysis
ChatGPT Introduces Custom Instructions: OpenAI has introduced custom instructions for ChatGPT, allowing users to set preferences for the AI's responses. This feature, initially available to Plus plan users, will be expanded to all users in the coming weeks. Custom instructions enable users to specify their requirements for ChatGPT's responses, eliminating the need to repeat preferences in every conversation. Developers can now ask ChatGPT to write efficient code in a specific language.
Stanford Study Claims ChatGPT's Coding Performance Declines Over Time: A study conducted by researchers suggests that the performance of the LLM ChatGPT, particularly in coding, may be deteriorating over time. The study compared the March 2023 and June 2023 versions of GPT-3.5 and GPT-4 on four tasks: solving math problems, answering sensitive/dangerous questions, generating code, and visual reasoning. The results indicated a significant decline in code generation performance over the three-month period. However, OpenAI refutes these claims, stating that each new version is an improvement on the previous one.
GitHub Copilot Chat Beta Now Available for Developers: GitHub has launched a public beta version of GitHub Copilot Chat for all business users on Visual Studio and VS Code. This feature turns GitHub Copilot into a context-aware conversational assistant within the IDE, enabling developers to perform complex tasks with simple prompts. The tool is designed to keep developers in the flow amid the increasing complexity of programming languages, frameworks, and tools.
ChatGPT Expanding to Android Users, Starts Pre-Registrations: Two months after its iOS launch, ChatGPT is set to be available for Android users. The dedicated app, which offers a superior experience compared to the web interface, is expected to be as popular as the iPhone version, which saw half a million downloads in its first week. The Android version of the ChatGPT app will have similar functionality to the iOS one, including syncing conversations and preferences across devices. Users can pre-register on the Play Store to be notified when the app goes live.
Lazarus Targeting Developers with Malicious Projects - GitHub Alert: GitHub has issued a warning about a social engineering campaign by the Lazarus hacking group, which targets developers in the blockchain, cryptocurrency, online gambling, and cybersecurity sectors. The attackers use compromised or fake accounts to initiate conversations with developers, eventually inviting them to collaborate on projects that contain malicious NPM dependencies. GitHub has suspended all associated accounts and published indicators of compromise.
📚 Secret Knowledge: Learning Resources
Advanced Python Mastery: This is an exercise-driven course on Advanced Python Programming that was battle-tested several hundred times on the corporate-training circuit for more than a decade. The course is aimed at Python programmers who are comfortable with the language basics and want to add depth to their practice.
Java vs C#: A Comparative Study: Java and C# are powerful programming languages with both similarities and differences. One key difference lies in their platform and ecosystem. Java, being platform-independent, adheres to the "write once, run anywhere" philosophy, making its applications highly portable. C#, on the other hand, is primarily associated with Microsoft's .NET framework and is optimized for Windows environments. The syntax and features of the two languages also differ.
How to use Claude for Coding: Claude, the AI assistant developed by Anthropic, can write computer code among other tasks. Its latest version, Claude 2, has improved coding and arithmetic capabilities, scoring 71.2% in the Codex HumanEval Python coding test. Users can prompt Claude to write, debug, and explain code in various programming languages. However, its coding ability is currently limited. Besides coding, Claude can generate creative content, answer broad queries, summarize long texts, and translate text between multiple languages.
Shadow Coding: Efficiency Boost or Security Risk?: Shadow coding, the use of low-code/no-code platforms and generative AI tools like ChatGPT for rapid software development, is gaining popularity among tech leaders. Learn why this approach can introduce significant security risks. While these tools can speed up product development and reduce resource strain, they can also introduce vulnerabilities, particularly when used by non-technical staff. The article emphasizes the importance of thorough vetting and careful implementation of these resources.
IntelliPort: A HyperTerminal Alternative for Modern Systems: IntelliPort is a Microsoft Foundation Class (MFC) application designed to replace the discontinued HyperTerminal. It allows for the transfer of large files from a computer to a portable device via a serial port, bypassing the need for network setup. The application can also retrieve logs from embedded systems like EFTPOS devices through a serial port or UDP socket. IntelliPort is not intended to replace full-feature tools but is designed to be an easy-to-use tool for specific tasks, such as troubleshooting modems and facilitating file transfers.
GitHub Copilot vs. ChatGPT: A Comparative Analysis for Developers: GitHub Copilot and ChatGPT offer unique advantages for software developers. Copilot, designed specifically for coding, integrates directly with IDEs and adapts to individual coding styles, producing high-quality code. However, it supports only certain IDEs and lacks the ability to answer open-ended coding questions. On the other hand can answer open-ended questions and provide detailed explanations of code. However, it may not produce functioning code as reliably as Copilot. The ideal approach could be to use both tools: ChatGPT for project initiation and Copilot for intense coding work.
Understanding UAF Vulnerabilities: Use-After-Free (UAF) is a type of memory corruption vulnerability that poses a significant threat to all types of software. It occurs when an application tries to access data in a memory address that has already been freed. This can lead to software exploitation or system compromise. They can be mitigated by using memory-safe programming languages like Rust, setting a pointer to NULL after it's freed, and implementing techniques like One Time Allocation (OTA).
🔍 HackerHub: Tools & Launches
faraday: HTTP client library providing a common interface over multiple adapters. Supports request/response processing, supports persistent connections, parallel requests, and automatic response parsing.
downshift: Minimalist and flexible JavaScript library for creating enhanced and user-friendly dropdowns, comboboxes, and autocomplete/autosuggest components. Offers a low-level, primitive API.
fastify: Web framework for Node.js, designed to offer high performance and low overhead with a powerful plugin architecture. Supports schema-based validation and serialization and uses Pino for efficient logging.
shale: Ruby-based tool that facilitates the conversion of JSON, YAML, TOML, CSV, and XML data into Ruby data structures, and vice versa.
sarama: MIT-licensed Go client library for Apache Kafka, providing a stable API via the gopkg.in service with command-line tools for testing, diagnostics, and instrumentation.
llama2.c: Train a Llama 2 model in PyTorch, save the weights to a binary file, and then load that into a C file for inference. Minimalistic with no dependencies,includes a C inference engine.
✨ Tutorials and Guides
How Platform Teams Get Stuff Done: This blog discusses the different collaboration patterns platform teams can use with their customer teams. The author emphasizes the importance of a platform team's adaptability to the maturity of each team and the phase of their platform adoption. The article also highlights the need for platform teams to evolve from a high-touch, collaborative mode to a more scalable, self-service approach as the platform matures and adoption grows.
How to Choose the Right Programming Language: The article provides guidance for those who’re in a dilemma choosing a programming language for their next project. Python is recommended for its simplicity, readability, and versatility in various fields such as automation, AI, and web development. JavaScript is essential for web development, enabling dynamic, interactive websites and providing a foundation for front-end development. Java, an object-oriented language, is used widely in server-side development and Android app development, offering portability and ease of maintenance. Ruby, known for its clear syntax, is ideal for web programming.
Solving LeetCode's 'Climbing Stairs' Problem in Assembly Language: The article demonstrates how to solve LeetCode's 'Climbing Stairs' problem using x86_64 assembly language. It begins with a brief introduction to x86_64 assembly programming, including the use of registers and basic instructions. Explore a C implementation of the problem, which is used as a guide to write the assembly code. The assembly code is written within a C function using the "__attribute__((naked))" attribute and "__asm__()" function. The author explains each step of the assembly code, showing how it corresponds to the C code.
Mastering Array Creation with NumPy: The article provides a comprehensive guide to creating arrays using NumPy, a Python library for numerical computations. It covers various methods including np.array for creating an array from a Python list, np.arange for generating a range of numbers, np.ones and np.zeros for creating arrays filled with ones and zeros respectively, and np.linspace for creating an array with evenly spaced numbers over a specified range. The article also introduces the reshape function for changing the dimensions of an array.
Thread Safety in Java: A Deep Dive into Integers: The article provides a detailed explanation of thread safety in Java, focusing on integer operations. It explains the concept of atomicity and how compound operations like incrementing an integer are non-atomic, leading to potential race conditions in multithreaded environments. The author demonstrates how to implement a thread-safe integer using the synchronized keyword and compares the results of thread-safe and non-thread-safe increments. Learn the importance of understanding and correctly implementing thread safety in Java.
Profiling in Python: How to Find Performance Bottlenecks: Sometimes, the return on investment in performance optimizations just isn’t worth the effort. If you only run your code once or twice, or if it takes longer to improve the code than execute it, then what’s the point? In this tutorial, you’ll learn how to profile your Python programs using numerous tools available in the standard library, third-party libraries, as well as a powerful tool foreign to Python. Along the way, you’ll learn what profiling is and cover a few related concepts.