I saw a duplicate today asking:
Why doesn't the following work?
SObject record; // assigned elsewhere if (record.Some_Checkbox__c) { ... }
It took me a little while to find a good Q&A, even though I knew I had seen similar before, and even posted the accepted answer.
Working with SObjects instead of concrete custom objects (i.e., abstraction in apex)
Should we mark this post as canonical? Should the question and/or answer be a wiki? Our community consensus/guidance in this area seems unclear.
get()
/put()
as well as static field access withSObject
are pretty common.