|
Snapchat A Titty posted:i honestly dont know. in an ideal world i would transition to a normalized database, deprecating whatever was needed on the way. but idk what to do if youre locked on the schema and logging is out of the question actually i have a lot of control and i've been told that i'm allowed to try and fix it so that's pretty cool. logging is also not out of the question, i just don't really know how to go about it without instituting large architectural changes that would take a long time and require approval. anyhow i'm actually really excited about it. it's my first actual big undertaking w/ lots of responsibility since i started at a real programming job and i have a bad case of the job cares so i'm into that kind of thing.
|
# ? Jan 23, 2015 23:44 |
|
|
# ? May 25, 2024 14:59 |
ughhh the lectures for harvards cs50x are full of memes
|
|
# ? Jan 24, 2015 01:09 |
|
PokeJoe posted:ughhh the lectures for harvards cs50x are full of memes at harvard they're referred to as concentrations
|
# ? Jan 24, 2015 01:10 |
|
i've been working on eclipse plugins and i don't know which is worse, the byzantine di or the bottomless pit of abstraction layers jfc
|
# ? Jan 24, 2015 01:13 |
|
MALE SHOEGAZE posted:actually i have a lot of control and i've been told that i'm allowed to try and fix it so that's pretty cool. ok thats pretty cool i guess document the interface as good as possible, then figure out an optimal version of that, and work towards that. in an imaginary world you could even just build the final api and then rewrite the old api as a client of that, and then remove parts of the old one but thats a bit much
|
# ? Jan 24, 2015 01:19 |
|
someone wrote git in javascript but it's actually pretty cool http://gitlet.maryrosecook.com/docs/gitlet.html
|
# ? Jan 24, 2015 01:50 |
|
I did data first ef before code first ef and code first seems dumb especially when you already have a database. Why would you do codefirst.
|
# ? Jan 24, 2015 03:16 |
|
DaTroof posted:i've been working on eclipse plugins and i don't know which is worse, the byzantine di or the bottomless pit of abstraction layers dehumanize yourself and face to OSGI
|
# ? Jan 24, 2015 03:18 |
|
Space Whale posted:I did data first ef before code first ef and code first seems dumb especially when you already have a database. what does code first even mean somehow transform your objects into database tables?
|
# ? Jan 24, 2015 03:26 |
|
MeruFM posted:what does code first even mean Yes why bother designing your database when you can just write the same classes you would normally and have a Microsoft product magically turn it into a database, right?
|
# ? Jan 24, 2015 03:37 |
|
PokeJoe posted:ughhh the lectures for harvards cs50x are full of memes oh my god not memes, those are for idiot fuckers who use p-langs and don't have cattes.
|
# ? Jan 24, 2015 03:42 |
|
Brave GNU World posted:oh my god not memes, those are for idiot fuckers who use p-langs and don't have cattes. mlyp
|
# ? Jan 24, 2015 04:14 |
|
fritz posted:i started getting mysterious segfaults when i link my code against lib.a but they go away when i link against lib.dylib, am i gonna have to figure out how Xcode works to get in and debug this b/c: don't wanna i got pulled away from this before noon but i did discover that if i have a std::set<std::string> then .emplace("butt") works but .insert("cloud") leads to segfaults i am the worst programmer
|
# ? Jan 24, 2015 05:24 |
|
fritz posted:i got pulled away from this before noon but i did discover that if i have a std::set<std::string> then .emplace("butt") works but .insert("cloud") leads to segfaults seriously i was trying to get a std::set<mytype> working today and i gave up, it is bullshit and nothing works like it should and gently caress it all
|
# ? Jan 24, 2015 05:33 |
|
Snapchat A Titty posted:seriously i was trying to get a std::set<mytype> working today and i gave up, it is bullshit and nothing works like it should and gently caress it all 1. does mytype have a copy constructor and assignment operator 2. did you give it a comparator 3.
|
# ? Jan 24, 2015 05:53 |
|
MALE SHOEGAZE posted:so i have basically inherited a very large and very bad part of our code base. the db schema is entirely denormalized and there's almost no validation and everything is a poo poo gently caress. also basically every table has a yaml or json column and then those columns are eval'd and attribute accessors dynamically defined. and of course really important data ends up in there so have fun doing joins with regular expressions. anyhow the whole thing is held together by a boatload of workers that just run and run and run because if something breaks, chances are it's going to work again in a few hours when some random attribute on the other side of the database has changed. normalize the data and use stored procs
|
# ? Jan 24, 2015 06:01 |
|
emplace() lmfao
|
# ? Jan 24, 2015 06:05 |
|
hobbesmaster posted:1. does mytype have a copy constructor and assignment operator i know what these things mean but i seriously dont care to make all those things do the whatever etc
|
# ? Jan 24, 2015 06:21 |
|
yes that's why step 3 is there
|
# ? Jan 24, 2015 06:22 |
|
gently caress sorry yeah that is exactly it it didnt animate for some reason
|
# ? Jan 24, 2015 06:24 |
|
Shaggar posted:normalize the data and use stored procs https://www.youtube.com/watch?v=P3ALwKeSEYs
|
# ? Jan 24, 2015 07:17 |
|
use the ORM libraries as statement mappers
|
# ? Jan 24, 2015 07:18 |
|
lazy loading is a cancer
|
# ? Jan 24, 2015 07:18 |
|
MALE SHOEGAZE posted:so i have basically inherited a very large and very bad part of our code base. the db schema is entirely denormalized and there's almost no validation and everything is a poo poo gently caress. also basically every table has a yaml or json column and then those columns are eval'd and attribute accessors dynamically defined. and of course really important data ends up in there so have fun doing joins with regular expressions. anyhow the whole thing is held together by a boatload of workers that just run and run and run because if something breaks, chances are it's going to work again in a few hours when some random attribute on the other side of the database has changed. here is my generic advice on refactoring/rearchitecting existing production systems the best thing i can think to do first is to document everything. not heavily, but about ~4 whiteboards worth of scribbles, showing how the parts interlink and mingle. you can't begin to change the structure until you know how the pieces interconnect. it'll take some mechanical sympathy too, being on call, debugging, and grinding through the code to be able to describe it fluently. there are some things everyone knows the code does and thus never talks or thinks about. remember that the code you are seeing is a snapshot - a fixed point in the codebase's lifecycle. although you can read to understand how it works, you should read to understand how it got that way. things that seem unnecessarily divided are often caused by someone working outside of the team. there may be half refactored things, iterative steps the project took and were subsequently abandoned. from here, it gets a bit X-Y problem. you have the Y and you need to reverse engineer the X that got it that way. i have read enough code that i no longer go "wtf" so much: the code still smells i just have a better idea of what the person was attempting or trying to do in the first place. once you understand the code, the problem space, and the history of both, you can start to push changes back through. it's a lot easier to design in hindsight—often the early versions of a codebase are still exploring the problem. all i'm saying is, don't poo poo all over other peoples code (when you're new to a project). quote:anyhow, my question is, what's the best way to track state transformations in a web system like this? like, you know, I could intercept all database updates to the tables i'm worried about and stream them to bigquery or something but i have a feeling our dbas and network guys would not be very happy about that. to justify that blargh of text above: knowing more about your architecture would make it more obvious how to approach logging - does it make more sense to log everything or be able to trace one specific action through the system - how long do you need the historical data for and what sort of queries will you write. - how quickly do you need the historical data/logs it kinda also depends on how your system sorta operates: - is it a blackboard style system? you have a bunch of actors and a large mutable space - or it is it more like msr's orleans? persistent actors with message passing - what about a tuple space? could it be modeled as a disruptor like imax's - is it more like bounded sequential processing? is it a batch system? streaming? having a rough high level model will influence how you want to log things too. . it is useful to think up 'perfect' ways of solving a problem, if only to let yourself think about the code without contraining yourself too early, but also look for cheap hacks. i find it's often a combination of the two: a cheap hack that works, doesn't get in the way of doing it right in future, and although cheap, not too clever for its own good. the easiest thing would be: log to syslogd, send logs to central server. alternatively log to a local file + run log rotation and collection. it also depends on the platforrm you deploy on and what sort of things you're layering on? hardware? aws? clouuud? there are other approaches like google's dapper/twitter's zipkin for tracing actions in a distributed system and you might be able to reuse some of the tooling twitter released. another approach is to just use the database. create a table, append entries to the table when things change, possibly as triggers. run regular cleanup operations/compaction. shrug edit: another thing might be to change the database stuff to avoid in-place changes and mutation: add a timestamp column. or it might be easier to stick logs and older versions of the yaml/json inside themselves, if that makes any sense. instead of logging out of band, smuggle it inside those json and yaml columns. it might be a case of doing a little bit of all of these: each thread writes it's own log, and has a uuid and a timestamp. it logs all actions and changes made to the local disk/syslog equivilent. when it changes or creates a new object, it appends it's uuid and timestamp to a list inside the json/yaml document. from here you can take any document and reconstruct every operation by matching those uuid/timestamps to the logs. shrug tef fucked around with this message at 11:11 on Jan 24, 2015 |
# ? Jan 24, 2015 10:46 |
|
tef posted:remember that the code you are seeing is a snapshot - a fixed point in the codebase's lifecycle. although you can read to understand how it works, you should read to understand how it got that way. i've taken to adding a comment linking the issue that documents whatever obscure edge case necessitated the code i put in that looks like the code that a retard would write. the people that will come after will definitely just be like wtf and erase it causing a regression otherwise. i know this sounds retardedly obvious, but no one ever does it.
|
# ? Jan 24, 2015 12:31 |
|
Stringent posted:i've taken to adding a comment linking the issue that documents whatever obscure edge case necessitated the code i put in that looks like the code that a retard would write. the people that will come after will definitely just be like wtf and erase it causing a regression otherwise. all it takes is one actual retard go run around making 'fixes' for this to go back to worthless. even if you've miraculously eliminated all bad coders (and hangovers), after it gets touched again, how do i know what's for the bug and what's not? imo, the only thing i trust is an explanation. it guarantees you engaged your brain even if i don't agree and i can match it quickly against the code that's actually there also writing explanations for retarded code sometimes gives you a better idea
|
# ? Jan 24, 2015 15:27 |
|
Chill Callahan posted:lazy loading is a cancer my boss loves doing this
|
# ? Jan 24, 2015 16:56 |
|
DaTroof posted:i've been working on eclipse plugins and i don't know which is worse, the byzantine di or the bottomless pit of abstraction layers Welcome to hell! I don't think I can help, but let me tell you about some of the circles. First you get to figure out OSGi. Then (to build outside of eclipse) there's maven and Tycho, which fucks with maven weird and has some really annoying behavior. Then there's digging through the mountains to find the correct bullshit for plugin.xml. Then there's the sea of interfaces with partial documentation. Then there's the loving mystifying design like IAdaptable which is just... I don't have the words.
|
# ? Jan 24, 2015 16:57 |
|
Arcsech posted:Yes A lovely DB already exists. Instead of magicing that into classes and contexts and poo poo, we're recreating what's there manually.
|
# ? Jan 24, 2015 17:47 |
|
MALE SHOEGAZE posted:wrote git in javascript i've lived too long
|
# ? Jan 24, 2015 20:40 |
|
i for one welcome our new es6 overlords
|
# ? Jan 24, 2015 20:45 |
|
yield you good
|
# ? Jan 24, 2015 21:25 |
|
comedyblissoption posted:The OOP mania where everything must be an object and an object is the smallest unit of program composition has forced these insane programming styles and boilerplate. I came across a good distinction in some book that said that a program will have objects in the OO sense which should have all the fancy bells and whistles that implies, and also have things that are incidentally implemented as objects but which are just dumb little data holders and you shouldn't care about OO principles for them
|
# ? Jan 24, 2015 22:38 |
|
tef posted:here is my generic advice on refactoring/rearchitecting existing production systems anyhow i need to think about your questions so i will and then post them to this thread
|
# ? Jan 25, 2015 02:26 |
|
MALE SHOEGAZE posted:thanks tef. i've actually been dealing with this code for about 6 months and i have a decent appreciation of how it got to where it is. i've mostly been doing documentation, bug fixes, and hacking in monkey patches ahead of API changes in services we deal with (also hacking in product changes). nice.
|
# ? Jan 25, 2015 03:03 |
|
crazypenguin posted:Welcome to hell! I don't think I can help, but let me tell you about some of the circles. the interfaces never loving end. every time i think i'm at the center of the onion, i find another layer duct-taped to the other side of it. i spent weeks figuring out poo poo like document providers, partitioning, and source viewer configurations so i could build a custom editor, and then i tried to integrate with dltk, and it turned everything i knew on its ear documentation? lmao, you can tell when i've been working on this plugin by counting the open tabs in my browser window. 90% of them are stackoverflow questions without useful answers i haven't even touched maven and tycho yet except to import an existing plugin's project into eclipse
|
# ? Jan 25, 2015 16:54 |
|
you guys i'm 6 months into my first job as a developer out of school and i still write disgusting, horrible code. i'm still a pathetic programmer. my coworkers like me though. how long can i keep this up until they start to realize i'm a fraud
|
# ? Jan 28, 2015 06:17 |
|
everyone knows recent grads are worthless until they've been retrained so don't worry about it
|
# ? Jan 28, 2015 06:18 |
|
unsanitary posted:you guys i'm 6 months into my first job as a developer out of school and i still write disgusting, horrible code. i'm still a pathetic programmer. my coworkers like me though. how long can i keep this up until they start to realize i'm a fraud same boat (except i didnt do school). it's taken me about 6 months to realize i'm not a fraud so i dont know maybe you're screwed forever!!!
|
# ? Jan 28, 2015 06:21 |
|
|
# ? May 25, 2024 14:59 |
|
unsanitary posted:you guys i'm 6 months into my first job as a developer out of school and i still write disgusting, horrible code. i'm still a pathetic programmer. my coworkers like me though. how long can i keep this up until they start to realize i'm a fraud they like you because their code is even worse
|
# ? Jan 28, 2015 06:27 |