CommunityNews

CommunityNews

Avoid Yoda conditions in Perl you should

Avoid Yoda conditions in Perl you should—The Phoenix Trap.
Assign not when mean to compare you do. Help you warnings and strictures can.

Read in full here:

https://phoenixtrap.com/2021/12/28/avoid-yoda-conditions-in-perl-you-should/

This thread was posted by one of our members via one of our news source trackers.

Most Liked

davearonson

davearonson

Not just Perl; this used to be fairly common in C. Eventually we developed the convention that if you really did mean to assign and compare the results of that, as in if (c = getc()) you would wrap it in an extra set of parentheses, like if ((c = getc())). Then, the compiler would use that as a “yes I really meant to do that” signal.

On the other claw, Perl never was exactly famous for readability…

Popular Backend topics Top

CommunityNews
Microsoft is trying to leapfrog competitors like Google and Amazon as they face record antitrust scrutiny. The big picture: The deals ...
New
First poster: bot
Ruby: How to Run a Rack app in a Background Thread. Stubbing and mocking are fine, but sometimes you want to test full integration. This...
New
First poster: bot
GitHub - vydd/sketch: A Common Lisp framework for the creation of electronic art, visual design, game prototyping, game making, computer ...
New
First poster: OvermindDL1
GitHub - deadpixi/wasm-maze-generator: A simple WASM maze generator in Go. A simple WASM maze generator in Go. Contribute to deadpixi/wa...
New
First poster: bot
GitHub - vitalik/django-ninja: :dash: Fast, Async-ready, Openapi, type hints based framework for building APIs. :dash: Fast, Async-rea...
New
First poster: bot
Hacking sum types with Go generics. Go doesn’t have sum types, but generics get us one step closer to a useful polyfill. If you’ve ever ...
New
First poster: OvermindDL1
GitHub - mcobzarenco/zee: A modern text editor for the terminal written in Rust. A modern text editor for the terminal written in Rust -...
New

Other popular topics Top

PragmaticBookshelf
“Finding the Boundaries” Hero’s Journey with Noel Rappin @noelrappin Even when you’re ultimately right about what the future ho...
New
DevotionGeo
The V Programming Language Simple language for building maintainable programs V is already mentioned couple of times in the forum, but I...
New
AstonJ
We’ve talked about his book briefly here but it is quickly becoming obsolete - so he’s decided to create a series of 7 podcasts, the firs...
New
AstonJ
Was just curious to see if any were around, found this one: I got 51/100: Not sure if it was meant to buy I am sure at times the b...
New
AstonJ
If you want a quick and easy way to block any website on your Mac using Little Snitch simply… File > New Rule: And select Deny, O...
New
PragmaticBookshelf
Author Spotlight: VM Brasseur @vmbrasseur We have a treat for you today! We turn the spotlight onto Open Source as we sit down with V...
New
PragmaticBookshelf
Author Spotlight: Karl Stolley @karlstolley Logic! Rhetoric! Prag! Wow, what a combination. In this spotlight, we sit down with Karl ...
New
DevotionGeo
I have always used antique keyboards like Cherry MX 1800 or Cherry MX 8100 and almost always have modified the switches in some way, like...
New
First poster: bot
zig/http.zig at 7cf2cbb33ef34c1d211135f56d30fe23b6cacd42 · ziglang/zig. General-purpose programming language and toolchain for maintaini...
New
AstonJ
This is a very quick guide, you just need to: Download LM Studio: https://lmstudio.ai/ Click on search Type DeepSeek, then select the o...
New