Jump to content
Sign in to follow this  
c0d3r

1 error + 1 error = 3 errors? where is the extra one?

Recommended Posts

Just realized that the compiler error counts were always offset by 1,  so where is that extra one?     Are the EMBRAS... guys able to count their fingers?  if not,  I can teach them.

  • Like 1

Share this post


Link to post
Guest

the third error, stay to programmer that:

  • who made the "mistake" of compiling his code and didn't even pay attention to what he was doing.
  • 1 + 1 + programmer drinking beer while pressing the compile button ... = 3 errors

NOTE: don't drink when driving your beast pc! :classic_biggrin::classic_cheerleader:

Share this post


Link to post
3 hours ago, c0d3r said:

Just realized that the compiler error counts were always offset by 1,  so where is that extra one?     Are the EMBRAS... guys able to count their fingers?  if not,  I can teach them.

Example?

  • Like 1

Share this post


Link to post

Compilers generally try very hard if they find a bug. Then they don't know when to stop. D10.4 has made significant progress in this direction. The number of reported errors is several orders of magnitude lower.
Even so, it is recommended to believe only the first mistake and ignore the others.
I wouldn't make it a science.

  • Like 1

Share this post


Link to post
8 hours ago, Lars Fosdal said:

Example?

Create a new vcl application, drop 2 labels, and make ONE label name typo in Oncreate event.  When compiling, it said there were 2 errors in the codes:

 

error.thumb.PNG.d56142a08d85c4f5005eea9a1e4e907d.PNG

 

Edited by c0d3r

Share this post


Link to post

Actually there are two errors:

  1. undeclared identifier
  2. cannot compile unit

Seems to be pretty correct in my view.

  • Like 2

Share this post


Link to post
28 minutes ago, Uwe Raabe said:

Actually there are two errors:

  1. undeclared identifier
  2. cannot compile unit

Seems to be pretty correct in my view.

can't compile the unit is not an error that should be included,  its a result due to that ONE typo error in the codes.  The errors should be reported exactly as whats in your codes.

Edited by c0d3r
  • Like 1

Share this post


Link to post
35 minutes ago, c0d3r said:

can't compile the unit is not an error that should be included,  its a result due to that ONE typo error in the codes.  The errors should be reported exactly as whats in your codes.

This is so important! We must leave no stone unturned in our battle to persuade Embarcadero to change this! 

  • Haha 2

Share this post


Link to post
Guest
33 minutes ago, c0d3r said:

can't compile the unit is not an error that should be included,  its a result due to that ONE typo error in the codes.  The errors should be reported exactly as whats in your codes.

Why are you eliminating the possibility of the compiler been schizophrenic ?

 

Please don't deny a compiler his simple rights.

Share this post


Link to post

After all, the first error was actually made by the developer, not the compiler. 

Quote

He that is without sin among you, let him first cast a stone at her.

 

Share this post


Link to post
Guest

thanks @Uwe Raabe for confirm my suppose:

  • 1 + 1 + programmer drinking beer while pressing the compile button ... = 3 errors

Share this post


Link to post
6 hours ago, c0d3r said:

can't compile the unit is not an error that should be included,  its a result due to that ONE typo error in the codes.  The errors should be reported exactly as whats in your codes.

It's the same result in 10.2.3, not sure which version you have. I guess Delphi has it's own broken windows theory 😉

Share this post


Link to post
20 hours ago, c0d3r said:

can't compile the unit is not an error that should be included,  its a result due to that ONE typo error in the codes.  The errors should be reported exactly as whats in your codes.

Leaving aside my sarcastic response above, I think a majority of Delphi users will not regard this as an issue.

 

What happens here is that the compiler reaches a point where the errors which have been encountered so far mean that it decides to abort compilation of this unit. And it reports that decision as an error. It's been this way since the dawn of time. Nobody, but nobody, cares about precisely how many errors there are in their code. There are two states that matter:

  1. The code has no errors.
  2. The code has some errors.

Were the compiler to do what you ask, and not write the "cannot compile unit" error, and report a single error, you would not know that there was but a single error. Because the compiler had given up and any errors that are present in the code which follows the point at which the compiler aborted, would not be counted.

 

It is useful for the compiler to report counts of hints and warnings, since these values are meaningful. Counts of errors are, as I have shown above, are not.

 

That this even has to be explained astounds me.

  • Like 1

Share this post


Link to post

Looks like Warnings is off by 1 too - well it counts same Warning 2x:

 

image.thumb.png.fa279d0334a00751ee1b99155c9a64f4.png

 

@c0d3r I guess you started the scrutiny of Compile window... looks even more broken, unfortunately

 

I'm using Delphi 10.2.3, I hope newer versions have this improved.

 

Edited by Mike Torrettinni

Share this post


Link to post
Guest
24 minutes ago, Mike Torrettinni said:

Looks like Warnings is off by 1 too - well it counts same Warning 2x:

Why is this a problem ?

 

It is basic physics, an empty skull might generate echo, sometimes i wrote things twice or get an idea in double folded due the desolation. 

Share this post


Link to post
1 minute ago, Kas Ob. said:

Why is this a problem ?

 

It is basic physics, an empty skull might generate echo, sometimes i wrote things twice or get an idea in double folded due the desolation. 

You don't think it should report 1 Warnings if there is only1 Warning? Why it counts the same warning 2 times?

Hints work correct, 1 Hint = 1 reported Hint.

Share this post


Link to post
Guest
1 minute ago, Mike Torrettinni said:

You don't think

I don't for now and for a warning or hint, not important at all, in fact it does show the compiler have ugly workaround(s) and cut corners in its generated messages proce4ssing, but nothing serious or worth the time, even to write this exact post.

Share this post


Link to post
16 minutes ago, Kas Ob. said:

I don't for now and for a warning or hint, not important at all, in fact it does show the compiler have ugly workaround(s) and cut corners in its generated messages proce4ssing, but nothing serious or worth the time, even to write this exact post.

Since I prefer short blogs over books, I suggest googling: " is attention to detail useful?" and you will find many blogs and even books that might be helpful to you, in software development and also in life.

Share this post


Link to post
33 minutes ago, Mike Torrettinni said:

Since I prefer short blogs over books

Perhaps this explains the focus on tiny details and missing the bigger picture. 

 

We all know about the importance of attention to detail. Of course the compiler spitting out two warnings rather than one here is imperfect. But it has no impact on any user. It's trivial. Delphi has so many big issues and this is what gets people heated?!

Edited by David Heffernan

Share this post


Link to post
2 minutes ago, Mike Torrettinni said:

You don't read blogs? I like to, usually is condensed topic vs books.

Sure. But if that's all you read then you don't see the big picture. 

Share this post


Link to post
2 minutes ago, David Heffernan said:

Sure. But if that's all you read then you don't see the big picture. 

You are pretty vague here... big picture of what, what are you talking about?

Share this post


Link to post

The fact that you regard this topic as important. That you feel it's important to count errors beyond one. The fact that sometimes delphi emits two warnings for the same issue. None of these things matter. 

  • Like 2

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×