You're arguing that exception handling is bad, because it is implied by OOP, which in turn is bad, because everything can be written procedural and without objects? Did I get it right?
Нет! Нет! И ещё раз нет! )))
Не мешайте пожалуйста всё и сразу в одну кучу! (возможно я виноват своим двусмысленным высказыванием). В посте #55 я указал почему я это не использую. На что мне ответили, что я что-то делаю неправильно. Возможно
MarkMLl мог оказаться правым на мой счёт, если бы на месте меня был кто-то другой. Но на моём месте - я. ))) И попробовав сделать всё то же самое что делаю я, он бы так же столкнулся с теми же проблемами. Код, с которым я работаю достаточно нативен. Я не использую LCL и многие классы (да, я не люблю ООП, но я видел немало программ которые хорошо сделаны с помощью ООП и они не сильно "раздутые" - небольшого размера). И перечитывая тему, я начал понимать, почему в моём коде не срабатывают подобное.
Для того чтоб использовать try..exception/try..finally надо включать в них вызываемый код (что обычно и происходит в ООП). А в моём коде, я проверяю не включаемый код, а конечный результат. И, я не могу использовать данные методы для проверки, потому что они не будут "пытаться" сделать. Уже всё сделано и обрабатывать уже нечего. Ошибка уже совершена (в чём-то тут моя вина, и я этого не понимал изначально).
Потому, надо смотреть, что происходит. Если вызывается процедура/функция, то её можно обработать подобным образом. Она попытается сработать, вызовет исключение и вернётся (сделав вид, что код не сработал). И тогда ошибку обойдём. Если мы обрабатываем конечный результат, мы не сможем ни чего обработать данными методами.
Yandex translate:
No! No! And once again, no! )))
Please do not interfere all at once in one pile! (perhaps I am to blame for my ambiguous statement). In post #55 I indicated why I don't use it. To which I was told that I was doing something wrong. Perhaps
MarkMLl could have been right about me if someone else had been in my place. But I am in my place.))) And if he tried to do all the same things that I do, he would also face the same problems. The code I'm working with is quite native. I don't use LCL and many classes (yes, I don't like OOP, but I've seen a lot of programs that are well made with OOP and they are not very "bloated" - small in size). And rereading the topic, I began to understand why such things do not work in my code.
In order to use try..exception/try..finally it is necessary to include the called code in them (which usually happens in OOP). And in my code, I'm not checking the included code, but the final result. And, I can't use these methods for verification because they won't "try" to do. Everything is already done and there is nothing left to process. The mistake has already been made (something is my fault here, and I didn't understand it initially).
Therefore, we need to look at what is happening. If a procedure/function is called, then it can be handled in a similar way. It will try to work, raise an exception and return (pretending that the code did not work). And then we will bypass the error. If we process the final result, we will not be able to process anything with these methods.
Then the 440bx standpoint that is actually revealed quite late into the discussion - exception handling is bad, because it is the only way to return error when assigning to a property, which is part of the Pascal implementation of OOP. Because of that developer is forced to use it, and that is presumably a bad thing.
По сути, я уже ответил на это. Это не зависит от того, какое программирование мы используем. Процедурное или ООП. Это зависит от того, что мы делаем в коде. Конечный результат так обрабатывать (как я понимаю) просто нельзя. Это создано для попытки вызова процедуры/функции или какого-то кода - что может вызвать исключение. Результат - не может вызвать исключения (код уже выполнен и мы либо уже получили исключение или код просто отработал). )))
Минус подобного подхода в том, что код может выполняться несколько раз, и ни разу не выполнится. А в "сокрытых" (вызываемых) процедурах/функциях может лежать очень немало кода... что может отнять достаточное время на обработку исключения.
Yandex translate:
In fact, I have already answered this. It doesn't depend on what kind of programming we use. Procedural or OOP. It depends on what we are doing in the code. The end result can't be processed like that (as I understand it). This is created to attempt to call a procedure/function or some code - which may cause an exception. The result is that it cannot cause exceptions (the code has already been executed and we either have already received an exception or the code just worked). )))
The disadvantage of this approach is that the code can be executed several times, and it will never be executed. And there can be a lot of code in "hidden" (called) procedures/functions... which may take up enough time to process the exception.
----------------------------------------------------------------
Благодарю всех за обсуждение подобных тем! Это вправляет иногда мозги на место. И зачастую приносит немало информации!
... жаль, что такие обсуждения со временем теряются...
Eng:
Thank you all for discussing such topics! This sometimes puts the brains in place. And often brings a lot of information!
... it's a pity that such discussions are lost over time...