Author Topic: The Compiler is right  (Read 22778 times)

0 Members and 1 Guest are viewing this topic.

Offline AngelFish

  • Is this my custom title?
  • Administrator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3242
  • Rating: +270/-27
  • I'm a Fishbot
    • View Profile
The Compiler is right
« on: September 01, 2011, 10:35:13 pm »
One thing I've noticed from a lot of people is the assumption that the tools they use are at fault for the errors they observe. While this can indeed be the case (one only has to look at the bugs list of any major project for evidence), the first, second, and third rules of debugging are to assume that the tools are perfect until all other possibilities are disproven as the source(s) of the error(s). One example relevant to the TI is that of OS v. 2.5x, an OS often cited as the cause of many inexplicable errors. However, it is well known that the vast majority of errors are user errors, not code errors, especially in any prominent piece of code. As comfortable as it is to blame the tools, those same tools are debugged very thoroughly for the simple reason that bugs are often far more important in a tool than in a random program. In general, important programs such as Operating Systems, Compilers and Interpreters1 are among the least buggy programs available by sheer necessity. Before claiming an error is caused by any of the above, please stop and consider whether the errors are valid bugs. Spend time looking at the documentation. Check previous bug reports and your own code carefully. Major bugs in tools are extremely rare, highly publicized, and almost always well documented.


1: There is almost never a good reason to assume a hardware bug in commercial hardware. Don't do it without extremely strong evidence to back that claim (such as integer addition of 1 and 1 producing 3, in which case you should still be checking your display and register loading routines first).
« Last Edit: September 01, 2011, 10:35:41 pm by Qwerty.55 »
∂²Ψ    -(2m(V(x)-E)Ψ
---  = -------------
∂x²        ℏ²Ψ

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: The Compiler is right
« Reply #1 on: September 01, 2011, 10:38:51 pm »
Well I assume this excludes TASM, right? I remember TASM did stuff like throwing an error about a missing End even if it was present. :P

Also same for Axe which still has bugs if I remember, although I guess it's best to check your code first before reporting a bug.
« Last Edit: September 01, 2011, 10:39:44 pm by DJ_O »

Offline AHelper

  • LV3 Member (Next: 100)
  • ***
  • Posts: 99
  • Rating: +18/-0
    • View Profile
    • GlaßOS razzl
Re: The Compiler is right
« Reply #2 on: September 01, 2011, 10:43:28 pm »
SDCC, in the 3.0.0 version and in the optralloc branch, defies that statement by making up opcodes, using a jr when it is clearly trying to jump by a 16 bit number, or just failing to manage the stack... But that's just me and mah buggy OS, which somehow runs.
SDCC tastes like air bags - big output, but fast and safe to run.

Offline AngelFish

  • Is this my custom title?
  • Administrator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3242
  • Rating: +270/-27
  • I'm a Fishbot
    • View Profile
Re: The Compiler is right
« Reply #3 on: September 01, 2011, 10:51:14 pm »
"Compilers are mostly right" just didn't have the same ring to it :P
∂²Ψ    -(2m(V(x)-E)Ψ
---  = -------------
∂x²        ℏ²Ψ

Offline Juju

  • Incredibly sexy mare
  • Coder Of Tomorrow
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 5730
  • Rating: +500/-19
  • Weird programmer
    • View Profile
    • juju2143's shed
Re: The Compiler is right
« Reply #4 on: September 01, 2011, 11:38:47 pm »
Most of the time, the compiler is often the reference implementation of a language. So it's right because the author decided it.
« Last Edit: September 01, 2011, 11:39:15 pm by Juju »

Remember the day the walrus started to fly...

I finally cleared my sig after 4 years you're happy now?
THEGAME
This signature is ridiculously large you've been warned.

The cute mare that used to be in my avatar is Yuki Kagayaki, you can follow her on Facebook and Tumblr.

Offline willrandship

  • Omnimagus of the Multi-Base.
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2953
  • Rating: +98/-13
  • Insert sugar to begin programming subroutine.
    • View Profile
Re: The Compiler is right
« Reply #5 on: September 01, 2011, 11:45:17 pm »
I have to admit, it was always tempting to blame the language when my hello world programs wouldn't compile, when I started programming C years ago. Hey, it was a long time ago :P

If I hate some layout of a lang, often there's a way around it, like writing my own lib around it that avoids the issue from then on :P

This topic really doesn't apply to early community projects, or homemade ones, though. For commercial ones it almost surely does.
« Last Edit: September 01, 2011, 11:49:07 pm by willrandship »