Your console logs could be lying to you. A function prints 'call' and a merged namespace logs 'init' while defining a constant. Both run before the function invocation. In production this can mask init‑time side effects. It may cause ordering bugs that appear only after deployment. Flaky tests can pass locally while failing in CI. Comment A, B, C, or D with your answer and defend why you chose it. #typescript #webdevelopment #programming #codinginterview
Console Logs Can Deceive: Avoiding Init-Time Side Effects in TypeScript
More Relevant Posts
-
Stack vs Heap in C++ — same memory, very different behavior. Every C++ program uses both, but they serve completely different purposes. Stack → Automatic memory (scope-based) → Extremely fast allocation → Ideal for local variables Heap → Manual or dynamic memory → More flexible, but slower → Used for objects with dynamic lifetime 💡 The real difference is not just performance — it is control vs simplicity. Stack gives you speed and safety. Heap gives you flexibility and responsibility. And that is where many bugs are born. I turned the comparison into a visual to make it easier to understand at a glance. #cpp #cplusplus #memory #performance #softwareengineering #programming #coding
To view or add a comment, sign in
-
-
DAY->12 Solved Running Sum of 1d Array on LeetCode today. Implemented the solution using the Prefix Sum technique to compute the cumulative sum of elements efficiently. -> Time Complexity: O(n) -> Space Complexity: O(n) All 54/54 test cases passed with 0 ms runtime. Small problems like this help strengthen fundamentals in arrays and prefix sums, which are widely used in many algorithmic problems. #LeetCode #DSA #CodingJourney #Programming #Cplusplus #ProblemSolving
To view or add a comment, sign in
-
-
🚀 The #undef Directive (C++) The `#undef` directive removes a previously defined preprocessor symbol. This can be useful for temporarily disabling a macro or conditional compilation block. It's often used in conjunction with `#ifdef` and `#define` to control the behavior of code based on specific conditions. Undefining a symbol allows for dynamic configuration of the compilation process, enabling or disabling certain features or optimizations based on the project's requirements. #c++ #programming #coding #tech #learning #professional #career #development
To view or add a comment, sign in
-
-
Multithreading in theory vs reality 🧵⚙️ In theory: Every thread executes independently, efficiently, and peacefully. In reality: Race conditions, deadlocks, and thread competition, context switching, synchronization issues etc. 👉 Writing multithreaded code is easy. 👉 Writing correct multithreaded code is the real challenge. #Multithreading #Programming #SoftwareEngineering #BackendDevelopment #CPP #CppProgramming #ModernCPP #Multithreading #Concurrency #ParallelProgramming #SystemProgramming #SoftwareEngineering #CodingLife
To view or add a comment, sign in
-
-
Multithreading in theory vs reality 🧵⚙️ In theory: Every thread executes independently, efficiently, and peacefully. In reality: Race conditions, deadlocks, and thread competition, context switching, synchronization issues etc. 👉 Writing multithreaded code is easy. 👉 Writing correct multithreaded code is the real challenge. #Multithreading #Concurrency #Programming #SoftwareEngineering #BackendDevelopment #CPP #CppProgramming #ModernCPP #Multithreading #Concurrency #ParallelProgramming #STL #SystemProgramming #SoftwareEngineering #CodingLife
To view or add a comment, sign in
-
-
Lean 4 (functional programming language / proof assistant) connected to FlightGear via a UDP daemon — implemented entirely in Lean and running inside the same LSP session. In Cursor/VSCode, this shows up as an interactive widget: live telemetry (altitude, control surfaces, packet flow) and direct aileron control. Everything happens inside the live development environment — no rebuilds, no redeploy. Change code, observe the effect immediately. Very Smalltalk-like… except the environment is Lean. #lean4 #flightsim
To view or add a comment, sign in
-
-
This is mostly for software engineers. But maybe also for people coming from theory. For engineers - this is not about "proof assistants" in the academic sense. For theorists - this is about those tools escaping into real systems. In the previous post (https://lnkd.in/d9fVqkdV) I intentionally avoided focusing on proofs. There are many people much stronger than me working on Lean4 as a proof assistant. I wanted to check something simpler: can it just do real work? UDP, external system (FlightGear), live interaction inside the editor - all written in Lean, running in one session. So yes, it can. The more interesting part is what follows from this. We are used to a split: - code does things - documentation explains - tests try to approximate correctness These are three different worlds, weakly connected. But here the same language can: - run the system - describe its structure - express invariants about it This means project knowledge does not have to live in documents or comments. It can be part of the system itself - structured, checkable, and usable at meta-level (including generating code, constraining implementations, etc). Not everything, of course. But the important parts. Another angle. Tests check examples. Proofs describe the whole space. This does not mean "replace tests". But it changes the question: where do we really need sampling, and where can we state what must always hold? One practical observation. Most of this code was initially written by Cursor. I had to guide it a bit and refactor a lot, but still - I did not need deep knowledge of Lean to get started. This feels important. Languages like Lean (or Agda or Haskell or even Scala) were always considered "too hard" for everyday engineering. That assumption may no longer hold. Also, all of this ran on FreeBSD, which is not even an official target platform for Lean. So portability is not perfect, but it is real. I do not see this as a replacement for anything. It is more like: the capability is already here. A language that can both do things and make statements about what must be true. And maybe now - it becomes usable outside academia. #lean4 #scala
Software is badly applied math. Let's fix that. Real-world Scala consulting. Selling honest software engineering.
Lean 4 (functional programming language / proof assistant) connected to FlightGear via a UDP daemon — implemented entirely in Lean and running inside the same LSP session. In Cursor/VSCode, this shows up as an interactive widget: live telemetry (altitude, control surfaces, packet flow) and direct aileron control. Everything happens inside the live development environment — no rebuilds, no redeploy. Change code, observe the effect immediately. Very Smalltalk-like… except the environment is Lean. #lean4 #flightsim
To view or add a comment, sign in
-
-
Synchronize properties across dynamically instantiated QML elements, using a C++ singleton that acts as a message broker and recursive signal-slot connections. This design enables flexible and scalable value synchronization across components, with minimal coupling between UI and logic. Read on: https://lnkd.in/e7ia5ysA #QtDev #QML #Cpp #CPlusPlus #Programming
To view or add a comment, sign in
-
-
That tiny newline between tags sneaks a space into your markup. Two sibling <span> elements sit on separate lines inside a <div>. No explicit space character is added. A stray gap appears in tightly packed UI components. Automated snapshot tests fail with mismatched markup. Customers report misaligned buttons in live deployments. Comment A, B, C, or D with your guess and defend it. #JSX #React #WebDevelopment #Programming #CodingInterview
To view or add a comment, sign in
-
-
Another small game dev build using C++ + SFML 🎮 This time, I created a Pong-style game where the ball bounces across the screen, interacts with the bat, updates score on successful returns, and tracks lives as the game progresses. What I worked on: Ball movement and wall collision Bat movement and controls Score and lives system Basic game loop and event handling Collision logic using SFML shapes and bounds It’s a simple project, but a really useful one for understanding how real-time game loops, object movement, collision detection, and input handling actually come together in code. Game development is not exactly my primary domain, but projects like this are a fun way to strengthen logic-building and C++ fundamentals while exploring something different. Built with SFML and a lot of debugging 😄 #CPlusPlus #CPP #SFML #GameDevelopment #Programming #BeginnerProjects #SoftwareDevelopment #Coding
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