Close Menu
    DevStackTipsDevStackTips
    • Home
    • News & Updates
      1. Tech & Work
      2. View All

      CodeSOD: Across the 4th Dimension

      September 25, 2025

      Cursor vs GitHub Copilot (2025): Which AI Platform Wins for Your Node.js Dev Team?

      September 25, 2025

      NuGet adds support for Trusted Publishing

      September 25, 2025

      AWS launches IDE extension for building browser automation agents

      September 25, 2025

      Distribution Release: Kali Linux 2025.3

      September 23, 2025

      Distribution Release: SysLinuxOS 13

      September 23, 2025

      Development Release: MX Linux 25 Beta 1

      September 22, 2025

      DistroWatch Weekly, Issue 1140

      September 21, 2025
    • Development
      1. Algorithms & Data Structures
      2. Artificial Intelligence
      3. Back-End Development
      4. Databases
      5. Front-End Development
      6. Libraries & Frameworks
      7. Machine Learning
      8. Security
      9. Software Engineering
      10. Tools & IDEs
      11. Web Design
      12. Web Development
      13. Web Security
      14. Programming Languages
        • PHP
        • JavaScript
      Featured

      Beyond Denial: How AI Concierge Services Can Transform Healthcare from Reactive to Proactive

      September 25, 2025
      Recent

      Beyond Denial: How AI Concierge Services Can Transform Healthcare from Reactive to Proactive

      September 25, 2025

      IDC ServiceScape for Microsoft Power Apps Low-Code/No-Code Custom Application Development Services

      September 25, 2025

      A Stream-Oriented UI library for interactive web applications

      September 24, 2025
    • Operating Systems
      1. Windows
      2. Linux
      3. macOS
      Featured

      FOSS Weekly #25.39: Kill Switch Phones, LMDE 7, Zorin OS 18 Beta, Polybar, Apt History and More Linux Stuff

      September 25, 2025
      Recent

      FOSS Weekly #25.39: Kill Switch Phones, LMDE 7, Zorin OS 18 Beta, Polybar, Apt History and More Linux Stuff

      September 25, 2025

      Distribution Release: Kali Linux 2025.3

      September 23, 2025

      Distribution Release: SysLinuxOS 13

      September 23, 2025
    • Learning Resources
      • Books
      • Cheatsheets
      • Tutorials & Guides
    Home»Tech & Work»CodeSOD: Across the 4th Dimension

    CodeSOD: Across the 4th Dimension

    September 25, 2025

    We’re going to start with the code, and then talk about it. You’ve seen it before, you know the chorus: bad date handling:

    C_DATE($1)
    C_STRING(7;$0)
    C_STRING(3;$currentMonth)
    C_STRING(2;$currentDay;$currentYear)
    C_INTEGER($month)
    
    $currentDay:=String(Day of($1))
    $currentDay:=Change string("00";$currentDay;3-Length($currentDay))
    $month:=Month of($1)
    Case of
    
    : ($month=1)
    $currentMonth:="JAN"
    
    : ($month=2)
    $currentMonth:="FEB"
    
    : ($month=3)
    $currentMonth:="MAR"
    
    : ($month=4)
    $currentMonth:="APR"
    
    : ($month=5)
    $currentMonth:="MAY"
    
    : ($month=6)
    $currentMonth:="JUN"
    
    : ($month=7)
    $currentMonth:="JUL"
    
    : ($month=8)
    $currentMonth:="AUG"
    
    : ($month=9)
    $currentMonth:="SEP"
    
    : ($month=10)
    $currentMonth:="OCT"
    
    : ($month=11)
    $currentMonth:="NOV"
    
    : ($month=12)
    $currentMonth:="DEC"
    
    End case
    
    $currentYear:=Substring(String(Year of($1));3;2)
    
    $0:=$currentDay+$currentMonth+$currentYear
    

    At this point, most of you are asking “what the hell is that?” Well, that’s Brewster‘s contribution to the site, and be ready to be shocked: the code you’re looking at isn’t the WTF in this story.

    Let’s rewind to 1984. Every public space was covered with a thin layer of tobacco tar. The Ground Round restaurant chain would sell children’s meals based on the weight of the child and have magicians going from table to table during the meal. And nobody quite figured out exactly how relational databases were going to factor into the future, especially because in 1984, the future was on the desktop, not the big iron “server side”.

    Thus was born “Silver Surfer”, which changed its name to “4th Dimension”, or 4D. 4D was an RDBMS, an IDE, and a custom programming language. That language is what you see above. Originally, they developed on Apple hardware, and were almost published directly by Apple, but “other vendors” (like FileMaker) were concerned that Apple having a “brand” database would hurt their businesses, and pressured Apple- who at the time was very dependent on its software vendors to keep its ecosystem viable. In 1993, 4D added a server/client deployment. In 1995, it went cross platform and started working on Windows. By 1997 it supported building web applications.

    All in all, 4D seems to always have been a step or two behind. It released a few years after FileMaker, which served a similar niche. It moved to Windows a few years after Access was released. It added web support a few years after tools like Cold Fusion (yes, I know) and PHP (I absolutely know) started to make building data-driven web apps more accessible. It started supporting Service Oriented Architectures in 2004, which is probably as close to “on time” as it ever got for shipping a feature based on market demands.

    4D still sees infrequent releases. It supports SQL (as of 2008), and PHP (as of 2010). The company behind it still exists. It still ships, and people- like Brewster- still ship applications using it. Which brings us all the way back around to the terrible date handling code.

    4D does have a “date display” function, which formats dates. But it only supports a handful of output formats, at least in the version Brewster is using. Which means if you want DD-MMM-YYYY (24-SEP-2025) you have to build it yourself.

    Which is what we see above. The rare case where bad date handling isn’t inherently the WTF; the absence of good date handling in the available tooling is.

    [Advertisement]
    Utilize BuildMaster to release your software with confidence, at the pace your business demands. Download today!

    Source: Read More 

    news
    Facebook Twitter Reddit Email Copy Link
    Previous ArticleCursor vs GitHub Copilot (2025): Which AI Platform Wins for Your Node.js Dev Team?
    Next Article IDC ServiceScape for Microsoft Power Apps Low-Code/No-Code Custom Application Development Services

    Related Posts

    Tech & Work

    Cursor vs GitHub Copilot (2025): Which AI Platform Wins for Your Node.js Dev Team?

    September 25, 2025
    Tech & Work

    NuGet adds support for Trusted Publishing

    September 25, 2025
    Leave A Reply Cancel Reply

    For security, use of Google's reCAPTCHA service is required which is subject to the Google Privacy Policy and Terms of Use.

    Continue Reading

    CVE-2025-5345 – Bluebird IsdcardRemoteService Unauthenticated File Manipulation Vulnerability

    Common Vulnerabilities and Exposures (CVEs)

    CVE-2025-29690 – OA System Cross-Site Scripting (XSS)

    Common Vulnerabilities and Exposures (CVEs)

    Cookie pop-ups don’t have to be a fact of life online – how I block them and why

    News & Updates

    How to easily run your favorite local AI models on Linux with this handy app

    News & Updates

    Highlights

    Machine Learning

    LLMs Can Learn Complex Math from Just One Example: Researchers from University of Washington, Microsoft, and USC Unlock the Power of 1-Shot Reinforcement Learning with Verifiable Reward

    May 3, 2025

    Recent advancements in LLMs such as OpenAI-o1, DeepSeek-R1, and Kimi-1.5 have significantly improved their performance…

    CVE-2025-3969 – Codeprojects News Publishing Site Dashboard Remote File Upload Vulnerability

    April 27, 2025

    Helldivers 2 on Xbox could strike Halo gold — I’m begging you, please add this one thing

    July 3, 2025

    Celebrating GAAD by Committing to Universal Design: Low Physical Effort

    May 21, 2025
    © DevStackTips 2025. All rights reserved.
    • Contact
    • Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.