Landaylanday.hashnode.dev·Nov 25, 2024使用zod时的注意:nullable vs optional定义zod schema的时候,有时候定义为nullable时要注意:如果你是从一个可能为空的对象里取出一个字段来parse的时候,可能会出现问题: const schema = z.object({ a: z.string().nullable() }); const rawData = { nested: null }; const data = schema.parse({ a: rawData.nested?.a }); 会导致throw,程序无法继续下去。 解决办法:...zod
Ashwini Jangetolblog.ashwinijangetol.dev·Aug 13, 2024How null in Python works under the hoodThe concept of null is fundamental across programming languages for representing the absence of a value. Null signifies that a variable exists but doesn’t currently hold any data. It’s used to represent a lack of value, a non-existent object, or an u...3 likes·53 readsPythonPython 3
Prince Patelprincewrite.hashnode.dev·Aug 6, 2024Understanding Null in JavaScript: A Primitive or an Object?JavaScript is full of quirks, and one of the most puzzling is the treatment of null. While the official ECMAScript specification defines null as a primitive value, using the typeof operator reveals a surprising result: it returns "object". This appar...1 likeJavaScript
Maxi Contierimaximilianocontieri.com·Jul 28, 2024Refactoring 015 - Remove NULLTL;DR: Use the Null Object Pattern to eliminate null checks and simplify your code. Problems Addressed Frequent null checks and IFs cluttering your code Null pointer exceptions Hard-to-read and maintain code Lack of extensibility Unnecessary co...47 readsRefactoringsGeneral Programming
Maxi Contierimaximilianocontieri.com·Jul 20, 2024Code Smell 260 - Crowdstrike NULLTL;DR: Using null pointers in critical code can crash your system Problems Memory access violation Unpredictable behavior Null Pointer Dereference Unexpected program termination System instability No healing/recovery strategy Security Risk ...126 readsCode SmellsGeneral Programming
Merge Simpsonblog.letsdev.me·May 23, 2024Java: Null 안정성에 좋은 Optional 클래스, 이제 이렇게 써야 깔끔합니다.Optional은 무엇인가요? Optional 때문에 코드가 난잡하게 된다면 어떻게 해야 할까요? 글의 발단 무분별한 옵셔널 사용으로 코드가 깔끔하지 않다고 느낄 때가 있다는 사연을 예전에 들은 적이 있습니다. 그래서 저는 어떤 이유로 어떻게 관리하고 있는지 설명을 했고, 이를 결국 글로도 남기기로 결정했습니다. Java Optional이란? 자바의 NULL 안정성을 위한 표준 API 클래스입니다. null일 수도 있는 값을 감싸서(박싱 해...40 readsJava
DbVisualizerthetable.hashnode.dev·May 23, 2024Quick Guide to PostgreSQL ISNULL Functionality AlternativesThis guide offers a concise look at how PostgreSQL deals with the absence of the ISNULL function, introducing alternatives like COALESCE and CASE. In PostgreSQL, you might use COALESCE to handle NULLs: -- PostgreSQL SELECT COALESCE(stock_level, 0) AS...Null
Gitar, Incgitar.hashnode.dev·Mar 28, 2024Automating Java Codebase Annotations for Null SafetyThis is Part II of our series of posts on retrofitting null safety onto existing programming languages. In Part I of this series, we introduced NullAway, a pluggable type system for nullability for Java, which can prevent NullPointerException (NPE) c...nullaway
manish maharjanforJoBins Engineeringblog.jobins.jp·Mar 25, 2024Understanding null and undefinedNull and undefined are both are primitive data types in JavaScript. Both provides the similar feelings when observed at theoretical level. Sometime times the consequence are more debugging and clarification for the usage of these two values. Null The...15 likes·26 readsnull vs undefined
Deon Slabbertbecomingaprogrammer.hashnode.dev·Nov 27, 2023Database Design Gone BadIt is important that you understand the contents of this article. Together with the next article, it forms the knowledge you need to do good database designs. So, please make sure you understand the things discussed here before you proceed. Data Redu...Database Design Fundamentalsdatabase