BASIC Variables Made Easier 📔 I use the VS64 extension in VSCODE for my C64 BASIC development, and I really like the auto numbering and labeling, but variables are still no fun to keep track of. Each time I come up with a new system, I forget what they mean and still end up switching files to figure out what them out. So I decided to create a step in the build process for auto assigning variable names. Similar to labels, I define a name on the first definition using an alias, and then that along with all the other references get updated in the build. I haven't fully settled on the exact implementation yet, but so far it works great. So it works like this: First the variable is assigned using an alias like this: @screenRegister=1024 Then it's used as normal, without the @, anywhere in the code like this: POKE screenRegister, 81 When the code is built it gets converted to this: A1=1023 POKE A1, 81 It uses names from A1 to ZZ, so single character ones that I commonly use are not affected, such as i, x, and y. It will also make sure the name doesn't exist first and will just go to the next name if it does. #commodore46 #basicprogramming
Automating Variable Naming in C64 BASIC
More Relevant Posts
-
🚀 uint32_t vs unsigned int — What’s the difference? If you're writing embedded code, knowing the difference is important. Here’s a simple breakdown 👇 🔹 uint32_t → Defined in "stdint.h" and always 32-bit 🔹 unsigned int → Built-in C type, size can depend on compiler 💡 Simple rule: Need exact 32 bits? Use uint32_t General use? unsigned int can work. ✅ Use uint32_t for: - Registers - CAN/SPI/UART data - Portable code ✅ Use unsigned int for: - Counters - General variables ⚠️ When size matters → use uint32_t Small difference… but important in embedded C. #EmbeddedSystems #CProgramming #Firmware #STM32 #EmbeddedC
To view or add a comment, sign in
-
I may have done a thing... This past Friday, I sat down to find an open-source repo to contribute to. Instead, I caught a tangent that turned into a 72-hour deep-work sprint. The result is Myelin: a C++23 serialization engine that doesn't just "work"—it effectively disappears from the performance profile. The Mission JSON is the industry standard for readability, but it’s a tool from a different age living past its prime. Parsing character-by-character just to know what to copy is a massive bottleneck. My goal was simple: provide JSON for the humans, but treat the data like a memory bus for the hardware. The Results (Ryzen 9 3900X) It turned me into a hermit for the weekend (luckily I’m at SIU or Easter would have ruined my flow), but the metrics and the headache were worth it: Fastest Record: 4.95 ns scalar serialization. Field Access: 0.51 ns (Direct L1 cache hit). The Flex: Outperforming Protobuf by ~4x and FlatBuffers by ~10x. The Secret to the Speed Most serializers view data as a tree and require dynamic lookups. I treated the data like a physical bus. By shifting from O(n^2) field searching to a O(n) modified bucket-sort, I was able to resolve type-tags and alignment gaps at compile-time. The "Final Boss" of the weekend? The final hurdle of the weekend was the Win32 architecture (Why do they have to be different 😢). While Myelin was born on Linux, it needed to be cross-platform to be useful. I spent the night researching and implementing the Win32 handshake, specifically tackling Windows' 64KB allocation granularity to ensure the zero-copy logic remained consistent across OS boundaries, and other portability requirements. It’s amazing what you can ship in a few days when you stop fighting the compiler and start working with the silicon. Check out the code and the benchmarks: Link in the Comments! #Cpp #SystemsProgramming #LowLevel #Optimization #SoftwareEngineering #DeepWork
To view or add a comment, sign in
-
Just to let everyone know that v1.15 of #IntelliEdit has been released: https://lnkd.in/d7untMiM This release updates the embedded web browser to the latest Microsoft Edge version, upgrades the genUp4win library to the most recent available release with added download progress reporting by extending the update callback with a progress parameter and propagating it throughout the update flow, and updates the LEXILLA and SCINTILLA libraries to versions 5.4.9 and 5.6.2 respectively, bringing lexer improvements for Assembler, C++, F#, LaTeX, Pascal, Ruby, Batch, Forth, JavaScript, and JSON, adding the new SC_STATUS_OUTSIDE_DOCUMENT error status, preventing out‑of‑bounds insertions earlier, introducing a new mode for rendering tabs as HT blobs, and fixing a regression in SCI_CONVERTEOLS.
To view or add a comment, sign in
-
-
I think I've found coolest use of claude code I've seen so far. Here's a question: suppose every time you run nvidia-smi, you see an ollama process capturing 4gb of your vram. If you kill the process, it just comes back every few minutes at most. - There no extraneous terminal windows open, you're not coding with ollama, nothing. What's wrong? I asked claude about this, and it figured out that every 5 minutes, something was hitting /api/generate on my ollama (11434) endpoint, like a cronjob. It claimed that perhaps it was a vector search extension using ollama in obsidian, but I have literally a million ollama contraptions and random scripts, a well-known extension wouldn't leak so much memory to keep the cache warm. Then, claude proceeded to create a script that watches 11434 for any calls at all, and logs the prompt it uses. ~10 minutes later, the prompt was: "Based on these git changes, suggest a concise commit message following conventional commits format (e.g., "feat:", "fix:", "refactor:", etc.). Only output the commit message, nothing else" It turns out I'd opened VS Code's extension development host to work on another extension, and it also ran a "git commit reminder" extension which was ~a year old. 2 things were learned: 1. VS Code's extension development host seems to run arbitrary extensions or I need to check my config 2. Claude Code is *fantastic* at debugging in your OS, and 12 year old me who loved bash would have her mind blown at how painless that was.
To view or add a comment, sign in
-
-
C++ dev loop has been inefficient for too long. Edit → rebuild → wait Even for trivial changes. Vix v2.3.0 fixes this: fast path for simple code correct behavior for complex builds. https://lnkd.in/d2C3CyjP
To view or add a comment, sign in
-
C++23 support in MSVC Build Tools 14.51 is packed with upgrades developers will actually feel. constexpr gets easier to use, Unicode handling gets smarter, and new library additions like <flat_map> and <flat_set> bring faster, cache‑friendly containers into the mix. The <regex> overhaul alone is worth a victory lap — nearly two decades of correctness and performance issues finally resolved. Add SIMD‑boosted STL algorithms and a wave of CWG/LWG fixes, and this release is doing real work for modern C++ codebases. 👉 Dive into the details: https://buff.ly/3HZWEmb 🎈
To view or add a comment, sign in
-
-
Modern C# (+11) added the file modifier. It allows you to define file-local types. Classes, structs, or interfaces that exist only within the file they are declared in. This changes how we think about encapsulation. Before, types were visible across the project unless marked internal or nested. Now, you can scope helper types directly to a single file without polluting the wider codebase. This is helpful as it: • Prevents naming collisions across large projects • Keeps source generator output clean and isolated • Stops internal helper types from leaking beyond their intended scope • Encourages tighter, more intentional design You can define something like an InputValidator inside one file and use it freely within that file, while defining another InputValidator elsewhere with no conflict. Same name, different context, and with zero friction. This is especially useful for: • Small utility classes • Internal workers tied to a single feature • Generated scaffolding • Feature-focused vertical slices file modifier expresses clear intent by restricting types to the file where they belong. If a type does not belong outside the file, the compiler now enforces that decision. P.S. file keyword leads to cleaner boundaries, safer code, and a more structured codebase. ♻️ Share this with your network ➕ Follow me [ Elliot One ] 🔔 Enable notifications to stay updated
To view or add a comment, sign in
-
-
💡 Understanding union vs std::variant in C++ (from low-level to modern safety) Let’s start with a classic C++ concept: union. A union allows multiple members to share the same memory location. Instead of allocating space for each field, it uses only enough memory for the largest one. union Value { Node* p; int i; }; Here: p and i occupy the same address The union size = max(sizeof(Node*), sizeof(int)) 👉 This is efficient — but comes with a cost. ⚠️ The Problem A union does not track which value is active. Value v; v.i = 42; // Later... std::cout << v.p; // ❌ Undefined behavior You’re responsible for remembering what’s stored. That’s why we often add a manual tag: enum class Type { ptr, num }; struct Entry { Type t; Value v; }; And use it like: if (entry.t == Type::num) std::cout << entry.v.i; This pattern is called a tagged union. 🧠 The Modern C++ Solution: std::variant C++ now gives us a safer, cleaner alternative: #include <variant> using Value = std::variant<Node*, int>; Now: The type knows what it currently holds No manual tag needed No undefined behavior (if used correctly) ✅ Accessing the value safely Value v = 42; if (std::holds_alternative<int>(v)) { std::cout << std::get<int>(v); } Or even better: std::visit([](auto&& val) { std::cout << val; }, v); In modern C++, the default choice should almost always be: 👉 std::variant over raw union #cpp #cplusplus #moderncpp #programming #softwareengineering #systemsprogramming #lowlevel #memorymanagement #cpp17 #developers
To view or add a comment, sign in
-
Looked at a C++ issue recently that didn’t make sense at first. Same code. Same binary. Working fine on the developer’s machine… but failing consistently in the client environment. No clear crash log. No compile-time issues. First assumption was environment difference — but nothing obvious: same OS family similar hardware dependencies looked aligned The issue only started showing up when the application handled real input data on the client side. That narrowed it down. What actually helped: compared compiler and runtime configurations closely (not just versions, but flags and linking behavior) checked for undefined behavior patterns — especially around memory access and object lifetime validated assumptions that were “working by chance” in the local setup Root cause turned out to be undefined behavior that didn’t surface locally, but got exposed under the client’s runtime conditions. Once identified, the fix was straightforward. Getting to that point wasn’t. These are the kinds of issues that look simple on the surface… but take time because nothing clearly points to the problem. A senior C / C++ consultant (VC++ Win32, system-level, production debugging) is currently available to directly look into similar task-level issues and work through them with the existing codebase. Expert on real-time tasks, production fixes, or legacy systems such as C++, VC++ Win32 applications or driver-level components, focusing on these patterns helps reduce debugging time and leads to more reliable resolution of complex issues. Task based support Technical Support Job tasks assistance #seniorconsultant #developer #taskhelp
To view or add a comment, sign in
-
I just released a new Pluralsight course: Advanced C# 14: Delegates, Pattern Matching, and Source Generators Most codebases don’t get messy because people write bad code. They get messy because requirements change. You start simple. Then you add a few conditions. Then a few more. Suddenly logic is scattered everywhere, hard to follow, and even harder to change. This course is about fixing that. - Using delegates to plug behavior into your application instead of hardcoding it - Using pattern matching to replace tangled if/else logic with something you can actually read - Using source generators to remove repetitive boilerplate entirely (without runtime reflection hacks) Everything is built around a real, evolving example. Not just isolated features that look nice in a slide but never show up in real code. If you’re working in modern C# and care about writing code that’s actually maintainable 6 months from now, this is for you. https://lnkd.in/d47ZUSHV Would be genuinely interested to hear what you think once you’ve watched it! #csharp #dotnet #microsoft #aspnet #aspnetcore #designpatterns #architecture
To view or add a comment, sign in
Explore content categories
- Career
- Productivity
- Finance
- Soft Skills & Emotional Intelligence
- Project Management
- Education
- Technology
- Leadership
- Ecommerce
- User Experience
- Recruitment & HR
- Customer Experience
- Real Estate
- Marketing
- Sales
- Retail & Merchandising
- Science
- Supply Chain Management
- Future Of Work
- Consulting
- Writing
- Economics
- Artificial Intelligence
- Employee Experience
- Workplace Trends
- Fundraising
- Networking
- Corporate Social Responsibility
- Negotiation
- Communication
- Engineering
- Hospitality & Tourism
- Business Strategy
- Change Management
- Organizational Culture
- Design
- Innovation
- Event Planning
- Training & Development