
To be, or not to be, that is the question
Translating it into code, we get
theQuestion = 2b || !2b
This returns true
for any value of 2b
, making the evaluation redundant. We can optimise it by removing the expression and substituting with the result.
theQuestion = true
Stack Overflow
Q&A for professional and enthusiast programmers
Meta Stack Exchange
Q&A for meta-discussion of the Stack Exchange family of Q&A websites
Worldbuilding
Q&A for writers/artists using science, geography and culture to construct imaginary worlds and settings
Role-playing Games
Q&A for gamemasters and players of tabletop, paper-and-pencil role-playing games
Science Fiction & Fantasy
Q&A for science fiction and fantasy enthusiasts
Software Engineering
Q&A for professionals, academics, and students working within the systems development life cycle
Stack Apps
Q&A for apps, scripts, and development with the Stack Exchange API
Code Review
Q&A for peer programmer code reviews
Information Security
Q&A for information security professionals
The Workplace
Q&A for members of the workforce navigating the professional setting
Programming Language Design and Implementation
Q&A for designers and implementers of computer programming languages
Arqade
Q&A for passionate videogamers on all platforms
Russian Language
Q&A for students, teachers, and linguists wanting to discuss the finer points of the Russian language
English Language & Usage
Q&A for linguists, etymologists, and serious English language enthusiasts
Law
Q&A for legal professionals, students, and others with experience or interest in law
User Experience
Q&A for user experience researchers and experts
Mathematics
Q&A for people studying math at any level and professionals in related fields
WordPress Development
Q&A for WordPress developers and administrators
Philosophy
Q&A for those interested in the study of the fundamental nature of knowledge, reality, and existence
Unix & Linux
Q&A for users of Linux, FreeBSD and other Un*x-like operating systems
Writing
Q&A for the craft of professional writing, including fiction, non-fiction, technical, scholarly, and commercial writing
Biblical Hermeneutics
Q&A for professors, theologians, and those interested in exegetical analysis of biblical texts
Cardano
Q&A for users and developers of the Cardano cryptocurrency ecosystem
Matter Modeling
Q&A for materials modelers and data scientists
Video Production
Q&A for engineers, producers, editors and enthusiasts spanning the fields of video and media creation
Lifehacks
Q&A for people looking to bypass life's everyday problems with simple tricks
Русский язык
Cайт вопросов и ответов для лингвистов и энтузиастов русского языка
Pets
Q&A for pet owners, caretakers, breeders, veterinarians, and trainers
Ukrainian Language
Q&A for linguists, teachers and students of the Ukrainian language
Literature
Q&A for scholars and enthusiasts of literature
DevOps
Q&A for software engineers working on automated testing, continuous delivery, service integration and monitoring, and building SDLC infrastructure
Earth Science
Q&A for those interested in the geology, meteorology, oceanography, and environmental sciences
Gardening & Landscaping
Q&A for gardeners and landscapers
Mathematica
Q&A for users of Wolfram Mathematica
Graphic Design
Q&A for Graphic Design professionals, students, and enthusiasts
Expatriates
Q&A for people living abroad on a long-term basis
Motor Vehicle Maintenance & Repair
Q&A for mechanics and DIY enthusiast owners of cars, trucks, and motorcycles
Mathematics Educators
Q&A for those involved in the field of teaching mathematics
Freelancing
Q&A for self-employed and freelance workers
Engineering
Q&A for professionals and students of engineering
Arduino
Q&A for developers of open-source hardware and software that is compatible with Arduino
Operations Research
Q&A for operations research and analytics professionals, educators, and students
Aviation
Q&A for aircraft pilots, mechanics, and enthusiasts
Quantitative Finance
Q&A for finance professionals and academics
Tor
Q&A for researchers, developers, and users of Tor
Monero
Q&A for developers and users of the secure, private and untraceable cryptocurrency Monero
Space Exploration
Q&A for spacecraft operators, scientists, engineers, and enthusiasts
Chinese Language
Q&A for students, teachers, and linguists wanting to discuss the finer points of the Chinese language
Homebrewing
Q&A for dedicated home brewers and serious enthusiasts
Theoretical Computer Science
Q&A for theoretical computer scientists and researchers in related fields
Chess
Q&A for serious players and enthusiasts of chess
Puzzling
Q&A for those who create, solve, and study puzzles
Christianity
Q&A for committed Christians, experts in Christianity and those interested in learning more
Stack Overflow em Português
Perguntas e respostas para programadores profissionais e entusiastas
Retrocomputing
Q&A for vintage-computer hobbyists interested in restoring, preserving, and using the classic computer and gaming systems of yesteryear
Linguistics
Q&A for professional linguists and others with an interest in linguistic research and theory
Japanese Language
Q&A for students, teachers, and linguists wanting to discuss the finer points of the Japanese language
Psychology & Neuroscience
Q&A for practitioners, researchers, and students in cognitive science, psychology, neuroscience, and psychiatry
Robotics
Q&A for professional robotic engineers, hobbyists, researchers and students
Sustainable Living
Q&A for folks dedicated to a lifestyle that can be maintained indefinitely without depleting available resources
Language Learning
Q&A for students, teachers, polyglots, and anyone interested in the techniques of second-language acquisition
EOS.IO
Q&A for users and developers of distributed applications built on top of the blockchain operating system, EOS.IO
Stellar
Q&A for developers and users of Stellar and the Stellar Distributed Exchange
Craft CMS
Q&A for administrators, end users, developers and designers for Craft CMS
French Language
Q&A for students, teachers, and linguists wanting to discuss the finer points of the French language
Portuguese Language
Q&A for linguists, teachers and learners wanting to discuss the finer points of the Portuguese language
Bioinformatics
Q&A for researchers, developers, students, teachers, and end users interested in bioinformatics
Computer Graphics
Q&A for computer graphics researchers and programmers
Spanish Language
Q&A for linguists, teachers, students and Spanish language enthusiasts in general wanting to discuss the finer points of the language
Parenting
Q&A for parents, grandparents, nannies and others with a parenting role
CiviCRM
Q&A for administrators and users of the CiviCRM Constituent Relationship Management software
Martial Arts
Q&A for students and teachers of all martial arts
Quantum Computing
Q&A for engineers, scientists, programmers, and computing professionals interested in quantum computing
Tezos
Q&A for users, experts, and developers of the Tezos blockchain project
Computational Science
Q&A for scientists using computers to solve scientific problems
German Language
Q&A for speakers of German wanting to discuss the finer points of the language and translation
The Great Outdoors
Q&A for people who love being outdoors enjoying nature and wilderness, and learning about the required skills and equipment
Bitcoin
Q&A for Bitcoin users, developers, and enthusiasts
Coffee
Q&A for people interested in all aspects of producing and consuming coffee
Internet of Things
Q&A for builders and users of networked sensors and control devices in the contexts of smart homes, industry automation, or environmental sensors
Mi Yodeya
Q&A for those who base their lives on Jewish law and tradition and anyone interested in learning more
Signal Processing
Q&A for practitioners of the art and science of signal, image and video processing
Stack Overflow на русском
Вопросы и ответы для программистов
Photography
Q&A for professional, enthusiast and amateur photographers
Joomla
Q&A for Joomla! administrators, users, developers and designers
Open Source
Q&A for people organizing, marketing or licensing open source development projects
Mythology & Folklore
Q&A for enthusiasts and scholars of mythology and folklore
Cross Validated
Q&A for people interested in statistics, machine learning, data analysis, data mining, and data visualization
Latin Language
Q&A for linguists, teachers, and students wanting to discuss the finer points of the Latin language
Computer Science
Q&A for students, researchers and practitioners of computer science
Board & Card Games
Q&A for people who like playing board games, designing board games or modifying the rules of existing board games
Raspberry Pi
Q&A for users and developers of hardware and software for Raspberry Pi
Vi and Vim
Q&A for people using the vi and Vim families of text editors
Buddhism
Q&A for people practicing or interested in Buddhist philosophy, teaching, and practice
Sound Design
Q&A for sound engineers, producers, editors, and enthusiasts
Hinduism
Q&A for followers of the Hindu religion and those interested in learning more about Hinduism
Travel
Q&A for road warriors and seasoned travelers
Biology
Q&A for biology researchers, academics, and students
Astronomy
Q&A for astronomers and astrophysicists
Bicycles
Q&A for people who build and repair bicycles, people who train cycling, or commute on bicycles
Politics
Q&A for people interested in governments, policies, and political processes
Code Golf
Q&A for programming puzzle enthusiasts and code golfers
Cryptography
Q&A for software developers, mathematicians and others interested in cryptography
Software Quality Assurance & Testing
Q&A for software quality control experts, automation engineers, and software testers
Database Administrators
Q&A for database professionals who wish to improve their database skills and learn from others in the community
History of Science and Mathematics
Q&A for people interested in the history and origins of science and mathematics
Game Development
Q&A for professional and independent game developers
Physics
Q&A for active researchers, academics and students of physics
Artificial Intelligence
Q&A for people interested in conceptual questions about life and challenges in a world where "cognitive" functions can be mimicked in purely digital environment
Academia
Q&A for academics and those enrolled in higher education
Computer Science Educators
Q&A for those involved in the field of teaching Computer Science
Seasoned Advice
Q&A for professional and amateur chefs
English Language Learners
Q&A for speakers of other languages learning English
Islam
Q&A for Muslims, experts in Islam, and those interested in learning more about Islam
Beer, Wine & Spirits
Q&A for alcoholic beverage aficionados and those interested in beer, wine, or spirits
Android Enthusiasts
Q&A for enthusiasts and power users of the Android operating system
Drupal Answers
Q&A for Drupal developers and administrators
Home Improvement
Q&A for contractors and serious DIYers
Sports
Q&A for participants in team and individual sport activities
Personal Finance & Money
Q&A for people who want to be financially literate
Ask Different
Q&A for power users of Apple hardware and software
Stack Overflow en español
Preguntas y respuestas para programadores y profesionales de la informática
Economics
Q&A for those who study, teach, research and apply economics and econometrics
Sitecore
Q&A for developers and end users of the Sitecore CMS and multichannel marketing software
Web Applications
Q&A for power users of web applications
Reverse Engineering
Q&A for researchers and developers who explore the principles of a system through analysis of its structure, function, and operation
Blender
Q&A for people who use Blender to create 3D graphics, animations, or games
Geographic Information Systems
Q&A for cartographers, geographers and GIS professionals
Chemistry
Q&A for scientists, academics, teachers, and students in the field of chemistry
Korean Language
Q&A for linguists, teachers and students of the Korean language
Ethereum
Q&A for users of Ethereum, the decentralized application platform and smart contract enabled blockchain
Data Science
Q&A for Data science professionals, Machine Learning specialists, and those interested in learning more about the field
Electrical Engineering
Q&A for electronics and electrical engineering professionals, students, and enthusiasts
TeX - LaTeX
Q&A for users of TeX, LaTeX, ConTeXt, and related typesetting systems
Magento
Q&A for users of the Magento e-Commerce platform
Salesforce
Q&A for Salesforce administrators, implementation experts, developers and anybody in-between
Software Recommendations
Q&A for people seeking specific software recommendations
Physical Fitness
Q&A for physical fitness professionals, athletes, trainers, and those providing health-related needs
Woodworking
Q&A for professional and amateur woodworkers
Music: Practice & Theory
Q&A for musicians, students, and enthusiasts
Open Data
Q&A for developers and researchers interested in open data
Hardware Recommendations
Q&A for people seeking specific hardware recommendations
Music Fans
Q&A for music historians, critics, and fans
Substrate and Polkadot
Q&A for developers building blockchains with the Substrate SDK
elementary OS
Q&A for developers and users of elementary OS and applications
Interpersonal Skills
Q&A for people looking to improve their interpersonal communication skills
GenAI
Q&A for GenAI enthusiasts and practitioners and those interested in learning more about using GenAI tools
Bioacoustics
Q&A for people interested in the studies of non-human animal sounds and the impacts of sounds on animals
Community Building
Q&A for community managers, administrators, and moderators
Veganism & Vegetarianism
Q&A for those committed to a vegan or vegetarian lifestyle and anyone interested in learning more
Ask Patents
Q&A for people interested in improving the patent system
Medical Sciences
Q&A for professionals in medical and allied health fields, students of those professions, related academics, and others with a sound understanding of medicine and healthcare-related sciences