Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Locked thread
kitten emergency
Jan 13, 2008

get meow this wack-ass crystal prison

Shaggar posted:

that's a common argument for bad languages and bad frameworks that's always a lie. knockout.js is better for large apps and for getting small apps out the door. likewise mvc/webapi are better and faster for both small and large apps than flavoroftheweek frameworks like node or ruby.

christ, what an rear end in a top hat

Adbot
ADBOT LOVES YOU

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder
hey I"m looking at this dependency inversion principle wiki and I am confused by these two things:

--All member variables in a class must be interfaces or abstracts.
--All concrete class packages must connect only through interface/abstract classes packages.

can someone plz explain these? I understand what interfaces/abstract classes are but I"m confused.

http://en.wikipedia.org/wiki/Dependency_inversion_principle

Zaxxon
Feb 14, 2004

Wir Tanzen Mekanik
Basically it means "program to interfaces" I'm not sure what that wikipedia stuff means either.

http://objectmentor.com/resources/articles/dip.pdf

Jonny 290
May 5, 2005



[ASK] me about OS/2 Warp
i had a new program to write and i picked up perl, and on line 3 i said "naw too easy" and rm'd it and did it in ruby.

it's an ok language, i guess. i dunno.

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder
i really doubt i will ever find anything i like more than i can code faster in than ruby for small projects





rip if you use ruby for big projects

Blinkz0rz
May 27, 2001

MY CONTEMPT FOR MY OWN EMPLOYEES IS ONLY MATCHED BY MY LOVE FOR TOM BRADY'S SWEATY MAGA BALLS
ruby and python are rly good for tooling but tbh not great for much other stuff

Notorious b.s.d.
Jan 25, 2003

by Reene
you should be programming to interfaces even if you are not using DI

b0lt
Apr 29, 2005

Notorious b.s.d. posted:

you should be programming to interfaces even if you are not using DI

"programming to interfaces" is a tautology

Notorious b.s.d.
Jan 25, 2003

by Reene

b0lt posted:

"programming to interfaces" is a tautology

it is not. i am talking about java interfaces

Luigi Thirty
Apr 30, 2006

Emergency confection port.

lol if your interface isn't COM1

Jabor
Jul 16, 2010

#1 Loser at SpaceChem
Single-implementation interfaces are dumb as poo poo. Yes, your class should have a sane public interface and you should stick with it instead of gratuitously adding methods all over the place. No, you don't really need a FooManager interface plus a FooManagerImpl class.

If you find that later on you do need multiple distinct implementations, you can refactor things easily enough.

akadajet
Sep 14, 2003

FamDav posted:

fy i trust no man or woman who uses the acronym SOLID unironically because every person i know who has also insists on way more inheritance than is ever necessary.

my old company used to ask candidates if they knew what SOLID was during interviews. "think that's one of those anti-patterns i've been reading about"

Brain Candy
May 18, 2006

Jabor posted:

Single-implementation interfaces are dumb as poo poo. Yes, your class should have a sane public interface and you should stick with it instead of gratuitously adding methods all over the place. No, you don't really need a FooManager interface plus a FooManagerImpl class.

If you find that later on you do need multiple distinct implementations, you can refactor things easily enough.


lol if you don't write interfaces as declarations of what you need while writing other code

fritz
Jul 26, 2003

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

rjmccall
Sep 7, 2007

no worries friend
Fun Shoe
three obvious possibilities

you might have a static initialization ordering problem, this should be really obvious in the debugger

you might be depending on something getting linked in (a category?) from an unused object in the .a

your dylib is not actually the same code as your .a

rjmccall
Sep 7, 2007

no worries friend
Fun Shoe
static archives are a neat technology but unfortunately they solve an almost completely different technical problem from dynamic libraries and so the semantics are really different

~Coxy
Dec 9, 2003

R.I.P. Inter-OS Sass - b.2000AD d.2003AD

Jabor posted:

Single-implementation interfaces are dumb as poo poo. Yes, your class should have a sane public interface and you should stick with it instead of gratuitously adding methods all over the place. No, you don't really need a FooManager interface plus a FooManagerImpl class.

If you find that later on you do need multiple distinct implementations, you can refactor things easily enough.

I dislike the fact that instead of developing the tools to make unit testing easier and more capable, we instead cargo-cult these insane programming styles

SYSV Fanfic
Sep 9, 2003

by Pragmatica

MALE SHOEGAZE posted:

i really doubt i will ever find anything i like more than i can code faster in than ruby for small projects





rip if you use ruby for big projects

Please quantify big.

KOTEX GOD OF BLOOD
Jul 7, 2012

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
xcode fuckin owns and ill fight anyoen who disagrees

triple sulk
Sep 17, 2014



SYSV Fanfic posted:

Please quantify big.

Anything that isn't a single file.

SYSV Fanfic
Sep 9, 2003

by Pragmatica

triple sulk posted:

Anything that isn't a single file.

As long as coding styles mandate classes and interface use, what is the problem? I just started hacking in python and I am not having any issues splitting things up into files.

triple sulk
Sep 17, 2014



SYSV Fanfic posted:

As long as coding styles mandate classes and interface use, what is the problem?

You're using Ruby.

Captain Foo
May 11, 2004

we vibin'
we slidin'
we breathin'
we dyin'

Luigi Thirty posted:

lol if your interface isn't COM1

fritz
Jul 26, 2003

rjmccall posted:

three obvious possibilities

you might have a static initialization ordering problem, this should be really obvious in the debugger

you might be depending on something getting linked in (a category?) from an unused object in the .a

your dylib is not actually the same code as your .a

i think i can rule out #3 b/c I'm building the library as part of the process (i wrote the library and this code is a special case to interface it and a vendor's sdk)

fritz
Jul 26, 2003

KOTEX GOD OF BLOOD posted:

xcode fuckin owns and ill fight anyoen who disagrees

why cant i figure out how to set include paths in it

(i build from a cmake file, and had it make an Xcode project, but it didn't escape a space in a directory (vendor's fault, not mine) and i cant find where it's set)

Carthag Tuek
Oct 15, 2005

Tider skal komme,
tider skal henrulle,
slægt skal følge slægters gang



go to build settings put include in the search field??

fritz
Jul 26, 2003

fritz posted:

why cant i figure out how to set include paths in it

(i build from a cmake file, and had it make an Xcode project, but it didn't escape a space in a directory (vendor's fault, not mine) and i cant find where it's set)

i found "Search Paths -> User Header Search Paths" but I have to enter a path in there manually and four different times for debug/minsizerel/relwithdebinfo/release? !?!?!?


and the linker's adding a "/Debug" to the end of a -L search path

Carthag Tuek
Oct 15, 2005

Tider skal komme,
tider skal henrulle,
slægt skal følge slægters gang



no you add it to the rightmost thing or whatever, that makes it default for debug/releasE/etc builds unless you override it in the leftmost build specific ones or whatever

idgaf its friday sorry

fritz
Jul 26, 2003

i don't have a thing on the right for that option, it's only letting me do things in the left boxes

and changes don't seem to be propagating, I'm adding things in 'other linker flags' and it's not showing up in the command line in the build error window


back to lldb and valgrind i guess

Malcolm XML
Aug 8, 2009

I always knew it would end like this.

~Coxy posted:

I dislike the fact that instead of developing the tools to make unit testing easier and more capable, we instead cargo-cult these insane programming styles

Haskell does this well by forcing IO to be explicit and since IO is the untestable poo poo in programs that requires some sort of mock or injection it makes refactoring code to be small functions that transform values (read: easily testable) much more obvious

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder

SYSV Fanfic posted:

As long as coding styles mandate classes and interface use, what is the problem? I just started hacking in python and I am not having any issues splitting things up into files.

ruby's idea of an interface is dynamically overriding classes at runtime an injecting them with whatever you need

Carthag Tuek
Oct 15, 2005

Tider skal komme,
tider skal henrulle,
slægt skal følge slægters gang



MALE SHOEGAZE posted:

ruby's idea of an interface is dynamically overriding classes at runtime an injecting them with whatever you need

youre saying that like its a bad thing

Objective-C code:
#include <Foundation/Foundation.h>
#include <objc/runtime.h>

@interface Hack : NSObject
@end

@implementation Hack

+ (void)load
{
    Class appControllerClass = objc_getClass("AppController");
    SEL validCodeSelector = sel_getUid("validCode");
    
    Ivar isRegisteredIvar = class_getInstanceVariable(appControllerClass, "isRegistered");
    IMP newValidCodeImp = imp_implementationWithBlock(^(id self){
        NSLog(@"Hacked!");
        object_setIvar(self, isRegisteredIvar, (__bridge id)((void *)YES));
        return YES;
    });
    
    Method validCodeMethod = class_getInstanceMethod(appControllerClass, validCodeSelector);
    
    method_setImplementation(validCodeMethod, newValidCodeImp);
    NSLog(@"Swizzled!");
}

@end
loading that into a certain app causes it to become registered :coal:

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder
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.

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.

is there maybe just a simple logging strategy i can employ because logging has sucked so far. using logging to track the (month long) lifecycle of an object in a load balanced and multithreaded application is extremely frustrating

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder
also i'm working on a project and i'm trying to use DIPlo and i'm making myself really confused

MrMoo
Sep 14, 2000

Have a look at the new MySQL, MariaDB supported functionality, one of them has dynamic column support and I recall some DB supporting JSON column types.

Carthag Tuek
Oct 15, 2005

Tider skal komme,
tider skal henrulle,
slægt skal følge slægters gang



idk that sounds really messed up. the best idea i have is transaction logging but i guess youve tried that so i dunno

e: lmao yeah use mysql

comedyblissoption
Mar 15, 2006

~Coxy posted:

I dislike the fact that instead of developing the tools to make unit testing easier and more capable, we instead cargo-cult these insane programming styles
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.

Not to say that objects are a bad idea, but making them the smallest unit of program composition is a Bad Idea.

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder

MrMoo posted:

Have a look at the new MySQL, MariaDB supported functionality, one of them has dynamic column support and I recall some DB supporting JSON column types.

nah i'm working towards getting all of those columns deprecated.

Snapchat A Titty posted:

idk that sounds really messed up. the best idea i have is transaction logging but i guess youve tried that so i dunno

e: lmao yeah use mysql

isn't there something i can do to fix this?? like a hadoop??

Carthag Tuek
Oct 15, 2005

Tider skal komme,
tider skal henrulle,
slægt skal følge slægters gang



MALE SHOEGAZE posted:

isn't there something i can do to fix this?? like a hadoop??

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

Adbot
ADBOT LOVES YOU

MrMoo
Sep 14, 2000

With the MySQL setup you can go crazy with foreign keys across the JSON datasets which would provide the protection.

Other than that start removing query permissions and enforcing usage of stored procedures. Replace the denormalized tables with views and make use of virtual columns when needed. If non-MySQL you use a materialized view to accelerate the performance when required.

  • Locked thread