TGViewer
Channel Public Channel
Programming & AI Tips ๐Ÿ’ก

Programming & AI Tips ๐Ÿ’ก

@programmingtip

Programming & AI:
Tips ๐Ÿ’ก
Articles ๐Ÿ“•
AI & LLMs ๐Ÿ‘พ
Design, Architecture, Principles โœ…

๐Ÿ‡ณ๐Ÿ‡ฑ Contact: @MoienTajik
Subscribers
46.3K
Photos
67
Videos
11
Links
377

Showing posts older than #29 ยท Back to latest

Older Posts 6 shown
Post #23 1.85K
Which code is better ?

// Check to see if the employee is eligible for full benefits 

if((employee.flags & HOURLY_FLAG) && (empoyee.age > 65))


or this ?

if(employee.isEligibleForFullBenefits())


Absolutely the second one is more readable and it takes you less time to understand ! โฐ

#CleanCode #DontUseComments #Tip3
Post #22 1.69K
Unit Tests โœ…

Ten years ago this would have raised a lot of eyebrows ! ๐Ÿ‘

The discipline of Test Driven Development has made a profound impact upon our industry and has become one of our most fundamentals disciplines.

Dave Thomas :
Code without tests, is not clean, No matter how elegant it is, no matter how readable and accessible, If it hath not tests, it be unclean.

#CleanCode #Tip2
Post #7 1.94K
Don't be afraid to make a name long.

A long descriptive name is better than a short enigmatic name.

A long descriptive name is better than a long descriptive comment. โœ”๏ธ

Use a naming convention that allows multiple words to be easily read in the function names, and then make use of those multiple words to give the function a name that says what it does.

#CleanCode #Tip1
Post #1
Channel created
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook โ†’Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 โ†’