I’m getting rather hacked off seeing boolean properties typed as strings. Stringly typed is a phrase I learnt off a post from the excellent Coding Horror blog and it describes a phenomena whereby properties that are of a specific type, e.g. Boolean, Date, int, are stored needlessly as strings.
I’m working on a website that communicates with a money laundering service to check whether an individual is “bad” or not. Individuals can pass the test, but importantly it is possible to pass the test with some warning flags raised. If any of the warning flags are raised then an email should be sent off to compliance for them to do…whatever it is they do. Fair enough right?
The warning flags are obviously booleans. There was either a warning raised or there wasn’t – there are no two ways about it (no pun intended). In the serialized response, the warning flags are encoded as “Yes” or “No”…which is understandable. Now, upon receiving the response, it is parsed and turned into an internal representation. This is where things get really weird. The programmer that coded the object that stores the response from the service has decided to encode the warnings as strings, initialised to “”. Which is totally fucking bonkers.
Why?
Well, now our boolean warnings aren’t really booleans – they have WAY more than two possible values and the meaning of these values is subjective. One may consider “”, null, “No” as false, but could conceivably also consider “false” or “0″. We get the same sort of problem with true – “Yes”, “1″, “true” and then we get a whole load of unknown values which is every other possible string in the world. Which might be considered to be true.
So how the hell can any number of programmers work on this piece of code without introducing errors because of differing definitions of truthy and falsey values? Well, they can’t. To illustrate the problem further, even loosely typed languages differ in their boolean coercion, for example JavaScript and PHP:
<script>
if("0") alert('Opposite day!');
</script>
<?php
if("0") echo 'Opposite day!';
?>
JavaScript considers “0″ true but PHP considers it false. Personally I think JavaScript is “right” here, but as I said before, it is totally subjective.
The icing on the cake is of course the extra code you have to write to check the truthy or falsey string values. Something along the lines of “if x is not null and not empty and not the word No then it is probably true…probably”, which would otherwise have been coded as “if x then true” if x was a boolean – which is orders of magnitude shorter.
Of course, there are some bat shit crazy strongly typed languages that allow you to assign null to a Boolean, but that is a different story altogether.
unifiedtrustvision.bond – Organized interface, users can easily navigate while trusting the information provided.
intentional decision aid – Feels supportive without being overwhelming.
PetalVistaShop – Items easy to locate with a calm, organized interface.
Direct project access – The pages are logically ordered, with details presented in a professional way.
shopping idea source – Interesting approach with relevant information.
trustcenter.bond – Clear interface, messaging highlights credibility and straightforward information.
задвижка 30с41нж 250 задвижка 30с41нж
start exploring now – Text inspires curiosity and the willingness to try something new.
EcoGrowthHub – Provides insights into sustainable business practices and long-term success.
anchorpoint.bond – User-friendly layout, pages communicate commitment and clarity naturally.
investment insight hub – Organized content makes exploring bonds simple and clear.
bondcore.bond – Simple interface, content is straightforward and inspires confidence in the message.
solid investment page – Clear, practical, and well-laid-out, perfect for bond exploration.
Bonded Future Hub – Clean, forward-thinking design communicates professionalism and trust.
https://vc.ru/2305943 Накрутка Твиттер – Мои 20 лайфхаков в 2026 году
clarity & purpose portal – Helps understand concepts clearly while motivating action.
XylorDirect – Navigation easy, product info readable, and site performance reliable.
northwindco.shop – User-friendly design, store navigation is clear and buying items is easy.
aurumlane shop – Elegant interface, products are easy to explore and the layout feels balanced.
urbanwavefocus.bond – Clean design, website feels responsive and the information is digestible.
affordable buys online – Smooth shopping experience, everything feels organized and easy.
directional guidance link – Feels reassuring and thoughtfully composed.
>mobile speed page – Very light, easy to navigate, and fast on phones.
TrustedConnections – Simplifies discovering reliable business contacts and opportunities.
trustpillar.bond – Balanced design, content communicates dependability and shared focus naturally.
bridgecapital.bond – Clean and approachable, messaging emphasizes trust and easy navigation.
secure investment portal – Layout is clear, with information easy to absorb.
ethicalcore.bond – Practical design, content communicates trust and responsible decision-making clearly.
bond services page – Fast-loading pages, clear structure, and effortless navigation.
smartbuy shoproute – User-friendly layout, shopping flows naturally and comfortably.
Trusted Nexus Core – Site feels professional, content is easy to follow and dependable.
opalcrestmarket.shop – Well organized, items are easy to explore and purchasing feels straightforward.
build & grow hub – Platform feels organized and encourages steady advancement.
smarter development paths – Useful platform, supports effective strategy building for businesses.
action pathway – Text promotes decisive movement while keeping clarity central.
progresscatalystalliance.bond – Informative and concise, messaging inspires practical forward movement.
product depot site – Browsing is effortless with well-labeled sections.
intentional progress space – Indicates a balanced blend of planning, growth, and reflection.
XanixDirect – Interface professional, pages responsive, and checkout process uncomplicated.
innovative ideas hub – Easy to follow, presents creative strategies clearly for everyone.
midnight cove selection – Dark presentation is appealing, product discovery is quick and checkout is user-friendly.
solidunity.bond – Modern layout, site projects confidence while maintaining a clear, approachable style.
SafeClick – Lets shoppers enjoy a secure experience with quick, reliable checkout.
bond planning portal – Easy to use, provides useful insights for daily financial decisions.
shopcurve marketplace – Fresh visuals, browsing products is intuitive and quick.
clean layout link – Well presented and easy to process in seconds.
Free kick walls, defensive organization and block statistics
affordable finds site – Easy to navigate, prices are reasonable and items are well-categorized.
QuickShopper – Streamlines product browsing and helps complete purchases effortlessly.
creative concepts click – Bright and engaging, sparks imagination across multiple projects.