Brent's Encapsulated C Programming Rules (2020)
https://retroscience.net/brents-c-programming-rules.html
#HackerNews #Brent #C #Programming #Encapsulation #CodingRules #RetroScience
Brent's Encapsulated C Programming Rules (2020)
https://retroscience.net/brents-c-programming-rules.html
#HackerNews #Brent #C #Programming #Encapsulation #CodingRules #RetroScience
After thought (thought I didn’t plan to put into it), I don’t think "NULL coalescing" and "NULL chaining" needs to be built in to the #ProgrammingLanguage, and here’s why:
* If you’re getting just one thing, the getter can take an optional default result value. #Python works like this in `getattr`, `.get`, and things of that nature. Having an operator for this is fine, but it seems obvious you don’t **need** the language to do it for you.
* If you’re walking down a long uncertain chain, I have two arguments:
* Knowing the path that leads down into the object to the specific thing you want kinda sounds like an #Encapsulation violation. Why do you know so much about the internals of this object. If this deep property is important, maybe it’s part of the interface of the top-level thing. Maybe this is just bad design.
* Diving deeply involves lots of possibilities: possible defaults, actual methods of finding the named thing (allow inheritance? Is it an attribute? Is it an element of an array? Etc), did you want to just stop or raise an exception?Does saying what you want really come out to a simple, clean, understandable, one-line, expression?
Maybe I’m biased because I don’t have these operators in my day-to-day language; and also can’t remember hitting this situation. And I can certainly see such operators could be helpful. I’m not a language designer. But from my actual experience, in this case, the juice just isn’t worth the squeeze.
Một bài viết từ /u/EgregorAmeriki thảo luận về đóng gói (encapsulation) trong lập trình không cần dùng từ khóa private, thay vào đó áp dụng thiết kế dựa trên giao diện (interface-based design) để tối ưu tính bảo mật và tính linh hoạt của code.
#Lập_trình #Object_Oriented #Design_Pattern #Công_nghe #Thiet_ke_phan_mem #Programing #OOP #SoftwareDesign #Encapsulation #InterfaceDesign
https://www.reddit.com/r/programming/comments/1o934q9/encapsulation_without_private_a_case_for/
Artemis II Payload Integration 🛰️🧑🚀
#ArtemisII #CapeCanaveral #CarruthersGeocoronaObservatory #Encapsulation #Florida #IMAP #InterstellarMappingandAccelerationProbe #JohnFKennedySpaceCenter
⏩ 16 new pictures from NASA (Image Library) https://commons.wikimedia.org/wiki/Special:ListFiles?limit=16&user=OptimusPrimeBot&ilshowall=1&offset=20250920010947
📜 Behold, a relic from the distant past—2013! Back when "Page Object" was the new black in the world of #testing, because clearly, nobody knew that UIs change. 🤯 Marvel at the revolutionary idea of not frying your tests with a side of HTML spaghetti, as if #encapsulation wasn't already a thing. 🍝
https://martinfowler.com/bliki/PageObject.html #HackerNews #PageObject #HTMLSpaghetti #UITrends #HackerNews #ngated
quotes from the text:
"The concepts rejected as “not complex enough” might be simple building blocks, like molecules in a living body, that can be combined with other concepts to create a framework that can handle an adequate amount of complexity."
"I.e. that the black box has only the purpose of simplification and not that of knowledge elitism and hidden power structures."
Encapsulation in Python
#Python #Encapsulation #PythonProgramming #OOP #LearnPython #CodingShorts #TechTips #CodeNewbie #Develope
Take the red pill of #OOP! Learn programming concepts in #TheMatrix. Less dodging bullets, more #coding. Inheritance, polymorphism, fun!
#OOP #ObjectOrientedProgramming #Abstraction #AgentSmith #C++ #characteranalysis #Classes #Encapsulation #Inheritance #Java #Morpheus #Neo #Objects #OOPConcepts #Polymorphism #TheMatrix #Oracle #Trinity #GiggleByte #SwapneelMohite #programming #coding
https://medium.com/@swap.mohite/the-matrix-an-object-oriented-lesson-i-taught-revisited-9532a0712bc9
Attention-Worthy Links for December 11th, 2024
#Electricity #SMR #X-energy #Kairos #TRISO #pebble #encapsulation #England #trespassing #commoning #92% #seizure #depletion #collective #resources #carbon-fiber #CFRPs #Aspergillusnidulans #OTA #Overhuman #Nietzsche #Zarathustra #clairvoyant #futurist #hydrogen #Mark-17 #Albuquerque #B-36 #conventional #Broken #Arrow #Hummingbird #cubesat #NEO #Lagrange #L3Harris #graphene #interconnect #micro-electronics #TSMC #CMOS
Dive into the world of #encapsulation in #C++! Discover how to protect your data, create flexible code, and master #OOP. Learn to use access specifiers, private members, and public methods for better software design. #Cpp
https://teguhteja.id/encapsulation-in-cpp-mastering-data-hiding-and-access-control-2/
Discover the power of encapsulation in C++! Learn how to protect your data, improve code flexibility, and master object-oriented programming. Dive into practical examples and boost your C++ skills. #CPlusPlus #OOP #Encapsulation
https://teguhteja.id/encapsulation-in-cpp-mastering-data-hiding-and-access-control/
Discover the power of encapsulation in C++! 🚀 Learn how this cornerstone principle makes software robust and manageable. Dive into practical examples and unravel its essence with us at p4n.in. #cplusplus #programming #encapsulation
http://p4n.in/2024/04/07/encapsulation-in-c-a-comprehensive-exploration/
#decoupling #encapsulation
#thatmomentwhen you realize your OOP structure was worth it when you have to replace one class with another*, and when you swap in the new code for the old code... EVERYTHING STILL WORKS.
* I mean 3. THREE classes.
Are You tired of Your IT departments blocking essential services(your self-hosted wireguard) on eduroam WiFi? Try encapsulating it with http/websockets !
https://sdr.li/post/chisel0/
https://sdr.li/post/chisel2/
#eduroam #firewall #chisel #sysop #admin #encapsulation #wireguard #bofh
Private constants & breaking private functions in Clojure
Psyche Transport from Astrotech to LC 39A 🛰️
#ASU #ArizonaStateUniversity #Astrotech #DSOC #DeepSpaceOpticalCommunication #Encapsulation #FalconHeavy #JPL
⏩ 4 new pictures from NASA https://commons.wikimedia.org/wiki/Special:ListFiles?limit=4&user=OptimusPrimeBot&ilshowall=1&offset=20231007013826
New article:
⚠️Why you should avoid import * in Python 🐍
https://pybit.es/articles/why-you-should-avoid-import-in-python/
Covering:
- Why modules are great and namespacing explained
- Why import * is a problem
- A practical example where a function gets overriden
- The recommended way to do imports
- What PEP8 has to say about this
- Protection workaround, use __all__ to define your module's public interface
#python #pythonprogramming #modules #encapsulation #namespacing #zenofpython #bestpractices #pitfalls #imports #dundermethods
People newer to Python often get confused by the statement:
if __name__ == "__main__":
That's many underscores ("dunders"), right?
In essence it lets you put code in your module that ONLY should execute when the module is called directly. So not when you import from it.
I explain this further with a practical example in this 3 minute video:
https://www.youtube.com/watch?v=ubpFY7_dAW4
It's good to see my favourite WPF feature isn't dead:
class StamperBase {
constructor(o) { return o; }
}
class MyAttachedProperty extends StamperBase {
#name;
static getName(o) { return o.#name; }
static setName(o, v) { return o.#name = v; }
}
const hostInit = Host.prototype.initialize;
Host.prototype.initialize = function() {
new MyAttachedProperty(this);
return hostInit.apply(this, arguments);
};
export const attachedNames = {
get: MyAttachedProperty.get,
set: MyAttachedProperty.set,
};