• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EST 18:28
CET 00:28
KST 08:28
  • Home
  • Forum
  • Calendar
  • Streams
  • Liquipedia
  • Features
  • Store
  • EPT
  • TL+
  • StarCraft 2
  • Brood War
  • Smash
  • Heroes
  • Counter-Strike
  • Overwatch
  • Liquibet
  • Fantasy StarCraft
  • TLPD
  • StarCraft 2
  • Brood War
  • Blogs
Forum Sidebar
Events/Features
News
Featured News
SC2 All-Star Invitational: Tournament Preview5RSL Revival - 2025 Season Finals Preview8RSL Season 3 - Playoffs Preview0RSL Season 3 - RO16 Groups C & D Preview0RSL Season 3 - RO16 Groups A & B Preview2
Community News
BSL Season 2025 - Full Overview and Conclusion5Weekly Cups (Jan 5-11): Clem wins big offline, Trigger upsets4$21,000 Rongyi Cup Season 3 announced (Jan 22-Feb 7)16Weekly Cups (Dec 29-Jan 4): Protoss rolls, 2v2 returns7[BSL21] Non-Korean Championship - Starts Jan 105
StarCraft 2
General
Stellar Fest "01" Jersey Charity Auction SC2 All-Star Invitational: Tournament Preview Weekly Cups (Jan 5-11): Clem wins big offline, Trigger upsets When will we find out if there are more tournament SC2 Spotted on the EWC 2026 list?
Tourneys
SC2 AI Tournament 2026 SC2 All-Star Invitational: Jan 17-18 $21,000 Rongyi Cup Season 3 announced (Jan 22-Feb 7) OSC Season 13 World Championship Sparkling Tuna Cup - Weekly Open Tournament
Strategy
Simple Questions Simple Answers
Custom Maps
Map Editor closed ?
External Content
Mutation # 508 Violent Night Mutation # 507 Well Trained Mutation # 506 Warp Zone Mutation # 505 Rise From Ashes
Brood War
General
Fantasy's Q&A video Potential ASL qualifier breakthroughs? BSL Season 2025 - Full Overview and Conclusion [ASL21] Potential Map Candidates BW General Discussion
Tourneys
[BSL21] Non-Korean Championship - Starts Jan 10 Small VOD Thread 2.0 Azhi's Colosseum - Season 2 [Megathread] Daily Proleagues
Strategy
Soma's 9 hatch build from ASL Game 2 Simple Questions, Simple Answers Game Theory for Starcraft Current Meta
Other Games
General Games
Stormgate/Frost Giant Megathread Beyond All Reason Awesome Games Done Quick 2026! Nintendo Switch Thread Mechabellum
Dota 2
Official 'what is Dota anymore' discussion
League of Legends
Heroes of the Storm
Simple Questions, Simple Answers Heroes of the Storm 2.0
Hearthstone
Deck construction bug Heroes of StarCraft mini-set
TL Mafia
Vanilla Mini Mafia Mafia Game Mode Feedback/Ideas
Community
General
US Politics Mega-thread Things Aren’t Peaceful in Palestine Russo-Ukrainian War Thread Canadian Politics Mega-thread European Politico-economics QA Mega-thread
Fan Clubs
Media & Entertainment
Anime Discussion Thread [Manga] One Piece
Sports
2024 - 2026 Football Thread
World Cup 2022
Tech Support
Computer Build, Upgrade & Buying Resource Thread
TL Community
The Automated Ban List
Blogs
My 2025 Magic: The Gathering…
DARKING
Physical Exercise (HIIT) Bef…
TrAiDoS
Life Update and thoughts.
FuDDx
How do archons sleep?
8882
James Bond movies ranking - pa…
Topin
Customize Sidebar...

Website Feedback

Closed Threads



Active: 1750 users

#TODO: Find suitable ransom to nego new end points - Page 2

Blogs > Chef
Post a Reply
Prev 1 2 All
Fecalfeast
Profile Joined January 2010
Canada11355 Posts
November 25 2015 03:23 GMT
#21
On November 24 2015 11:36 patrick321 wrote:
The OP's post was clever but fecalfeast's was art. The form perfectly embellished the content. And his topical name was the cherry on top of the cow pie.

Critiquing his code here is like stopping a singer to correct his lyrics.

I actually appreciate the advice, I often run into annoying problems that are often just fixed by being more organized. Besides, if his OP is a shitpost, my post is literally regurgitated shit.
On November 24 2015 23:31 Chef wrote:
Show nested quote +
On November 24 2015 11:15 Fecalfeast wrote:
I was writing the comments to explain to me what I wanted to program to do. I lack organization and writing things down before I can articulate them in code keeps me on track.

What does 'in scope' mean? I'm fairly green at programming and just make tools that I can't find with a simple google search.

Are you saying it would be better to have a separate method for finding food, then feed that variable through chew's parameter brackets?

Sure, it's not problem. I like to write methods I wish existed when thinking about the top level logic of my code, and then write the methods.

My bad about the scope, your methods are all in the global scope so they are accessible to one another.

ex

2.1.3 :001 > def bear; puts 'bear'; end
=> :bear
2.1.3 :002 > def kuma; puts bear; end
=> :kuma
2.1.3 :003 > kuma
bear

In larger applications, you have to throw things into classes and modules, so that you can avoid naming collisions by polluting the global scope (you can google javascript global scope for a typical explanation).

If for example you had defined method A within method B, you wouldn't be able to access method A outside method B. Similarly, if you define methods within a class, you can access them anywhere within the class, but outside the class you have to call Class.method (or if you have an instance of the class, instance.method).

I'm just saying your method chew does not describe accurately enough what it does, which is find food and digest it and vomit it out. So when someone calls chew they will get the unexpected result of vomit. Really your method would be accurately called find_food_eat_it_and_vomit_it_out which is a method that seems to have a lot of responsibilities. If I wrote such a method, it would have calls to three other methods, find_food eat_food (which has chew_food and swallow_food methods) vomit_food. This way the code is more reusable, the stack trace will be easier to read, and if you need to update one of them, all your methods that use them will be updates simultaneously, instead of you having to update the same code in multiple places.

Even if all you use code for is one off scripts for yourself, it might help you to build a library of methods you often need to use (which you could do a very simple require to have accessible in all your scripts, saving you some copy / pasting). Naming those methods logically will help you to remember without referencing them.

So separating them into

def find_food()
stuff
end
def chew()
differentStuff
end
def swallow_digest()
otherStuff
end
def vomit()
endResult
end
def indigestion()
find_food()
while food
chew()
swallow_digest()
vomit()
puts "I'm hungry again"
end
indigestion()

would be better because it's easier to tell where something goes wrong when something goes wrong?
ModeratorINFLATE YOUR POST COUNT; PLAY TL MAFIA
YourGoodFriend
Profile Blog Joined June 2010
United States2197 Posts
November 25 2015 20:21 GMT
#22
On November 25 2015 12:23 Fecalfeast wrote:
Show nested quote +
On November 24 2015 11:36 patrick321 wrote:
The OP's post was clever but fecalfeast's was art. The form perfectly embellished the content. And his topical name was the cherry on top of the cow pie.

Critiquing his code here is like stopping a singer to correct his lyrics.

I actually appreciate the advice, I often run into annoying problems that are often just fixed by being more organized. Besides, if his OP is a shitpost, my post is literally regurgitated shit.
Show nested quote +
On November 24 2015 23:31 Chef wrote:
On November 24 2015 11:15 Fecalfeast wrote:
I was writing the comments to explain to me what I wanted to program to do. I lack organization and writing things down before I can articulate them in code keeps me on track.

What does 'in scope' mean? I'm fairly green at programming and just make tools that I can't find with a simple google search.

Are you saying it would be better to have a separate method for finding food, then feed that variable through chew's parameter brackets?

Sure, it's not problem. I like to write methods I wish existed when thinking about the top level logic of my code, and then write the methods.

My bad about the scope, your methods are all in the global scope so they are accessible to one another.

ex

2.1.3 :001 > def bear; puts 'bear'; end
=> :bear
2.1.3 :002 > def kuma; puts bear; end
=> :kuma
2.1.3 :003 > kuma
bear

In larger applications, you have to throw things into classes and modules, so that you can avoid naming collisions by polluting the global scope (you can google javascript global scope for a typical explanation).

If for example you had defined method A within method B, you wouldn't be able to access method A outside method B. Similarly, if you define methods within a class, you can access them anywhere within the class, but outside the class you have to call Class.method (or if you have an instance of the class, instance.method).

I'm just saying your method chew does not describe accurately enough what it does, which is find food and digest it and vomit it out. So when someone calls chew they will get the unexpected result of vomit. Really your method would be accurately called find_food_eat_it_and_vomit_it_out which is a method that seems to have a lot of responsibilities. If I wrote such a method, it would have calls to three other methods, find_food eat_food (which has chew_food and swallow_food methods) vomit_food. This way the code is more reusable, the stack trace will be easier to read, and if you need to update one of them, all your methods that use them will be updates simultaneously, instead of you having to update the same code in multiple places.

Even if all you use code for is one off scripts for yourself, it might help you to build a library of methods you often need to use (which you could do a very simple require to have accessible in all your scripts, saving you some copy / pasting). Naming those methods logically will help you to remember without referencing them.

So separating them into

def find_food()
stuff
end
def chew()
differentStuff
end
def swallow_digest()
otherStuff
end
def vomit()
endResult
end
def indigestion()
find_food()
while food
chew()
swallow_digest()
vomit()
puts "I'm hungry again"
end
indigestion()

would be better because it's easier to tell where something goes wrong when something goes wrong?



Its part of the SOLID principles, single responsibility for methods/functions/class each method should only do one thing (ie. swallow and chew are two different things)

This allows for ease of testing and future proofing because if you need to change how chewing works it shouldnt impact (as much) anything else. Also if you have tests written then after you make a change you rerun your tests and it tells you either where there are issues or that your change is fine. If you have a giant method then if your test fails you dont really know what failed as it was just something in that method, where as if it is broken out you can tell "oh the swallow part didnt work, lets go fix it"
anonymous is the most famous author that anyone can be
Silvanel
Profile Blog Joined March 2003
Poland4740 Posts
November 29 2015 09:39 GMT
#23
try:
Chef is "Funny"
print(" Best post ever 5/5!! ")

except ValueError:
print("I will probably get banned for it but i have to say...........")
sys.exit()
Pathetic Greta hater.
AKnopf
Profile Blog Joined March 2011
Germany259 Posts
December 06 2015 11:16 GMT
#24
+1 for require_relative


Whoops, thought we were on Github
The world - its a funny place
Prev 1 2 All
Please log in or register to reply.
Live Events Refresh
BSL 21
20:00
Non-Korean Championship - D3
Mihu vs eOnzErG
Dewalt vs Sziky
Bonyth vs DuGu
XuanXuan vs eOnzErG
Dewalt vs eOnzErG
ZZZero.O267
LiquipediaDiscussion
AI Arena Tournament
20:00
Swiss - Round 2
Laughngamez YouTube
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
Nathanias 107
StarCraft: Brood War
ZZZero.O 267
Shuttle 112
Dota 2
Pyrionflax243
Counter-Strike
fl0m1673
Other Games
tarik_tv17176
gofns10686
summit1g8239
FrodaN3513
crisheroes443
ToD225
XaKoH 190
KnowMe169
ViBE46
minikerr26
Organizations
Other Games
gamesdonequick2594
StarCraft 2
WardiTV800
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 20 non-featured ]
StarCraft 2
• HeavenSC 63
• musti20045 58
• poizon28 33
• LaughNgamezSOOP
• sooper7s
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• Migwel
StarCraft: Brood War
• RayReign 10
• STPLYoutube
• ZZZeroYoutube
• BSLYoutube
Dota 2
• masondota21419
• Noizen35
League of Legends
• Doublelift4797
Other Games
• imaqtpie2622
• Shiphtur149
• tFFMrPink 12
Upcoming Events
All-Star Invitational
3h 32m
MMA vs DongRaeGu
herO vs Solar
Clem vs Reynor
Rogue vs Oliveira
Sparkling Tuna Cup
10h 32m
OSC
12h 32m
Shameless vs NightMare
YoungYakov vs MaNa
Nicoract vs Jumy
Gerald vs TBD
Creator vs TBD
BSL 21
20h 32m
Bonyth vs Sziky
Mihu vs QiaoGege
Sziky vs XuanXuan
eOnzErG vs QiaoGege
Mihu vs DuGu
Dewalt vs Bonyth
IPSL
20h 32m
Dewalt vs Sziky
Replay Cast
1d 9h
Wardi Open
1d 12h
Monday Night Weeklies
1d 17h
The PondCast
3 days
Replay Cast
5 days
[ Show More ]
Big Brain Bouts
5 days
Serral vs TBD
BSL 21
6 days
Liquipedia Results

Completed

Escore Tournament S1: W4
Big Gabe Cup #3
NA Kuram Kup

Ongoing

C-Race Season 1
IPSL Winter 2025-26
BSL 21 Non-Korean Championship
CSL 2025 WINTER (S19)
KCM Race Survival 2026 Season 1
OSC Championship Season 13
SC2 All-Star Inv. 2025
Underdog Cup #3
BLAST Bounty Winter Qual
eXTREMESLAND 2025
SL Budapest Major 2025
ESL Impact League Season 8
BLAST Rivals Fall 2025
IEM Chengdu 2025

Upcoming

Escore Tournament S1: W5
Acropolis #4
IPSL Spring 2026
Bellum Gens Elite Stara Zagora 2026
HSC XXVIII
Rongyi Cup S3
Nations Cup 2026
Stake Ranked Episode 1
BLAST Open Spring 2026
ESL Pro League Season 23
ESL Pro League Season 23
PGL Cluj-Napoca 2026
IEM Kraków 2026
BLAST Bounty Winter 2026
TLPD

1. ByuN
2. TY
3. Dark
4. Solar
5. Stats
6. Nerchio
7. sOs
8. soO
9. INnoVation
10. Elazer
1. Rain
2. Flash
3. EffOrt
4. Last
5. Bisu
6. Soulkey
7. Mini
8. Sharp
Sidebar Settings...

Advertising | Privacy Policy | Terms Of Use | Contact Us

Original banner artwork: Jim Warren
The contents of this webpage are copyright © 2026 TLnet. All Rights Reserved.