Recent

Author Topic: Translation of: Include assertion code (id 155)  (Read 8330 times)

nikel

  • Full Member
  • ***
  • Posts: 186
Translation of: Include assertion code (id 155)
« on: April 27, 2018, 09:18:22 pm »
In translation file there's a line "Include assertion code". I looked up several dictionaries for the word assertion and I found some things like:

* notice
* action of approval the process for sanction
* insistence

Could somoone tell me what is this?
« Last Edit: April 28, 2018, 01:54:39 pm by nikel »

Xor-el

  • Sr. Member
  • ****
  • Posts: 404
Re: Translation of: Include assertion code (id 155)
« Reply #1 on: April 27, 2018, 09:20:13 pm »
assert could mean to confirm or to verify.

nikel

  • Full Member
  • ***
  • Posts: 186
Re: Translation of: Include assertion code (id 155)
« Reply #2 on: April 27, 2018, 09:29:09 pm »
Thank you for your answer, I'm using something like confirmation.

wp

  • Hero Member
  • *****
  • Posts: 11855
Re: Translation of: Include assertion code (id 155)
« Reply #3 on: April 27, 2018, 10:35:45 pm »
I think it means, in other words, "include code related to the procedure Assert()" - see https://www.freepascal.org/docs-html/rtl/system/assert.html

howardpc

  • Hero Member
  • *****
  • Posts: 4144
Re: Translation of: Include assertion code (id 155)
« Reply #4 on: April 27, 2018, 10:37:13 pm »
Assertion is probably used here in a technical programming sense.
"Assert()" is a built-in FPC function (the idea is borrowed from C-type languages) that is used in the debugging phase only.
e.g.
Code: Pascal  [Select][+][-]
  1. Assert(Assigned(myObject),'the reference to myObject is Nil');

This simple idea enables you to sprinkle sanity checks all over your code to test essential conditions that you may assume hold true, but perhaps, for reasons you have overlooked, do not in fact hold true, and so trash your whole scheme. If the condition you "assert" to be true is not in fact true, then an exception is raised, and the message you wrote in the Assert procedure is shown.

The benefit of using "Assert()" in your code is that by a simple command-line switch (-Sa) the inclusion of all assertion code can be enabled. Otherwise, no assertion code is included, even though you do not manually change any lines in your units that call Assert.

So in the debug phase of project development you can run with all assertion checks enabled by activating a single command-line parameter.
In the production phase you omit assertion code generation, and your executable is thereby smaller and faster, once you have eliminated any bugs the assertions have shown up.

nikel

  • Full Member
  • ***
  • Posts: 186
Re: Translation of: Include assertion code (id 155)
« Reply #5 on: April 28, 2018, 01:58:28 pm »
Thanks for the detailed reply. I'm using something like "add sanction process code" as the dictionary says.
« Last Edit: April 28, 2018, 02:00:05 pm by nikel »

wp

  • Hero Member
  • *****
  • Posts: 11855
Re: Translation of: Include assertion code (id 155)
« Reply #6 on: April 28, 2018, 02:10:07 pm »
Sanction? Never heard that one... Since Assert() is a nontranslated Pascal command, why don't you keep it? If I'd have to translate "Include assertion code" to my language, German, I'd write: "Assert-Code einfügen"

nikel

  • Full Member
  • ***
  • Posts: 186
Re: Translation of: Include assertion code (id 155)
« Reply #7 on: April 29, 2018, 12:09:54 pm »
Wow your approachment changed my mind. Do I have to leave commands as they are? I mean these words must not be translated: function, parameter, dock, unit...

Am I right?

EDIT: I must say there are two types of translation (as far as I know) 1. Turkish equivalent of words 2. Words reproduced from the original ones. For example:

Code: Text  [Select][+][-]
  1. +-----------+-----------+------------+
  2. | English   | Turkish 1 | Turkish 2  |
  3. +-----------+-----------+------------+
  4. | function  | fonksiyon | işlev      |
  5. +-----------+-----------+------------+
  6. | parameter | parametre | değiştirge |
  7. +-----------+-----------+------------+
  8. | unit      | ünite     | birim      |
  9. +-----------+-----------+------------+

The translation file I found was using exact meanings (Turkish 2) almost everywhere. And I was going on the same way. I guess that has to be changed for intelligibility;
« Last Edit: April 29, 2018, 12:35:08 pm by nikel »

Thaddy

  • Hero Member
  • *****
  • Posts: 14203
  • Probably until I exterminate Putin.
Re: Translation of: Include assertion code (id 155)
« Reply #8 on: April 29, 2018, 12:33:52 pm »
Well, not in all cases. Depends on application.
In the case of Assert() it has the following meaning
"a declaration that something is the case. ...  In the negative case: "He presented no evidence to support his assertions" so the compiler will try and do that for the programmer.
Meaning the programmer expects that a certain assumption or proposition he makes is always valid, but the compiler should check that it is indeed the case.
Subsequently you can turn assertions off if all assumptions (assertions, propositions) by the programmer are indeed satisfied.
So you may indeed want to give some extra information. Assertions are not always applicable or appropiate. E.g. not for program flow.
Assertions are strongest and most useful in combination with properly written unit tests. E.g. to determine if boundaries are respected during the program's expected extremes.
« Last Edit: April 29, 2018, 12:39:24 pm by Thaddy »
Specialize a type, not a var.

nikel

  • Full Member
  • ***
  • Posts: 186
Re: Translation of: Include assertion code (id 155)
« Reply #9 on: April 29, 2018, 12:36:36 pm »
I edited the reply above.

Thaddy

  • Hero Member
  • *****
  • Posts: 14203
  • Probably until I exterminate Putin.
Re: Translation of: Include assertion code (id 155)
« Reply #10 on: April 29, 2018, 12:41:40 pm »
Well, yes, as long as you do not make words up. I expect the words in the Turkish_1 column to be not invented by yours truly, but formally used in Turkish computer science.....
Note there are several good online  books about Pascal Programming in Turkish. E.g. "Essential Pascal' by Marco Cantu is available in Turkish and you may want to check the terminology from that book.
« Last Edit: April 29, 2018, 12:43:32 pm by Thaddy »
Specialize a type, not a var.

nikel

  • Full Member
  • ***
  • Posts: 186
Re: Translation of: Include assertion code (id 155)
« Reply #11 on: April 29, 2018, 12:42:38 pm »
Yes, they are commonly used, that's why I prefer them.

 

TinyPortal © 2005-2018