New answers tagged

0

One use case: It is nice to have immutable objects. But in practice, I create an object using a constructor, then modify it until it is exactly what I want it to be, and then I don’t want it to change anymore. So I want the object to change for mutable to immutable. Good luck. That can be fixed if the constructor does all the work, so there will be no need ...


0

This sounds like a pattern I actually use. No idea if it is a good idea, but it works for me. Code example in C++ (struct means everything is public). // Throws Blqh on failure. struct Connection() { using Socket = int; Connection() : _s{ connect() } {} const Socket _s; private: static Socket connect() { // do stuff ...


0

Separation of Concerns means being able to define the concerns first and HTML + CSS / SASS + Javascript + XML/JSON ... are just too fragmented to allow concerns to be defined in any way other than the way they were defined when the languages were drafted. A button or a text field is not a "concern", the "user list" is a concern but there ...


1

This thread has convinced me that current CSS does not have (and probably cannot have) completely separate concerns from HTML. I have never felt comfortable with the SGML (Standard Generalized Mark-up Language) approach that inspired HTML (see https://www.w3.org/People/Raggett/book4/ch02.html). SGML is a semioticist's metatool for abstracting "...


Top 50 recent answers are included