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
eschaton
Mar 7, 2007

Don't you just hate when you wind up in a store with people who are in a socioeconomic class that is pretty obviously about two levels lower than your own?

meatpotato posted:

YOSPOS Terrible programmers are good friends :)

I printed out the Apple and NeXT manuals on my work's dime. I'm going to roll them into a huge spliff and smoke until I understand.

best way to understand

also I recall the article "Objects, Icons, and Software ICs" in the August 1986 issue of BYTE being good as an introduction to OOP

Adbot
ADBOT LOVES YOU

eschaton
Mar 7, 2007

Don't you just hate when you wind up in a store with people who are in a socioeconomic class that is pretty obviously about two levels lower than your own?
as a bonus the article right before it is an extensive one on smalltalk

so glad archive.org has a mostly complete BYTE collection from the days when they didn't suck

eschaton
Mar 7, 2007

Don't you just hate when you wind up in a store with people who are in a socioeconomic class that is pretty obviously about two levels lower than your own?
and the Brad Cox article isn't all that great after all, it's more "here's how you use pre-NeXT ObjC to do a thing" than it is "here's how I conceive of objects and classes etc."

Brain Candy
May 18, 2006

meatpotato posted:

I'm employed :smith:

My teammates are nice and help as much as they can but we have a rushed schedule and I've been bothering them too much anyway. I usually do embedded stuff in C, but that's about it. Now I'm writing a bunch of classes for a network protocol in babby's first C++11 that are supposed to work on both embedded and real-computer systems. If anything it's been a real eye-opener 'cause I was starting to get comfortable with my C stuff.

so this is might be part of the problem too, in that network protocols are basically not something OO is great for. like the common features are:

-how i write thing to {array, stream}
-size in network bytes marshalled, if you are feeling nice
-and a way to read from {array, stream} (which should static function for Reasons and isn't OO in any of the alternatives)

there might be other common things, but those can wait for v 2 after people start yelling about them

you can get really far with the minimum, which is just structs with a write method and static read method stapled on

DaTroof
Nov 16, 2000

CC LIMERICK CONTEST GRAND CHAMPION
There once was a poster named Troof
Who was getting quite long in the toof

NihilCredo posted:

if your language has first-class functions, just pass that poo poo like it's a fat blunt and you're a good friend

Brain Candy
May 18, 2006

maybe the difference in expectations is also that peeps expect you to staple read/write methods to structs and you're worried about making the most wonderfulest OO design

eschaton
Mar 7, 2007

Don't you just hate when you wind up in a store with people who are in a socioeconomic class that is pretty obviously about two levels lower than your own?

Brain Candy posted:

maybe the difference in expectations is also that peeps expect you to staple read/write methods to structs and you're worried about making the most wonderfulest OO design

so what you're saying is that he's trying too hard not to be terrible

AWWNAW
Dec 30, 2008

inheritance tends to be overused i think. big inheritance hierarchies are brittle and a huge bitch to refactor once you realize you hosed up by making a big inheritance hierarchy

some alternatives to think about are composition (maybe your object should have an instance of another class instead of deriving from it)

sometimes you don't need inheritance to extend a class's functionality: external functions can operate on your object, e.g. C# extension methods

thanks for reading, i put a lot of thought into this post

Bloody
Mar 3, 2013

gently caress I love extension methods

Bloody
Mar 3, 2013

turn multidimensional arrays into numeric matrices with one weird trick

DaTroof
Nov 16, 2000

CC LIMERICK CONTEST GRAND CHAMPION
There once was a poster named Troof
Who was getting quite long in the toof

AWWNAW posted:

inheritance tends to be overused i think. big inheritance hierarchies are brittle and a huge bitch to refactor once you realize you hosed up by making a big inheritance hierarchy

some alternatives to think about are composition (maybe your object should have an instance of another class instead of deriving from it)

sometimes you don't need inheritance to extend a class's functionality: external functions can operate on your object, e.g. C# extension methods

thanks for reading, i put a lot of thought into this post

inheritance tends to be easier to manage when it's more wide than deep

the taller the tree the more brittle the branches

AWWNAW
Dec 30, 2008

i love C# and F# and i hope i get to keep using them when everyone stops running windows servers

MononcQc
May 29, 2007

I've never been good at all that OO stuff and functional programming was so drat amazing for never having to think about that poo poo ever.

Brain Candy
May 18, 2006

eschaton posted:

so what you're saying is that he's trying too hard not to be terrible

p. much. really knowing what you can let slide is a thing that comes with experience

Stringent
Dec 22, 2004


image text goes here

NihilCredo posted:

last Friday I wrote my first abstract class. it lasted around 25 minutes before i thought "wtf am I doing" and changed it to an interface and a couple of static methods

another terrible programmer thread success story!

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder

meatpotato posted:

Understood, I sometimes write C like that for device drivers and it can work well in my simple mind. I even know how a vtable works (yeah, I know that's not impressive) it's just understanding how to use things like inheritance to my advantage, not disadvantage in a design that are hard.

I'm pissed off, I don't know poo poo about good OO architecture so here I am refucking the interfaces and relationships of these same objects for the Nth time in the last week because it "doesn't feel right" or because I didn't realize it needed to also do X and that screws everything up.

Yes I have Meyers' and the GoF books. No, I don't have time to read AND understand enough in time without an adderall prescription.

My co-workers are leaving me in the dust, even the new hire straight out of school (I've been here two years). Though I can poo poo on him because he doesn't bat an eye about committing code that causes dozens of compiler warnings (using int32_t as a pointer, wtf) or having a bunch of excessively-scoped (even global) variables all over his sources.

Goddammit I just want to quit this tech bullshit, the IoT can go straight to hell for all I care.

/rant

fwiw the vast majority of programmers would be way more impressed by someone who writes drivers than someone who can do oo

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder

NihilCredo posted:

last Friday I wrote my first abstract class. it lasted around 25 minutes before i thought "wtf am I doing" and changed it to an interface and a couple of static methods

tw for programmers stuck programming without interfaces

pepito sanchez
Apr 3, 2004
I'm not mexican

AWWNAW posted:

i love C# and F# and i hope i get to keep using them when everyone stops running windows servers

F# makes me loving static

eschaton
Mar 7, 2007

Don't you just hate when you wind up in a store with people who are in a socioeconomic class that is pretty obviously about two levels lower than your own?

Bloody posted:

gently caress I love extension methods

good thing a friend of mine added categories to Objective-C in the early 1990s then eh?

pepito sanchez
Apr 3, 2004
I'm not mexican
i mean

code:
	let rec quickSort = function
		| [] -> []
		| n::ns -> let lessthan, greaterEqual = List.partition ((>) n) ns
			quickSort lessthan @ n :: quickSort greaterEqual
why f# isn't used more with c# is a mystery to me? it's like a better LINQ i can use anywhere and has been kept a secret from me until recently. never die programming language

Janitor Prime
Jan 22, 2004

PC LOAD LETTER

What da fuck does that mean

Fun Shoe
Today I wrote a bunch of Java 8 and had to do shitload of stuff with collections. The new streaming api kicks rear end and writing java was actually fun instead of a stupid boilerplate chore.

NihilCredo
Jun 6, 2011

iram omni possibili modo preme:
plus una illa te diffamabit, quam multæ virtutes commendabunt

pepito sanchez posted:

i mean

code:
	let rec quickSort = function
		| [] -> []
		| n::ns -> let lessthan, greaterEqual = List.partition ((>) n) ns
			quickSort lessthan @ n :: quickSort greaterEqual
why f# isn't used more with c# is a mystery to me? it's like a better LINQ i can use anywhere and has been kept a secret from me until recently. never die programming language

I think the typical Microsoft stack code monkey distrusts anything that doesn't come out of the box. Until recently you had to install a plugin to get F# in VS, and you still need the power tools for such amazing tech as "folders"

when I told my boss we were going to do the next major project in f#, he had one single question: "are you sure Microsoft will still be supporting it 4-5 years from now?"

gonadic io
Feb 16, 2011

>>=

meatpotato posted:

YOSPOS Terrible programmers are good friends :).

This is hands down the best thread in yospos

gonadic io
Feb 16, 2011

>>=

pepito sanchez posted:

i mean

code:
	let rec quickSort = function
		| [] -> []
		| n::ns -> let lessthan, greaterEqual = List.partition ((>) n) ns
			quickSort lessthan @ n :: quickSort greaterEqual

I know it wasn't your point but bear in mind that 1) this is a terrible implementation of quicksort (large amount of churn, and using the first element as the pivot gives it awful performance on mostly sorted lists) and 2) please dont write your own sorts people, jeez

Bloody
Mar 3, 2013

eschaton posted:

good thing a friend of mine added categories to Objective-C in the early 1990s then eh?

I don't know what any of that means so ok

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder
react is dramatically better than every other js thing i've ever used and comically better than every frontend js framework

i dont even give a gently caress about shadowdoms or speed it's just really good at displaying things in the browser

really want to give relay/graphql a shot too

DONT THREAD ON ME fucked around with this message at 10:27 on Sep 16, 2015

fart simpson
Jul 2, 2005

DEATH TO AMERICA
:xickos:

MALE SHOEGAZE posted:

react is dramatically better than every other js thing i've ever used and comically better than every frontend js framework

i dont even give a gently caress about shadowdoms or speed it's just really good at displaying things in the browser

check out elm

oh no blimp issue
Feb 23, 2011

gonadic io posted:

I know it wasn't your point but bear in mind that 1) this is a terrible implementation of quicksort (large amount of churn, and using the first element as the pivot gives it awful performance on mostly sorted lists) and 2) please dont write your own sorts people, jeez

don't write any algorithms, someone has already done it quicker and better using less space

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder

fart simpson posted:

check out elm

elm is very cool but unlike react, there's almost no way i'm convincing anyone to start using it

fart simpson
Jul 2, 2005

DEATH TO AMERICA
:xickos:

Awia posted:

don't write any algorithms, someone has already done it quicker and better using less space

much like your posting

oh no blimp issue
Feb 23, 2011

i never said i follow my own advice

echinopsis
Apr 13, 2004

by Fluffdaddy

Bloody posted:

I don't know what any of that means so ok

gloatuing

Blinkz0rz
May 27, 2001

MY CONTEMPT FOR MY OWN EMPLOYEES IS ONLY MATCHED BY MY LOVE FOR TOM BRADY'S SWEATY MAGA BALLS

MALE SHOEGAZE posted:

tw for programmers stuck programming without interfaces

don't you work in ruby?

MononcQc
May 29, 2007

Awia posted:

don't write any algorithms, someone has already done it quicker and better using less space

rewrite all the algorithms as long as the objective is learning. just don't put 'farting around code' in prod.

oh no blimp issue
Feb 23, 2011

MononcQc posted:

rewrite all the algorithms as long as the objective is learning. just don't put 'farting around code' in prod.

this too, if you really want to know how a binary tree works go ahead and write one, just don't do it at work for a real project

Valeyard
Mar 30, 2012


Grimey Drawer

gonadic io posted:

This is hands down the best thread in yospos

Symbolic Butt
Mar 22, 2009

(_!_)
Buglord

Awia posted:

this too, if you really want to know how a binary tree works go ahead and write one, just don't do it at work for a real project

counterpoint: sometimes pooping a thing that kinda works is less work than spending a lot of time researching the best way to do it

fart simpson
Jul 2, 2005

DEATH TO AMERICA
:xickos:

Symbolic Butt posted:

counterpoint: sometimes pooping a thing that kinda works is less work than spending a lot of time researching the best way to do it

sometimes?

Symbolic Butt
Mar 22, 2009

(_!_)
Buglord

yeah uh what I mean is, sometimes poo poo doesn't matter and it'll never become a hotspot in the foreseeable future so you can be like WHATEVER YOLO and code the poorest poor man's hashmap or whatever

programmer's time is a precious resource, gotta allocate enough time to post in the 'pos yknow

Adbot
ADBOT LOVES YOU

gonadic io
Feb 16, 2011

>>=
i think Fart Simpson questioned your use of 'sometimes' as opposed to that always being the best way

  • Locked thread