Fathia👩‍💻🥰 (@Teddy_builds) profile picture

Here to enjoy life. I code on the side 💻✨

Joined February 2023
Day 31/100 (coding challenge) Error handling in Python 🛟 An error shouldn't crash your whole program. try runs risky code, except catches the error, else runs if nothing went wrong, and finally always runs. More in the comments 👇 #100DaysOfCoding
3
13
raise lets you throw an error yourself when something is wrong, like a negative amount. You can even make your own custom error type with a clear name.
4
finally is for clean-up, like closing a file or a connection. It runs whether the code worked or crashed.
2
Catch specific errors, like ValueError or ZeroDivisionError, not everything. A bare except hides real bugs, so you never find out what went wrong.
3
Day 30/100 (coding challenge) List comprehensions 🥖 A loop in one line: [x * 2 for x in nums if x > 2]. It builds a new list, so the original stays untouched. Same job as map and filter, in a cleaner shape. Code below 👇 #100DaysOfCoding
2
12
Day 29/100 (coding challenge) Python strings 🔤 Slicing: s[1:4], s[::-1]. f-strings put values straight into text. Strings are immutable: methods like upper() return a NEW string, so you have to catch it. Code below 👇 #100DaysOfCoding
3
32
Day 28/100 (coding challenge) Tuples & sets Tuple: ordered, immutable, can be a dictionary key. Set: unique items only, no order, no index. Great for removing duplicates, and for union, intersection and difference. Code below 👇 #100DaysOfCoding
1
8
Day 27/100 (coding challenge) Webhooks Instead of asking a server "any news?" every few seconds, a webhook flips it: the server tells your app the moment something happens. More in the comments 👇 #100DaysOfCoding
3
10
Retries mean the same event can arrive twice, so make your handler idempotent: processing it twice should give the same result as once.
3
How it works: 1. You register a URL on your server, e.g. api.myapp.com/webhooks/payst… 2. An event happens on the other service (a payment succeeds, a PR opens). 3. It sends an HTTP POST with the event details as JSON to your URL.
4
Polling: calling the delivery app every 30 seconds to ask "is my food ready?" That wastes requests and battery. Webhook: leave your number and say "text me when it's ready."
8
Day 26/100 (coding challenge) Firebase Cloud Messaging (FCM) I used Firebase today, FCM specifically. Here’s how it works. How do push notifications reach your phone when the app is closed? FCM is the middleman. More in the comments 👇
3
1
16
Two message types: Notification: the system shows the popup for you when the app is in the background. Data: goes to your app's code with no banner. Good for background sync or custom logic.
1
6
The flow: 1. The app asks FCM for a unique registration token (the device's address). 2. The app sends that token to your backend. 3. When something happens, your backend tells FCM: send this message to this token.
1
4
Why a middleman? If every app kept its own open connection, your battery would suffer. Instead your phone keeps one shared connection to Google's servers, and your backend asks FCM to deliver the message.
1
2
Day 25/100 (coding challenge) Database indexing 📖 An index is a separate structure that helps the database find rows fast, like the index at the back of a textbook. Without one, the database may have to read every row. More in the comments 👇 #100DaysOfCoding
2
2
16
The catch: an index uses extra space, and it slows down writes, because every insert or update must update the index too. So you don't index every column. You index the ones you search or filter by often.
2
5
With an index, the database jumps close to the row, usually in O(log n). Many databases use B-trees, which keep data in order, so they can handle ranges and sorting. A hash index can reach O(1), but only for exact matches.
1
5
Day 24/100 (coding challenge) JWT vs Session Auth 🔑 How does a server remember who you are after you log in? Two main approaches, each with totally different trade-offs. More in the comments 👇 #100DaysOfCoding
3
2
21
Which one should you pick? • Go with Sessions for standard monolithic web apps or when you need instant session invalidation (like banking or sensitive dashboards). • Go with JWTs for microservices, mobile apps, or multi-domain APIs where you want low database overhead.
7
JWT / Token-based (Stateless): • The server issues a signed token with user data; the client sends it in the Authorization: Bearer <token> header, and the server just verifies the signature (no database lookup) Downsides: it’s hard to revoke before expiry, and tokens are larger.
9