Tagged articles

constants

21 articles · Page 1 of 1
CodeNotes
CodeNotes
May 25, 2026 · Fundamentals

Master Java Enums: Safer, More Readable Alternative to Magic Numbers

Java enums replace magic numbers with meaningful, type‑safe constants, improving readability and safety; the guide covers basic definitions, core methods, typical usages like switch statements and iteration, advanced features with fields and constructors, a comparison with static‑final constant classes, and common pitfalls to avoid.

EnumJavabest practices
0 likes · 6 min read
Master Java Enums: Safer, More Readable Alternative to Magic Numbers
Java Tech Workshop
Java Tech Workshop
May 18, 2026 · Fundamentals

Understanding Compile-Time and Run-Time Constants in Java

This article explains the fundamental differences between compile-time and run-time constants in Java, covering their definitions, required modifiers, allowed data types, initialization rules, JVM storage behavior, class‑initialization effects, constant‑folding optimizations, practical code examples, common pitfalls, and guidelines for choosing the appropriate constant type in production code.

JVMJavabest practices
0 likes · 21 min read
Understanding Compile-Time and Run-Time Constants in Java
Lisa Notes
Lisa Notes
Mar 16, 2026 · Fundamentals

Java Basics: Variables and Constants Explained from Scratch

This note introduces Java constants and variables, covering their definitions, naming conventions, declaration syntax, initialization rules, multiple declarations, and how constants differ from mutable variables through concrete code examples.

JavaProgramming BasicsVariables
0 likes · 7 min read
Java Basics: Variables and Constants Explained from Scratch
Liangxu Linux
Liangxu Linux
Aug 31, 2025 · Fundamentals

Mastering C++ static: 6 Powerful Uses You Must Know

This article explains the versatile static keyword in C++ by covering six practical patterns—including local static variables, file‑scope static globals, static class members, static member functions, lazy‑initialized singletons, and compile‑time constants—complete with clear code examples and usage tips.

C++Singletonconstants
0 likes · 9 min read
Mastering C++ static: 6 Powerful Uses You Must Know
Liangxu Linux
Liangxu Linux
Jul 10, 2025 · Fundamentals

When to Use const vs constexpr in C++? A Practical Guide

This article explains the differences between C++ const and constexpr, using a kettle analogy, detailed code examples, and practical guidelines to help developers choose the right keyword for compile‑time or runtime constants, improve performance, and write safer code.

C++best practicescompile-time
0 likes · 8 min read
When to Use const vs constexpr in C++? A Practical Guide
php Courses
php Courses
Dec 6, 2024 · Backend Development

Using define() to Create Constants in PHP

This article explains how to use PHP's define() function to create constants, detailing its syntax, parameters, a practical example, and important considerations such as naming rules, case sensitivity, immutability, and typical naming conventions.

backendconstantsdefine
0 likes · 3 min read
Using define() to Create Constants in PHP
php Courses
php Courses
Dec 3, 2024 · Backend Development

Understanding PHP Constants: Definition, Usage, and Best Practices

This article explains what PHP constants are, how to define them with define() or const, showcases practical examples, outlines their benefits such as data consistency and global access, and provides best‑practice guidelines for using constants effectively in backend development.

backendconstconstants
0 likes · 4 min read
Understanding PHP Constants: Definition, Usage, and Best Practices
Model Perspective
Model Perspective
May 30, 2024 · Fundamentals

What Is the N‑bonacci Sequence? Exploring Generalized Fibonacci Numbers

This article introduces the N‑bonacci sequence—a generalization of the classic Fibonacci series where each term is the sum of the preceding N terms—explaining its definition, initial conditions, recurrence relation, key properties, N‑bonacci constants, and examples such as 3‑bonacci and infinite‑bonacci.

N-bonacciconstantsgeneralized Fibonacci
0 likes · 6 min read
What Is the N‑bonacci Sequence? Exploring Generalized Fibonacci Numbers
AI Cyberspace
AI Cyberspace
Mar 4, 2023 · Fundamentals

Master C Variables, Constants, and Scope: From #define to static

This article explains C variables and constants, their three components, key differences, how to define symbolic constants with #define, use the const keyword, understand various scopes, the static storage class, and the distinction between declarations and definitions, all illustrated with code examples.

C#ScopeVariables
0 likes · 12 min read
Master C Variables, Constants, and Scope: From #define to static
MaGe Linux Operations
MaGe Linux Operations
Sep 1, 2021 · Backend Development

Master Go Enums with const and iota: A Practical Guide

This article explains how Go implements enumeration using const and the iota counter, provides step‑by‑step code examples, demonstrates alternative type‑based enum patterns, and shows how to add a String method for readable output, helping developers write clean, maintainable constant definitions.

Enumbackendconstants
0 likes · 5 min read
Master Go Enums with const and iota: A Practical Guide
Python Crawling & Data Mining
Python Crawling & Data Mining
Oct 15, 2020 · Backend Development

Master Go Variables: Types, Declarations, and Best Practices

This article introduces Go language variable fundamentals, explaining why variables are needed, common types, various declaration methods—including explicit typing, type inference, short declaration, global and anonymous variables—and constant usage, complemented by code examples and practical tips for effective Go programming.

GoVariablesconstants
0 likes · 7 min read
Master Go Variables: Types, Declarations, and Best Practices
21CTO
21CTO
Dec 24, 2016 · Backend Development

How to Define Persistent Constants in a PHP 7.x Extension

This article explains step‑by‑step how to add, register, and correctly clean up persistent constants in a PHP 7.x extension, covering the necessary macro calls, hash‑destroy functions, and a common fatal‑error pitfall with its solution.

Extension DevelopmentPHPconstants
0 likes · 6 min read
How to Define Persistent Constants in a PHP 7.x Extension