<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: FalahMsi</title>
    <description>The latest articles on DEV Community by FalahMsi (@falahmsi).</description>
    <link>https://dev.to/falahmsi</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3297554%2Fd440b3d5-9cc6-4f34-a07a-5873d9140e9e.jpeg</url>
      <title>DEV Community: FalahMsi</title>
      <link>https://dev.to/falahmsi</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/falahmsi"/>
    <language>en</language>
    <item>
      <title>Why notification timing should be deterministic!?</title>
      <dc:creator>FalahMsi</dc:creator>
      <pubDate>Thu, 29 Jan 2026 17:04:14 +0000</pubDate>
      <link>https://dev.to/falahmsi/why-notification-timing-should-be-deterministic-po8</link>
      <guid>https://dev.to/falahmsi/why-notification-timing-should-be-deterministic-po8</guid>
      <description>&lt;p&gt;Notification timing looks trivial at first glance.&lt;/p&gt;

&lt;p&gt;You have an event.&lt;br&gt;
You subtract a few minutes.&lt;br&gt;
You schedule a notification.&lt;/p&gt;

&lt;p&gt;Simple… right?&lt;/p&gt;

&lt;p&gt;In practice, notification timing is one of those problems that quietly accumulates edge cases until your system becomes unpredictable, inconsistent, and hard to reason about.&lt;/p&gt;

&lt;p&gt;This post explains why notification timing must be deterministic, what usually goes wrong, and how treating it as a pure computation problem changes everything.&lt;/p&gt;

&lt;p&gt;⸻&lt;/p&gt;

&lt;p&gt;The illusion of simplicity&lt;/p&gt;

&lt;p&gt;Most applications start with logic like this:&lt;br&gt;
    • Find the next event&lt;br&gt;
    • Schedule a notification X minutes before it&lt;br&gt;
    • Label it as today, tomorrow, or later&lt;/p&gt;

&lt;p&gt;This works… until it doesn’t.&lt;/p&gt;

&lt;p&gt;As soon as your app grows, you run into questions like:&lt;br&gt;
    • What happens when the trigger time crosses midnight?&lt;br&gt;
    • Should “today” be based on the event time or the notification time?&lt;br&gt;
    • What if the user changes timezones?&lt;br&gt;
    • What if the reference time is slightly different across platforms?&lt;br&gt;
    • Why does Android fire the notification today while iOS labels it tomorrow?&lt;/p&gt;

&lt;p&gt;These issues don’t come from bugs.&lt;br&gt;
They come from non-deterministic semantics.&lt;/p&gt;

&lt;p&gt;⸻&lt;/p&gt;

&lt;p&gt;The core mistake: timeline-based reasoning&lt;/p&gt;

&lt;p&gt;A common anti-pattern looks like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;events.first { isSameDay($0.startTime, tomorrow) }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This feels intuitive — but it’s fundamentally flawed.&lt;/p&gt;

&lt;p&gt;Why?&lt;/p&gt;

&lt;p&gt;Because it mixes absolute time with human calendar concepts (today / tomorrow) too early.&lt;/p&gt;

&lt;p&gt;Once you do that:&lt;br&gt;
    • Edge cases multiply&lt;br&gt;
    • Different platforms diverge&lt;br&gt;
    • “Fixes” become patches instead of rules&lt;/p&gt;

&lt;p&gt;⸻&lt;/p&gt;

&lt;p&gt;Determinism changes the model&lt;/p&gt;

&lt;p&gt;A deterministic system answers one question consistently:&lt;/p&gt;

&lt;p&gt;Given the same inputs, will every platform produce the same output?&lt;/p&gt;

&lt;p&gt;For notification timing, that means:&lt;br&gt;
    • No reliance on UI concepts&lt;br&gt;
    • No implicit “today” logic&lt;br&gt;
    • No platform-specific date helpers&lt;br&gt;
    • No stateful or hidden behavior&lt;/p&gt;

&lt;p&gt;Only pure computation.&lt;/p&gt;

&lt;p&gt;⸻&lt;/p&gt;

&lt;p&gt;A deterministic contract&lt;/p&gt;

&lt;p&gt;Here’s the mental model that works:&lt;br&gt;
    1.  Select the upcoming event&lt;br&gt;
    • Based only on absolute time&lt;br&gt;
    • event.startTime &amp;gt; referenceTime&lt;br&gt;
    • Sorted by startTime&lt;br&gt;
    2.  Compute trigger time&lt;br&gt;
    • triggerTime = event.startTime - leadTime&lt;br&gt;
    3.  Derive day label&lt;br&gt;
    • Compare calendar days of:&lt;br&gt;
    • triggerTime&lt;br&gt;
    • referenceTime&lt;br&gt;
    • In a specific timezone&lt;br&gt;
    • Result: today, tomorrow, or later&lt;/p&gt;

&lt;p&gt;That’s it.&lt;/p&gt;

&lt;p&gt;No guessing.&lt;br&gt;
No heuristics.&lt;br&gt;
No shortcuts.&lt;/p&gt;

&lt;p&gt;⸻&lt;/p&gt;

&lt;p&gt;Why trigger time matters more than event time&lt;/p&gt;

&lt;p&gt;Here’s a subtle but critical insight:&lt;/p&gt;

&lt;p&gt;Day labels must be based on the trigger time, not the event time.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
    • Event starts at 00:30&lt;br&gt;
    • Lead time is 60 minutes&lt;br&gt;
    • Trigger fires at 23:30 the previous day&lt;/p&gt;

&lt;p&gt;If you label based on the event time, you’ll say tomorrow.&lt;/p&gt;

&lt;p&gt;If you label based on the trigger time, you’ll say today — which matches user expectations.&lt;/p&gt;

&lt;p&gt;This single rule eliminates a large class of bugs.&lt;/p&gt;

&lt;p&gt;⸻&lt;/p&gt;

&lt;p&gt;Cross-platform consistency is not optional&lt;/p&gt;

&lt;p&gt;If your logic lives:&lt;br&gt;
    • partly in Swift&lt;br&gt;
    • partly in Kotlin&lt;br&gt;
    • partly in JavaScript&lt;/p&gt;

&lt;p&gt;…then determinism is mandatory, not a nice-to-have.&lt;/p&gt;

&lt;p&gt;Otherwise:&lt;br&gt;
    • Notifications fire at different times&lt;br&gt;
    • Tests pass on one platform and fail on another&lt;br&gt;
    • Bugs become “platform quirks”&lt;/p&gt;

&lt;p&gt;A deterministic engine guarantees:&lt;br&gt;
    • Same inputs&lt;br&gt;
    • Same outputs&lt;br&gt;
    • Everywhere&lt;/p&gt;

&lt;p&gt;⸻&lt;/p&gt;

&lt;p&gt;Treat notification timing as a pure engine&lt;/p&gt;

&lt;p&gt;The key architectural decision is this:&lt;/p&gt;

&lt;p&gt;Notification timing logic should be headless, stateless, and pure.&lt;/p&gt;

&lt;p&gt;It should:&lt;br&gt;
    • Not schedule notifications&lt;br&gt;
    • Not know about permissions&lt;br&gt;
    • Not touch UI&lt;br&gt;
    • Not persist anything&lt;/p&gt;

&lt;p&gt;Its job is to answer exactly one question:&lt;/p&gt;

&lt;p&gt;What is the next upcoming event, and when should I notify the user?&lt;/p&gt;

&lt;p&gt;Everything else belongs to the application layer.&lt;/p&gt;

&lt;p&gt;⸻&lt;/p&gt;

&lt;p&gt;A practical implementation&lt;/p&gt;

&lt;p&gt;I ran into these problems repeatedly in production scheduling systems, so I extracted the logic into a small deterministic engine:&lt;/p&gt;

&lt;p&gt;Notification Intelligence Engine (NIE)&lt;br&gt;
    • Cross-platform (Swift, Kotlin, TypeScript)&lt;br&gt;
    • Pure computation&lt;br&gt;
    • Timezone-aware&lt;br&gt;
    • Backed by shared test vectors&lt;br&gt;
    • Identical semantics across platforms&lt;/p&gt;

&lt;p&gt;GitHub:&lt;br&gt;
👉 &lt;a href="https://github.com/FalahMsi/NotificationIntelligenceEngine" rel="noopener noreferrer"&gt;NIE&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Even if you don’t use it, the design principles are what matter.&lt;/p&gt;

&lt;p&gt;⸻&lt;/p&gt;

&lt;p&gt;Final thought&lt;/p&gt;

&lt;p&gt;Most notification bugs aren’t about notifications.&lt;/p&gt;

&lt;p&gt;They’re about time semantics.&lt;/p&gt;

&lt;p&gt;Once you make notification timing deterministic:&lt;br&gt;
    • Bugs disappear&lt;br&gt;
    • Tests become meaningful&lt;br&gt;
    • Cross-platform behavior aligns&lt;br&gt;
    • The system becomes easier to reason about&lt;/p&gt;

&lt;p&gt;If your app depends on notifications, determinism isn’t overengineering - it’s correctness.&lt;/p&gt;

&lt;h1&gt;
  
  
  programming
&lt;/h1&gt;

&lt;h1&gt;
  
  
  architecture
&lt;/h1&gt;

&lt;h1&gt;
  
  
  notifications
&lt;/h1&gt;

&lt;h1&gt;
  
  
  crossplatform
&lt;/h1&gt;

</description>
      <category>architecture</category>
      <category>softwaredevelopment</category>
      <category>softwareengineering</category>
      <category>systemdesign</category>
    </item>
    <item>
      <title>I tried to mimic the human brain to rethink how AI works – Introducing NeuroCode</title>
      <dc:creator>FalahMsi</dc:creator>
      <pubDate>Thu, 26 Jun 2025 15:53:40 +0000</pubDate>
      <link>https://dev.to/falahmsi/i-tried-to-mimic-the-human-brain-to-rethink-how-ai-works-introducing-neurocode-4cp</link>
      <guid>https://dev.to/falahmsi/i-tried-to-mimic-the-human-brain-to-rethink-how-ai-works-introducing-neurocode-4cp</guid>
      <description>&lt;p&gt;Hi everyone 👋&lt;/p&gt;

&lt;p&gt;I’m Falah, an independent developer fascinated by the idea that &lt;strong&gt;the brain is not a black box, but a modular, efficient, conscious machine&lt;/strong&gt; – and maybe AI doesn't need to be trained on trillions of tokens to be useful.&lt;/p&gt;




&lt;h2&gt;
  
  
  🧠 What is NeuroCode?
&lt;/h2&gt;

&lt;p&gt;NeuroCode is an open initiative to reimagine artificial intelligence by studying how &lt;strong&gt;the human brain is structured and operates&lt;/strong&gt;, and trying to simulate its logic &lt;em&gt;without relying heavily on large-scale training data or models&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;It's still in its early conceptual stages, but I’ve built the &lt;strong&gt;fundamentals of an experimental framework&lt;/strong&gt; where different modules (perception, logic, decisions) mimic cortical separation – each can be loaded or shut down like the brain’s regions.&lt;/p&gt;




&lt;h2&gt;
  
  
  🎯 Why I built it
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Most current AI projects focus on &lt;strong&gt;brute force scale&lt;/strong&gt; (e.g. LLMs).&lt;/li&gt;
&lt;li&gt;I wanted to explore something more &lt;strong&gt;philosophical&lt;/strong&gt;, &lt;strong&gt;neurologically aligned&lt;/strong&gt;, and &lt;strong&gt;modular&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;My goal is to eventually create an AI that &lt;strong&gt;learns like a child&lt;/strong&gt;, &lt;strong&gt;sleeps&lt;/strong&gt;, &lt;strong&gt;hallucinates&lt;/strong&gt;, or &lt;strong&gt;remembers&lt;/strong&gt; selectively.&lt;/li&gt;
&lt;li&gt;I had limited resources, so I focused on &lt;strong&gt;logic structure first, not training data.&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  📎 Read the Initiative (PDF)
&lt;/h2&gt;

&lt;p&gt;I documented the idea, structure, and future vision here:&lt;/p&gt;

&lt;p&gt;👉 &lt;a href="https://github.com/FalahMsi/neurocode/blob/master/initiative.pdf" rel="noopener noreferrer"&gt;https://github.com/FalahMsi/neurocode/blob/master/initiative.pdf&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  💡 What's Next?
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Opening the idea to the public to gather thoughts, collaborations, or even challenges.&lt;/li&gt;
&lt;li&gt;Planning to build a simulation-based memory system and eventually a consciousness sandbox.&lt;/li&gt;
&lt;li&gt;Feedback is &lt;em&gt;super&lt;/em&gt; welcome. Even if it’s critical.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  ❤️ Let’s Connect
&lt;/h2&gt;

&lt;p&gt;If you're working on neurosymbolic AI, AGI concepts, or just find this cool, feel free to reach out. Let’s build something different together.&lt;/p&gt;

&lt;p&gt;Cheers,&lt;br&gt;&lt;br&gt;
Falah&lt;br&gt;&lt;br&gt;
&lt;a href="https://news.ycombinator.com/user?id=FalahDev" rel="noopener noreferrer"&gt;@FalahDev&lt;/a&gt;  &lt;/p&gt;

</description>
      <category>ai</category>
      <category>opensource</category>
      <category>machinelearning</category>
    </item>
  </channel>
</rss>
