|
Notorious b.s.d. posted:docker containers are opaque. i gotcha seems like it just means you need to janitor a golden image. infinitely preferable to janitoring a whole bunch of servers imo
|
# ? Sep 20, 2015 16:40 |
|
|
# ? Jun 5, 2024 09:01 |
|
Blinkz0rz posted:i gotcha golden images are the loving worst
|
# ? Sep 20, 2015 16:41 |
|
MALE SHOEGAZE posted:maybe i'm not understanding you but cant you just docker exec -it $container_id bash and introspect yeah on solaris you don't have to do that the patcher doohickey just knows what to do with zones, and patches them alongside the host OS
|
# ? Sep 20, 2015 16:42 |
|
Notorious b.s.d. posted:golden images are the loving worst i guess tbh they don't seem too awful if you're building them with something like packer infrastructure as code is pretty cool by me
|
# ? Sep 20, 2015 16:43 |
|
Sinestro posted:if you need clairvoyance to see how variables will change during a programs runtime, then smdh yes, ofc mutablity makes entangling things even worse. but there's another effect on design over time with respect to the code, hence talking about years. i'm contending that global vars can help your design decay to mush by logically connecting things that don't necessarily need connecting.
|
# ? Sep 20, 2015 17:01 |
|
your automatic build should just pull the latest official centos image and yum update it and build an updated image and restart your workers their tooling doesn't feel that great for production use though, i wish they'd make better conventions for the building, disting, logging, running and user Notorious b.s.d. posted:golden images are the loving worst idgi, you want to patch individual running docker containers? that seems as bad as byte patching an executable instead of building a new one from source
|
# ? Sep 20, 2015 17:15 |
|
suffix posted:that seems as bad as byte patching an executable instead of building a new one from source you say it like that's a bad thing
|
# ? Sep 20, 2015 17:31 |
|
suffix posted:your automatic build should just pull the latest official centos image and yum update it and build an updated image and restart your workers and that's the part they are trying to sell oops suffix posted:idgi, you want to patch individual running docker containers? that seems as bad as byte patching an executable instead of building a new one from source on certain obscure long-dead platforms you could actually patch the running code
|
# ? Sep 20, 2015 17:48 |
|
Wheany posted:wtf, just put your cursor over the method name in your ide and use "find usages" lol, like i work in a real language. MUMPS does not have such silly frills as this.
|
# ? Sep 20, 2015 19:06 |
|
stop the presses, just got some real hot takes on programmingDestroyenator posted:globals are bad Mr Dog posted:Globals are bad even if we do have global state the last thing we want to do is make it obvious, we'd rather implicitly inject shared objects through annotation and reflection
|
# ? Sep 20, 2015 19:27 |
|
Mr Dog posted:Globals are bad because two different people could decide to create a global variable called foo and then stomp on each other's internal state in unpredictable ways yeah we had this problem with tables and filenames, two people could create the same file or table and stomp on each other's internal state, so we've replaced it with a unique token for each and a xml mapping file, honest
|
# ? Sep 20, 2015 19:33 |
|
it seems that the idea of programming languages being for adult engineers seems to be forgotten these days. there's a difference between protecting against difficult to find bugs and edge cases and designing stuff around "but two people could create a global with the same name". one person could put code that dials out to some russian hacker, does that mean that we should get rid of networking? jesus
|
# ? Sep 20, 2015 19:36 |
|
Global state was never inherently bad---using global state to pass information into or out of functions is bad. It makes things non-reentrant, like strtok. There's no inherent problem with global variables for objects that want to exist for the application's entire lifetime because the application's global scope is still a perfectly valid singleton scope, it's just not given a ceremonial name and private constructor. That said, just sticking variables in the global namespace is messy as hell but making a singleton class is still global state.
|
# ? Sep 20, 2015 19:37 |
|
docker almost solves two problems: 1. amazon lock in which is why every other cloud vendor is jumping onto it like a rat escaping a sinking ship (openstack) 2. cheap multi-tenancy because your ceo won't pay amazon for two machines, and if you let two of your webdevs deploy on the same root account one is going to sabotage the other the investor story time revolves around being a kingmaker, i think, because they originally tried to do hosting but gave up. the hype train is really strong because as we know, up until now, deploying software has been impossible. that and every rails app needs root access and superuser for the database.
|
# ? Sep 20, 2015 19:41 |
|
Sinestro posted:it seems that the idea of programming languages being for adult engineers seems to be forgotten these days. there's a difference between protecting against difficult to find bugs and edge cases and designing stuff around "but two people could create a global with the same name". one person could put code that dials out to some russian hacker, does that mean that we should get rid of networking? jesus tldr programmers want their language to protect them from other people not from themselves
|
# ? Sep 20, 2015 19:43 |
|
Sinestro posted:the "problems" with globals are all related to reasoning about how they change the problem with shared mutable state is that it's mutable, and shared. it's bad, so we shouldn't use it, unless not using it is worse. we've got the hang of the former, not the latter.
|
# ? Sep 20, 2015 19:45 |
|
hold on a secondVolte posted:non-reentrant, like strtok why does strtok work like that
|
# ? Sep 21, 2015 01:41 |
|
The main reason mutable state is bad is because it makes programs difficult to understand and difficult to compose modular parts. Mutable state encapsulated inside an object and not directly accessible anywhere is almost just as bad in these terms as global mutable state if the effects of the mutability leak outside the scope of the object. A way to improve the composability and understandability of programs should be to practically minimize this mutable state with global effects. You can divide mutable state into essential and accidental. Essential mutable state is inherent to the problem you are trying to solve and cannot be eliminated. Accidental mutable state can be subdivided:
There's a paper that discusses these issues: http://shaffner.us/cs/papers/tarpit.pdf Their proposed solution might suck though.
|
# ? Sep 21, 2015 02:00 |
|
We use dependency injection in a C# codebase. The more and more I use it and try to program in a style that minimizes side effects and have many singleton 'service' modules that themselves don't have any mutable shared state, the more it seems like that it's just a method to achieve a functional programming-like module system in a really boilerplatish way.
|
# ? Sep 21, 2015 02:03 |
|
People laugh at C++ for having to declare and define the same thing in a redundant way. Unfortunately in C# or Java, you have to do something like this when you use a DI framework with singletons: code:
|
# ? Sep 21, 2015 02:06 |
|
I still don't know what di is for
|
# ? Sep 21, 2015 02:37 |
|
Bloody posted:I still don't know what di is for mocking
|
# ? Sep 21, 2015 02:39 |
|
from wiki Dependency injection means giving an object its instance variables. Really. That's it. James Shore, 22 March 2006.[1]
|
# ? Sep 21, 2015 02:42 |
|
i'm trying to think of another justifiable reason besides mocking and i literally can't come up with another reason you can do stuff with dependency injection frameworks to magically wrap decorators around poo poo and automagically provide factories and other crazy poo poo but that probably just makes things harder to understand
|
# ? Sep 21, 2015 02:43 |
|
in some crazy world you would use a dependency injection framework to change the implementation of some interface in your codebase outside of your tests but that's probably going down the path of crazy and there are more straightforward ways to change implementation based on configuration
|
# ? Sep 21, 2015 02:46 |
|
sometimes it's nice to be able to swap out one implementation for another. I do that now to use one data access implementation for environment A and another data access implementation with different technology for environment B. I only really bother with the hassle of it if it it's for some stateful/external service. I don't do the whole mock thing for just a module of deterministic functions unless I realllly need to test the behavior of some parent object while hard coding simple return values for the mock dependency (I don't need to) testing is overrated and I don't always like the things we test at my workplace, but there are worse problems to suffer from. brap fucked around with this message at 02:53 on Sep 21, 2015 |
# ? Sep 21, 2015 02:51 |
|
yeah I would recommend that you test with as little mocking as possible and try to only mock the system boundaries we tried with mock literally every dependency and uh it was a really bad idea in retrospect
|
# ? Sep 21, 2015 02:55 |
|
Oh. I just don't test
|
# ? Sep 21, 2015 02:56 |
|
automated testing can be nice but it's a significant investment understandable code is much more important than testing though
|
# ? Sep 21, 2015 03:15 |
|
qntm posted:why does strtok work like that like most ancient parts of the stdlib, it was originally done for convenience in a single threaded environment with a small number of users
|
# ? Sep 21, 2015 03:37 |
|
I don't get what's the deal with you people and testing my tests are dumb, incomplete pieces of poo poo "eh I'll maybe go back and make them better", and then actually I never go back for 90% of them it's p much regular coding but much simpler and lazier I guess you people are perfectionists. you don't need to aim for 100% coverage and bend the architecture to make it testable or some poo poo. just write some tests when it's obvious to do so and don't commit to them like some absolute authority, it's a disposable tool to help you
|
# ? Sep 21, 2015 03:46 |
|
i like writing tests for poo poo when i know what the results should be but i have no idea how to implement today i gave up trying to solve this dumb problem after getting 90% there: you have a list of objects, each with a int property that specifies how they should be ordered the objects are already ordered one of them gets moved to a diff position you gotta adjust the order properties of the list objects so that the list remains ordered, while making the least amount of changes if you have gaps between the order ints, most of the time you only need to change the one that moved, e.g. splitting the difference between the one before and after but if you move poo poo hundreds of times, the gaps eventually close and then you have to change a bunch of neighboring order properties so i was trying to come up with a solution that minimized the # of changes i think the right answer is to find the moved object and use some sort of approach that buffers the gaps between neighboring objects in both directions, hopefully not having to change more than 2-3 anyway i had a good test so i knew my solution wasn't complete and it made me feel stupid
|
# ? Sep 21, 2015 04:08 |
|
Symbolic Butt posted:I don't get what's the deal with you people and testing some people write software other people use and expect to work
|
# ? Sep 21, 2015 06:20 |
|
Blotto Skorzany posted:like most ancient parts of the stdlib, it was originally done for convenience in a single threaded environment with a small number of users that makes sense wait no it doesn't, what if I want to tokenise several strings at once
|
# ? Sep 21, 2015 10:43 |
|
so is python still the current hipste?
|
# ? Sep 21, 2015 11:02 |
|
I used to be lazy about unit tests until I was the only developer on a shared-code iOS/Android Xamarin app that was built with a very low budget and tight deadline. I didn't write many unit tests and took a few stupid design shortcuts because of the limited manpower. Those two things don't go together well. I spent way more time fixing some dumbass regression that I introduced than I would have just writing comprehensive unit tests in the first place, plus it would've been a lot easier to sleep at night. Pretty much wherever I used to just write a little console program to verify the results of the something, I instead write a unit test, and now a great weight has been lifted from my shoulders. That said, way too much ado is made about mocking for my tastes. Mock external services (internet, database), but use your actual internal service implementations where possible. As long as you only test one component with each test, that component can still safely depend on other components without mocking them, as long as they have also been tested. I mean, if the goal of a mock is to establish an object with the behaviour of a particular class, and you have a fully tested instance of that class that behaves exactly like itself, what's the point of introducing more and more extra code that the programmer must manually (and without any compiler assistance) make sure matches the semantics of the real class?
|
# ? Sep 21, 2015 11:08 |
|
AWWNAW posted:i like writing tests for poo poo when i know what the results should be but i have no idea how to implement why not just run through the list once while looking at the objects & changing the order properties if theyre wrong? or am i misunderstanding what youre trying to accomplish
|
# ? Sep 21, 2015 12:27 |
|
Snapchat A Titty posted:why not just run through the list once while looking at the objects & changing the order properties if theyre wrong? or am i misunderstanding what youre trying to accomplish the problem is minimizing the number of changes required. if all your sequence numbers converge to being consecutive then you have to change a bunch of objects. the hard part is just ensuring there are gaps between each object while minimizing the number of required changes I guess?
|
# ? Sep 21, 2015 15:04 |
|
comedyblissoption posted:i'm trying to think of another justifiable reason besides mocking and i literally can't come up with another reason frameworks, probably. like, i dunno how to define a "framework" as a distinct thing from an ordinary library except as a "pre-existing structure of interfaces and different modules implementing these interfaces that are composed via some form of DI so you can hook into it and customize whatever." ok so i googled framework, and yeah, I like my definition better than wikipedia's.
|
# ? Sep 21, 2015 18:33 |
|
|
# ? Jun 5, 2024 09:01 |
|
crazypenguin posted:frameworks, probably. a framework is like a library except it deliberately goes out of its way to do non-standard stuff and subvert the language and generally not play nicely with any other libraries you might want to use also it gets rewritten from scratch every time it reaches 80% completion, unlike libraries, which are simply abandoned at that point
|
# ? Sep 21, 2015 18:47 |