LeftistMuslimObama posted:This has been your MUMPS infection for the day. drat, these are always such good posts. I love reading about the mumps rabbit hole.
|
|
# ? Oct 19, 2015 19:18 |
|
|
# ? May 25, 2024 14:40 |
|
LeftistMuslimObama posted:This is incredible. Thank you for this effort post. At the risk of sounding dumb, does erlang execute in some sort of hosting runtime environment that all of this supervision and message passing is possible? I would assume that you couldn't bolt this sort of thing onto a language like C. Erlang runs in its own virtual machine that does SMP and scheduling, work-sharing, and reimplements processes there.
|
# ? Oct 19, 2015 19:42 |
|
that was some good posting mononcqc now i think i understand why erlang sees the need to duplicate half the host OS features
|
# ? Oct 19, 2015 22:43 |
|
LeftistMuslimObama posted:mumps horror I don't know if it's too early in the morning or my brain is just refusing to understand this O_O e: it just clicked and lol
|
# ? Oct 19, 2015 22:57 |
|
pepito sanchez posted:but being the terrible programmer i am i still recently did this As a terrible programmer, I don't get OO. Why is this terrible? Should you have just folded ReadWritable and ReadWriter into the Game class?
|
# ? Oct 20, 2015 00:06 |
|
meatpotato posted:As a terrible programmer, I don't get OO. Why is this terrible? Should you have just folded ReadWritable and ReadWriter into the Game class? when game1,2,3 extend ReadWriter they also implement the ReadWritable interface because what they are extending implements it, so there is no need to explicitly declare that the game classes implement ReadWritable Jerry Bindle fucked around with this message at 00:17 on Oct 20, 2015 |
# ? Oct 20, 2015 00:13 |
|
it would be like if you had car extends vehicle, and your concrete hotwheels class implements car. you wouldn't also need to declare that hotwheels implements vehicle
|
# ? Oct 20, 2015 00:19 |
|
Barnyard Protein posted:when game1,2,3 extend ReadWriter they also implement the ReadWritable interface because what they are extending implements it, so there is no need to explicitly declare that the game classes implement ReadWritable Oh, duhhh Thanks
|
# ? Oct 20, 2015 00:22 |
|
I need to try something besides embedded C one of these days. Erlang sounds cool, maybe I can write embedded erlang...
|
# ? Oct 20, 2015 00:23 |
|
Funk In Shoe posted:But I don't understand how this can be the entirety of a job, doing angular.js stuff. I guess if you had to do it every day for 8 hours you'd get pretty bored. i take it you don't see many "user requirements" in academia
|
# ? Oct 20, 2015 00:34 |
|
you guys should do a double act
|
# ? Oct 20, 2015 00:37 |
|
Shaggar posted:inheritance works in same places like controllers in mvc/webapi. The alternative would be duplicating a bunch of plumbing every time you create a new controller. So most of the reason inheritance ruins things for everyone else is because people think it's "good enough" as code re-use thing. And so proper compositional code re-use often requires pointless boilerplate code to achieve, instead of someone coming up with a good syntax for it.
|
# ? Oct 20, 2015 00:57 |
|
meatpotato posted:I need to try something besides embedded C one of these days. Erlang sounds cool, maybe I can write embedded erlang... lol
|
# ? Oct 20, 2015 01:02 |
|
Bloody posted:lol i'm not into embedded programming at all but i guess the lol means it's not possible or feasible? you can do embedded with other virtual machines...
|
# ? Oct 20, 2015 01:26 |
|
pepito sanchez posted:shaggar is right if you don't get any benefit from composition what benefit are you getting from inheritance
|
# ? Oct 20, 2015 01:39 |
|
tef posted:if you don't get any benefit from composition what benefit are you getting from inheritance not sure! but after your post i'm having fun reading about benefits. i'm happy to be yelled at. it's half the reason i come to yospos. god drat it's been a full monday
|
# ? Oct 20, 2015 01:47 |
|
tef posted:composition i didn't know this design pattern had a name
|
# ? Oct 20, 2015 03:53 |
|
it's technically called strategy unless i'm mistaken and there is a "composition" pattern? the way i've been taught, inheritance is all good and well as long as those different "things" inheriting can never be another thing which shares inheritance. for a quick and probably crappy example: manager, waiter, butler extending employee. if there's a chance in your program - in the future - where a butler could move to waiter, or perhaps a waiter could move up to the status of manager, then that's a bad model. changing that state is a massive pain in the rear end if not impossible without breaking everything. if this is your case then employing strategy is the way. person contains type employee implements employable is a? butler()? waiter()? manager()? no problem changing state and keeping inherited behavior from the interface. happy to be corrected, but this is the case that's been presented to me for and against inheritance and composition.
|
# ? Oct 20, 2015 04:13 |
|
pepito sanchez posted:i'm not into embedded programming at all but i guess the lol means it's not possible or feasible? you can do embedded with other virtual machines... idk im just picturing trying to run erlang on like an msp430
|
# ? Oct 20, 2015 04:46 |
|
i think it would be cool to do embedded functional reactive programming, but lol
|
# ? Oct 20, 2015 04:48 |
|
it would be downside is at that level pretty much everything you do is global mutable state and is usually timing sensitive. not really sure how it'd look in an alternative paradigm but it would be interesting
|
# ? Oct 20, 2015 04:50 |
|
like c in the context of an embedded system is a huge win imo because it is trivial to reason about exactly what the hardware is doing on any line of code (assuming your code base is anything remotely resembling sane)
|
# ? Oct 20, 2015 04:52 |
|
Bloody posted:like c in the context of an embedded system is a huge win imo because it is trivial to reason about exactly what the hardware is doing on any line of code (assuming your code base is anything remotely resembling sane) lmao though maybe this is why embedded c compilers are generally lovely and don't do optimisations
|
# ? Oct 20, 2015 04:55 |
|
are you compiling with optimizations turned off?
|
# ? Oct 20, 2015 04:56 |
|
MeruFM posted:i didn't know this design pattern had a name c.f. traits vs classes
|
# ? Oct 20, 2015 05:18 |
|
traits supremacy
|
# ? Oct 20, 2015 05:19 |
|
what are the good things about inheritance that composition combined with traits doesn't cover?
|
# ? Oct 20, 2015 05:33 |
|
Opulent Ceremony posted:To be more specific, I'm using git from within TFS in Visual Studio, and it tries to automate away a lot of the git processes for you. As an example, their UI for merging does not appear to offer any options with it, you simply select which branch merges into which other branch. Usually it will do an automated merge commit for you, and I think during that process the file in dev was reverted to the older and less-good master one. But just that one. Sounds like user error. If merging conflicts meant: take mine then git wouldn't need a human to get it right
|
# ? Oct 20, 2015 05:58 |
|
Bloody posted:are you compiling with optimizations turned off? are you? if you're trying to reason about what your code is actually doing after optimisation - well, it's not as easy as you seem to think.
|
# ? Oct 20, 2015 06:00 |
|
pepito sanchez posted:it's technically called strategy unless i'm mistaken and there is a "composition" pattern? the strategy pattern is, "pass in a function", so for example ["a","bb","ccc"].sort(key=len) in python would be an example of a strategy. in the OO world in which GoF was written, it was just objects and methods, so GoF/The Book is a sorta taxonomy of things you did because the language didn't have those concepts from the outset. see also: iterators. i mean, we have factories because we don't have functions. we have builders because we don't have named arguments. a lot of this poo poo boils down to things better handled through functional composition. a lot of design patterns are not necessarily good code, but common idioms for approaching a task in languages without support for them natively. cf. design patterns in dynamic languages: http://norvig.com/design-patterns/ppframe.htm composition isn't really a pattern. it's just an aesthetic. there are many forms of composition. inheritance in some ways is a form of composition, i just find it very clumsy to use. (although in some ways it's more of a form of delegation, not composition, in that you delegate method calls to other classes) quote:happy to be corrected, but this is the case that's been presented to me for and against inheritance and composition. thing is, i haven't frequently encountered problems that are well modelled by inheritance. interfaces? yes please. loads of them. mixins? yep. traits? please. class inheritrance and superclass dispatch? no thanks. i loving love interfaces, but many of the subclass heirarchies i have encountered are for the latter part clownshoes. you can't add a new method without carefully inspecting subclasses to make sure you're not accidentally overriding it. you can't extend the type equality without destroying transitivity (liskov substitution principle). it's also too easy to override a superclass's method and breaking things. meanwhile traits are dump all the methods into this class and let the developer resolve conflicts, if any. pepito sanchez posted:person contains type employee implements employable is a? butler()? waiter()? manager()? no problem changing state and keeping inherited behavior from the interface. i guess you want a person type, and a role type. well, you kinda want to capture the history too: really, you have two different state machines here: one for the lifetime of a person in a company, and another for the roles in which they take on. you don't want to add a new method to the class every time a new role appears. something like person.is_employed() person.current_role().hours, and if you wanted, in java you could use an Enum to represent roles if you wanted to avoid using inheritance unboundedly. when you structure your software by the patterns it exposes you are not designing software around the interface you want or the state you are modelling inside of it. and that's all well and good when you need to do tree rewriting, iteration, passing a sort key, but most of these things have been done for you. design patterns are for language features, not for modelling business logic and state, nor a playset for api design. quote:in the future - where a butler could move to waiter, or perhaps a waiter could move up to the status of manager, then that's a bad model WAR IS PEACE FREEDOM IS SLAVERY CAR EXTENDS VEHICLE
|
# ? Oct 20, 2015 06:04 |
|
so, how is a mixin different from an interface keep in mind i dont know these things
|
# ? Oct 20, 2015 06:20 |
|
fleshweasel posted:so, how is a mixin different from an interface an interface is a set of method signatures a mixin is a concrete class that implements multiple interfaces or an interface that extends multiple interfaces an arbitrary example, http://docs.oracle.com/javase/7/docs/api/java/util/Deque.html deque is a mixin bc it extends the interfaces iterable, collection, and queue
|
# ? Oct 20, 2015 06:40 |
|
bear in mind that everything i say is about java, c or racket, maybe mixin has a different slant in some other languages
|
# ? Oct 20, 2015 06:43 |
|
fleshweasel posted:so, how is a mixin different from an interface Mixins are all about implementation inheritance - you extend the mixin class, you get the implementation. Multi-inheritance in general muddies the waters between extending-for-implementation (which is really just composition, without the boilerplate of doing explicit delegation) and extending-for-interface (which is terrible and is way better served with traits and interfaces).
|
# ? Oct 20, 2015 06:44 |
|
tef posted:WAR IS PEACE
|
# ? Oct 20, 2015 06:52 |
Would you say that war and peace have an IS-A relationship, or an IMPLEMENTED-IN-TERMS-OF relationship?
|
|
# ? Oct 20, 2015 07:31 |
|
tef posted:WAR IS PEACE
|
# ? Oct 20, 2015 07:31 |
|
i like mixins in sasscode:
Kill All Cops fucked around with this message at 07:43 on Oct 20, 2015 |
# ? Oct 20, 2015 07:41 |
|
suffix posted:i take it you don't see many "user requirements" in academia You are, of course, absolutely right and this is yet another point I hadn't even considered. Which I guess serves as further evidence that I should just come to terms with the fact that my plan of "programming/systems design as a backup career if I get tired of this one" is probably not very feasible.
|
# ? Oct 20, 2015 07:59 |
|
|
# ? May 25, 2024 14:40 |
|
Funk In Shoe posted:You are, of course, absolutely right and this is yet another point I hadn't even considered. Which I guess serves as further evidence that I should just come to terms with the fact that my plan of "programming/systems design as a backup career if I get tired of this one" is probably not very feasible. stop loving flagellating yourself and remember the title of this thread
|
# ? Oct 20, 2015 08:10 |