RSSAmplifier

Blog

0 to 1

Sharing my thoughts on what I learn, while I learn...

antcode.bearblog.devRSS feed ↗3 posts

Latest posts

nums.size() vs int n = nums.size() in a For Loop: Which One Should You Actually Use?

You write this loop a hundred times a week and never think about it: for ( int i = 0 ; i < nums . size (); i ++ ) { } It compiles. It passes your tests. It ships. Then, months later — or thirty seconds into a coding interview — someone feeds it an empty vector, and everything goes sideways. Not a crash you can point to on line 12. Just... your loop runs forever, or reads garbage memory, or returns…

NULL vs Empty String: Why "No Data" Isn't Always the Same Thing

If you've worked with databases for more than a week, you've probably hit this moment: a text field has no data, and you have to decide: do I leave it NULL , or do I set it to an empty string '' ? It looks like a trivial choice. It isn't. Pick wrong (or pick inconsistently) and you'll spend years explaining weird bugs in your reports. Let's break down what each one actually means, why most…

Slowly Changing Dimensions (SCD): What They Are and How to Actually Choose the Right One

When you're working with data, one thing is guaranteed: data changes . Customers move, prices get updated, employees switch roles. The real question isn’t if data changes, it’s how you handle those changes without breaking your analytics later . That’s where Slowly Changing Dimensions (SCD) come in. First, What Are SCDs? SCDs are just different ways of handling updates to dimension data. Whenever…