Tagged articles
constants
21 articles · Page 1 of 1
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.
Best PracticesEnumJava
0 likes · 6 min read

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.
Best PracticesJVMJava
0 likes · 21 min read

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.
Javaconstantsprogramming basics
0 likes · 7 min read

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++Tutorialconstants
0 likes · 9 min read

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.
Best PracticesC++Runtime
0 likes · 8 min read

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.
BackendTutorialconstants
0 likes · 3 min read

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

This article explains Go's core concepts, covering package definitions and imports, variable declaration styles and scopes, as well as constant usage with iota, providing clear examples and code snippets to help developers understand and apply these fundamentals effectively.
Goconstantsiota
0 likes · 8 min read

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

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++constconstants
0 likes · 12 min read

This tutorial explains the fundamental differences between variables and constants in Python, demonstrates how variables are created, assigned, and typed, shows multiple assignment techniques, and clarifies why constants are merely a naming convention, all with clear code examples and illustrations.
assignmentconstantsprogramming fundamentals
0 likes · 7 min read

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.
BackendEnumconstants
0 likes · 5 min read

This article explains how to place shared functions in a Common.php file, define response fields such as status, message, httpstatus, and data, and extract repeated constants into a dedicated config file that can be accessed throughout a PHP project via the config() helper.
BackendCONFIGPHP
0 likes · 3 min read

This announcement details a free live streaming Java class scheduled for Sunday, October 24, covering preparation steps, a tutorial on constants, variables, data types, operators, type conversion, and basic object‑oriented concepts, along with information on optional paid Q&A services.
Javaconstantsdata types
0 likes · 11 min read

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.
Goconstantsdeclaration
0 likes · 7 min read

This article explains the concepts of variables and constants in Scala, describes how to declare them using 'var' and 'val', outlines type declaration syntax, demonstrates type inference, and shows examples of multiple variable declarations and tuple assignments.
Scalaconstantsprogramming fundamentals
0 likes · 4 min read

This article explains Python’s built‑in numeric objects—including integers, longs, floats, scientific notation, binary/octal/hex literals, fractions, boolean values, and complex numbers—while highlighting key differences between Python 2 and Python 3 arithmetic behaviors.
Pythonbooleancomplex numbers
0 likes · 6 min read

This article explains two ways to define and use global constants in Laravel 5.1, including creating a constants.php file in the config folder and modifying bootstrap/autoload.php, and notes the required file permissions for Linux servers.
LaravelLinuxPHP
0 likes · 2 min read

This article explains C/C++ constants—including integer, floating‑point, character, string, and symbolic forms—their syntax, examples, and common errors, and then covers variables, their definition, assignment, initialization, and related best‑practice notes.
C++c-programmingconstants
0 likes · 7 min read

This article explains Python’s built‑in numeric objects—including integers, longs, floats, complex numbers, booleans, and fractions—covers constant formats, version‑specific division behavior, and demonstrates how to use the Fraction class for precise rational arithmetic.
Pythonbooleancomplex numbers
0 likes · 6 min read


21CTODec 24, 2016 · Backend Development
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.
PHPconstantsextension development
0 likes · 6 min read
