Exceptionally Bad: The Story on the Misuse of Exceptions and How to Do Better
Exceptionally Bad: The story on the misuse of exceptions and how to do better Core C++ June 7, 2023 Pete Muldoon Senior Engineering Lead© 2023 Bloomberg Finance L.P. All rights reserved. Exceptionally Bad: The 11 Bloomberg Exceptional Ideals12 Bloomberg Exceptional Ideals enum MyStatus { good, not_good, bad}; MyStatus applyX(MyClass& out); int main() { bool stay_active = true; while (stay_active) { MyClass } Clutter Function signature13 Bloomberg Exceptional Ideals enum MyStatus { good, not_good, bad}; // Throws MyStatus on error void apply(MyClass& out); int main() { bool stay_active = true; while0 码力 | 85 页 | 2.32 MB | 5 月前3Firebird 2.1 ErrorCodes
stream 0 335741039 gfix_opt_SQL_dialect -sql_dialect set database dialect n 0 335544875 bad_debug_format Bad debug info format -84 335544554 nonsql_security_rel Table/procedure has non-SQL security operation. -85 335544750 password_required A password is required for this operation -85 335544751 bad_protocol The network protocol specified is invalid -85 335544752 dup_usrname_found A duplicate user -104 335544426 ctxnotdef Context not defined (BLR error) -104 335544429 badparnum Bad parameter number -104 335544440 bad_msg_vec -104 335544456 invalid_sdl Invalid slice description language at offset0 码力 | 31 页 | 103.24 KB | 1 年前3Firebird 2.0 ErrorCodes
operation. -85 335544750 password_required A password is required for this operation -85 335544751 bad_protocol The network protocol specified is invalid -85 335544752 dup_usrname_found A duplicate user -104 335544426 ctxnotdef Context not defined (BLR error) -104 335544429 badparnum Bad parameter number -104 335544440 bad_msg_vec -104 335544456 invalid_sdl Invalid slice description language at offset or COLLATE -204 335544662 dsql_blob_type_unknown BLOB SUB_TYPE %s is not defined -204 335544759 bad_default_value Can not define a not null column with NULL as default value -204 335544760 invalid_clause0 码力 | 26 页 | 157.59 KB | 1 年前3Firebird 1.5 ErrorCodes
operation. -85 335544750 password_required A password is required for this operation -85 335544751 bad_protocol The network protocol specified is invalid -85 335544752 dup_usrname_found A duplicate user -104 335544426 ctxnotdef Context not defined (BLR error) -104 335544429 badparnum Bad parameter number -104 335544440 bad_msg_vec -104 335544456 invalid_sdl Invalid slice description language at offset p. 5 -204 335544662 dsql_blob_type_unknown BLOB SUB_TYPEis not defined -204 335544759 bad_default_value Can not define a not null column with NULL as default value -204 335544760 invalid_clause 0 码力 | 26 页 | 85.09 KB | 1 年前3Better Code: Contracts
push_back(e.second); } 76 struct bad { bad(const bad&); }; zip_vectorbad> v; bad::bad(const bad&) { print("{}", v.back()); } ... v.push_back({42, bad{}}); broken invariant© 2023 Adobe push_back(e.second); } 77 struct bad { bad(const bad&); }; zip_vector bad> v; bad::bad(const bad&) { print("{}", v.back()); } ... v.push_back({42, bad{}}); broken invariant© 2023 Adobe push_back(e.second); } 78 struct bad { bad(const bad&); }; zip_vector bad> v; bad::bad(const bad&) { print("{}", v.back()); } ... v.push_back({42, bad{}}); broken invariant© 2023 Adobe 0 码力 | 204 页 | 4.46 MB | 5 月前3Bridging the Gap: Writing Portable Programs for CPU and GPU
template 3 The dark path Function dispatch triple 4 Cuda proposal Conditional host device Forbid bad cross function calls 3/664/66 Motivation Patterns The dark path Cuda proposal Thank you Motivation Motivation: Quiz time12/66 Motivation Patterns The dark path Cuda proposal Thank you Quiz time: Bad cross function calls � � 1 struct H { __host__ int func() { return 42; } }; 2 3 struct D { __device__ >(); 13 } � � nvcc 12.612/66 Motivation Patterns The dark path Cuda proposal Thank you Quiz time: Bad cross function calls � � 1 struct H { __host__ int func() { return 42; } }; 2 3 struct D { __device__0 码力 | 124 页 | 4.10 MB | 5 月前3firebird language reference 30 rus
Процедурный язык PSQL 385 Пример 6.35. Использование параметризованного исключения CREATE EXCEPTION EX_BAD_SP_NAME 'Name of procedures must start with ''@1'' : ''@2'''; ... CREATE TRIGGER TRG_SP_CREATE BEFORE RDB$GET_CONTEXT('DDL_TRIGGER', 'OBJECT_NAME'); IF (SP_NAME NOT STARTING 'SP_') THEN EXCEPTION EX_BAD_SP_NAME USING ('SP_', SP_NAME); END^ Пример 6.36. Регистрация ошибке в журнале последней. 0 335741039 gfix_opt_SQL_dialect -sql_dialect set database dialect n. 0 335544875 bad_debug_format Bad debug info format. Неверный формат отладочной информации. -84 335544554 nonsql_security_rel0 码力 | 719 页 | 3.98 MB | 1 年前3Agda User Manual v2.6.0.1
line2 cases are mixed up). c2t_bad : S¹ × S¹ → Torus c2t_bad (base , base) = point c2t_bad (loop i , base) = line2 i c2t_bad (base , loop j) = line1 j c2t_bad (loop i , loop j) = square i j Functions declarations such as data Bad : Set where bad : (Bad → Bad) → Bad -- A B C -- A is in a negative position, B and C are OK since there is a negative occurrence of Bad in the type of the the argument of the constructor. (Note that the corresponding data type declaration of Bad is allowed in standard functional languages such as Haskell and ML.). Non strictly-positive declarations are rejected0 码力 | 256 页 | 247.15 KB | 1 年前3Agda User Manual v2.6.0
line2 cases are mixed up). c2t_bad : S¹ × S¹ → Torus c2t_bad (base , base) = point c2t_bad (loop i , base) = line2 i c2t_bad (base , loop j) = line1 j c2t_bad (loop i , loop j) = square i j Functions declarations such as data Bad : Set where bad : (Bad → Bad) → Bad -- A B C -- A is in a negative position, B and C are OK since there is a negative occurrence of Bad in the type of the the argument of the constructor. (Note that the corresponding data type declaration of Bad is allowed in standard functional languages such as Haskell and ML.). Non strictly-positive declarations are rejected0 码力 | 256 页 | 246.87 KB | 1 年前3Agda User Manual v2.5.2
declarations such as data Bad : Set where bad : (Bad → Bad) → Bad -- A B C -- A is in a negative position, B and C are OK since there is a negative occurrence of Bad in the type of the the argument of the constructor. (Note that the corresponding data type declaration of Bad is allowed in standard functional languages such as Haskell and ML.). Non strictly-positive declarations are rejected declaration of Bad is allowed, it is possible to construct a term of the empty type, even without recursion. {-# OPTIONS --no-positivity-check #-} data ⊥ : Set where data Bad : Set where bad : (Bad → ⊥) →0 码力 | 151 页 | 152.49 KB | 1 年前3
共 1000 条
- 1
- 2
- 3
- 4
- 5
- 6
- 100