• codinghorror Profile Picture

    Jeff Atwood @codinghorror

    6 years ago

    "the older I get the more I am enjoying dumb verbose code, over fancy concise code" via @samsaffron

    codinghorror tweet picture

    86 899 4K 0 117
    Download Image
  • rickbrewPDN Profile Picture

    Rick Brewster @rickbrewPDN

    6 years ago

    @codinghorror @samsaffron yes plz, totally agree -- let me use my brain cells for something other than decrypting your boolean expression masterpiece :)

    0 3 62 0 0
  • pragmaticml Profile Picture

    Madison May (e/ia) @pragmaticml

    6 years ago

    @codinghorror @tjmahr @samsaffron The vast majority of software should be written with other software devs as the target audience -- not a computer.

    2 0 6 0 0
  • ZaphodHarkonnen Profile Picture

    James S @ZaphodHarkonnen

    6 years ago

    @codinghorror @samsaffron I work on the fact that we read code dozens, if not hundreds, more times than we ever write it. So the focus is to write code that's easy to read first. Speed and size is secondary and only when absolutely essential.

    0 12 163 0 3
  • fernacolo Profile Picture

    Fernando Colombo @fernacolo

    6 years ago

    @codinghorror @samsaffron Younglings need to understand that a code is written once and read hundreds of time. Hence we must "optimize" for reads.

    1 1 11 0 0
  • peterhuntwelch Profile Picture

    John Luck Pickerd @peterhuntwelch

    6 years ago

    @codinghorror @samsaffron I’ve been fighting for short-circuiting over nesting my whole career

    1 0 10 0 0
  • sklivvz Profile Picture

    Marco Cecconi @sklivvz

    6 years ago

    @codinghorror @samsaffron I like how he stubbornly refuses to insert the last return statement because it's ruby after all

    0 0 10 0 0
  • GeekyEggo Profile Picture

    Richard @GeekyEggo

    6 years ago

    @codinghorror @samsaffron What language is this? I really like the way exiting early reads with the result defined first.

    1 0 9 0 0
  • shimpossible Profile Picture

    shim manning @shimpossible

    6 years ago

    @codinghorror @samsaffron I tend to call this style "bookish". The logic is lined up for easy scanning. You can also easily tell the order of eval. first example had you jumping back and forth to find matching (). adding a new line is super easy. exit early makes code look less like lisp ftw

    0 0 5 0 0
  • Nyadnar17 Profile Picture

    Nyadnar#17 @Nyadnar17

    6 years ago

    @codinghorror @samsaffron wipes tear from eye.

    0 0 5 0 0
  • noahlz Profile Picture

    [email protected] @noahlz

    6 years ago

    @codinghorror @shanecelis @samsaffron The second one is horrible too.

    1 0 5 0 0
  • erichfw Profile Picture

    Erich Wilgenbus-Lamb @erichfw

    6 years ago

    @codinghorror @samsaffron I honestly don't understand why people write code like shown on the top. Its awful.

    1 0 4 0 0
  • dannygarcia Profile Picture

    Danny Garcia @dannygarcia

    6 years ago

    @codinghorror @rsms @samsaffron Is this python? That `return () if` syntax is pretty elegant.

    3 0 3 0 0
  • pchapuis Profile Picture

    Pierre Chapuis @pchapuis

    6 years ago

    @codinghorror @samsaffron I agree with the idea, but I would say the clarity comes mostly from the ordering of the conditionals and the fact that it is a conjunction of disjunctions, not the use of early returns per se. In other words, this is still readable:

    pchapuis tweet picture

    1 0 3 0 0
    Download Image
  • tuananh_org Profile Picture

    🦄 Tuan-Anh Tran @tuananh_org

    6 years ago

    @codinghorror @samsaffron return early is always easy to read

    0 0 3 0 0
  • p_chmielowski Profile Picture

    Piotrek #StandWithUkraine🇺🇦 @p_chmielowski

    6 years ago

    @codinghorror @samsaffron @andrzejkrzywda You will like this one

    1 0 3 0 0
  • colehafner Profile Picture

    Cole Hafner @colehafner

    6 years ago

    @codinghorror @samsaffron The first CTO I worked for had a rule of one return statement per function. And his were not small functions. I knew it was dumb even back then. Simplicity and clarity > "cleverness" every single time.

    1 0 2 0 0
  • JamieRomanowski Profile Picture

    Jamie @JamieRomanowski

    6 years ago

    @codinghorror @samsaffron just call it something fancy like "expedited exist theroem" or "guard clause" and then everyone will accept it. #marketing

    1 0 2 0 0
  • pilat Profile Picture

    Vladimir Mityukov @pilat

    6 years ago

    @codinghorror @samsaffron I wouldn't call the bottom code "dumb". Obviously, the person is familiar with concept of "gurads", for instance. This is more "high level" concept.

    0 0 2 0 0
  • enobacon Profile Picture

    😀🚲 @[email protected] @enobacon

    6 years ago

    @codinghorror @samsaffron I'm not sure if you didn't add so much negated logic if it wouldn't be more clear.

    0 0 2 0 0
  • CraigEwert Profile Picture

    Craigeroonie @CraigEwert

    6 years ago

    @codinghorror @samsaffron Were these meant to be the same? They accept much different conditions.

    0 0 2 0 0
  • RungePhilipp Profile Picture

    Philipp Runge @RungePhilipp

    6 years ago

    @codinghorror @samsaffron Both is barely understandable. If you have conditions that complex, modulize the logic.

    1 0 1 0 0
  • nboukeffa Profile Picture

    Nadir Boukeffa @nboukeffa

    6 years ago

    @codinghorror @ValentinHervieu @samsaffron “Any fool can write code that a computer can understand. Good programmers write code that humans can understand.”

    0 0 1 0 0
  • Ted_Spence Profile Picture

    Ted Spence @Ted_Spence

    6 years ago

    @codinghorror @samsaffron Old boring code with lots of comments and one statement per line of code gets things done!

    0 0 1 0 0
  • tisbruce Profile Picture

    Bruce @[email protected] @tisbruce

    6 years ago

    @codinghorror @samsaffron The problem there is mixed levels of abstraction. If those tests have meaning at that level, they need good names and an appropriate place in the namespace

    0 0 1 0 0
  • sundaycode Profile Picture

    Blake Wilson @sundaycode

    6 years ago

    @codinghorror @samsaffron Agreed. I'm all for Readability > concise

    1 0 1 0 0
  • kcheungio Profile Picture

    Ka Wai Cheung @kcheungio

    6 years ago

    @codinghorror @samsaffron It's the "old developer" in me that decided to collect my thoughts on how we can name things better too: namingthings.donedone.com

    0 0 1 0 0
  • DonElegante Profile Picture

    Don Elegante @DonElegante

    6 years ago

    @codinghorror @samsaffron I think the second one is more readable and easiest to write tests by far, but I'm listening Sonarqube crying because of the multiple return statements.

    2 0 1 0 0
  • christopherdrum Profile Picture

    Christopher Drum @christopherdrum

    6 years ago

    @codinghorror @samsaffron I like to write dumb, concise code def can_accept_answer?(topic, post) return true # sure, why not? 🤷‍♂️ end

    1 0 1 0 0
  • _jameshatfield_ Profile Picture

    James Hatfield @_jameshatfield_

    6 years ago

    @codinghorror @samsaffron Early returns are just faster

    0 0 0 0 0
  • imleslahdin Profile Picture

    Nidal @imleslahdin

    6 years ago

    @codinghorror @samsaffron Whowever wrote the tip part is either showing off, a total noob or just dumb in my book.

    0 0 0 0 0
  • coorasse Profile Picture

    Alessandro Rodi @coorasse

    6 years ago

    @codinghorror @KFMolli @samsaffron As long as you wrote proper tests for all the cases, I'll write those first since is you code documentation. Then...how you wrote the code...I don't really care. But still, there is a correlation between lines of code and bugs so I'd still suggest you to go with version 1.

    3 0 0 0 0
  • sebify Profile Picture

    Sebastiano Mandalà @sebify

    6 years ago

    @codinghorror @dreamquest @samsaffron With age comes wisdom

    0 0 0 0 0
  • the_og_jmosser Profile Picture

    TechnoKing of Nord'a'Kota - Jason Mosser @the_og_jmosser

    6 years ago

    @codinghorror @samsaffron Gauntlets FTW!

    0 0 0 0 0
  • dimitrov2k Profile Picture

    Dimitar @dimitrov2k

    6 years ago

    @codinghorror @samsaffron Damn, Ruby looks so dope.

    0 0 0 0 0
  • gerardo8al Profile Picture

    gerardo @gerardo8al

    6 years ago

    @codinghorror @samsaffron Agreed. If the job allows it, my main priorities are readability, maintainability, and testability. Everything else tends to just happen if these are in place.

    0 0 0 0 0
  • THESANIYAZ Profile Picture

    SANIYAZ @THESANIYAZ

    6 years ago

    @codinghorror @samsaffron nice

    0 0 0 0 0
  • Download Image
    • Privacy
    • Term and Conditions
    • About
    • Contact Us
    • TwStalker is not affiliated with X™. All Rights Reserved. 2024 www.instalker.org

    twitter web viewer x profile viewer bayigram.com instagram takipçi satın al instagram takipçi hilesi twitter takipçi satın al tiktok takipçi satın al tiktok beğeni satın al tiktok izlenme satın al beğeni satın al instagram beğeni satın al youtube abone satın al youtube izlenme satın al sosyalgram takipçi satın al instagram ücretsiz takipçi twitter takipçi satın al tiktok takipçi satın al tiktok beğeni satın al tiktok izlenme satın al beğeni satın al instagram beğeni satın al youtube abone satın al youtube izlenme satın al metin2 metin2 wiki metin2 ep metin2 dragon coins metin2 forum metin2 board popigram instagram takipçi satın al takipçi hilesi twitter takipçi satın al tiktok takipçi satın al tiktok beğeni satın al tiktok izlenme satın al beğeni satın al instagram beğeni satın al youtube abone satın al youtube izlenme satın al buyfans buy instagram followers buy instagram likes buy instagram views buy tiktok followers buy tiktok likes buy tiktok views buy twitter followers buy telegram members Buy Youtube Subscribers Buy Youtube Views Buy Youtube Likes forstalk postegro web postegro x profile viewer