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
rotor
Jun 11, 2001

classic case of pineapple derangement syndrome

Soricidus posted:

the terrible part is what isn't in js. such as, e.g., any concept of libraries or modules or namespaces or anything, anything at all, that isn't pasting files together and praying they use compatible tricks to pretend the language supports libraries or modules or namespaces.

you can say the same thing about C

it's annoying but you just live with it

Adbot
ADBOT LOVES YOU

Soricidus
Oct 21, 2010
freedom-hating statist shill

rotor posted:

you can say the same thing about C

it's annoying but you just live with it

at least c has a standard mechanism that everyone uses, which provides for basic separation of interface and implementation, provides a basic level of isolation between compilation units, etc.

javascript doesn't even provide any standard method for textual inclusion!

Shaggar
Apr 26, 2006

rotor posted:

you can say the same thing about C

it's annoying but you just live with it

not if you don't have to.

rotor
Jun 11, 2001

classic case of pineapple derangement syndrome

Soricidus posted:

at least c has a standard mechanism that everyone uses, which provides for basic separation of interface and implementation, provides a basic level of isolation between compilation units, etc.

javascript doesn't even provide any standard method for textual inclusion!

idk I think require is fairly standard by now

rotor
Jun 11, 2001

classic case of pineapple derangement syndrome
I mean I know it's bad I'm just sayin is all

Bloody
Mar 3, 2013

rotor posted:

you can say the same thing about C

it's annoying but you just live with it

Yeah and like nobody uses c any more

rotor
Jun 11, 2001

classic case of pineapple derangement syndrome

Bloody posted:

Yeah and like nobody uses c any more

no, lots of people do.

CPColin
Sep 9, 2003

Big ol' smile.
I just took a list in Java and called stream() on it, then filter(), map(), and collect(). Even used a few lambda expressions. In production code. Am I a terrible programmer?

Shaggar
Apr 26, 2006
no. lambdas and linq are great

Shaggar
Apr 26, 2006
altho I disagree w/ the terms used in java linq (like map + reduce)

kitten emergency
Jan 13, 2008

get meow this wack-ass crystal prison

CPColin posted:

I just took a list in Java and called stream() on it, then filter(), map(), and collect(). Even used a few lambda expressions. In production code. Am I a terrible programmer?

no, but i think you just created a monad

Shaggar
Apr 26, 2006
which one of those is the monad, though?

kitten emergency
Jan 13, 2008

get meow this wack-ass crystal prison

Shaggar posted:

which one of those is the monad, though?

gently caress if i know, i still don't understand monads

Shaggar
Apr 26, 2006
I think individually they are each an monad but together they are also a monad.

kitten emergency
Jan 13, 2008

get meow this wack-ass crystal prison

Shaggar posted:

I think individually they are each an monad but together they are also a monad.

woah

CPColin
Sep 9, 2003

Big ol' smile.

uncurable mlady posted:

no, but i think you just created a monad

oh no

triple sulk
Sep 17, 2014



Are monads in Go called gonads?

Valeyard
Mar 30, 2012


Grimey Drawer

triple sulk posted:

Are monads in Go called gonads?

lol

Deacon of Delicious
Aug 20, 2007

I bet the twist ending is Dracula's dick-babies
don't feed your functions after midnight lest they become monads

kitten emergency
Jan 13, 2008

get meow this wack-ass crystal prison

triple sulk posted:

Are monads in Go called gonads?

no, that's what your pug has

Bloody
Mar 3, 2013

rotor posted:

no, lots of people do.

(I do on the daily)

Janitor Prime
Jan 22, 2004

PC LOAD LETTER

What da fuck does that mean

Fun Shoe

triple sulk posted:

Are monads in Go called gonads?

Nice!

Symbolic Butt
Mar 22, 2009

(_!_)
Buglord
please contain the monad chat to the pl thread

rotor posted:

idk I think require is fairly standard by now

no it's not, it's still exclusively a nodejs feature[*] and es6's import still has no support in any browsers afaik. most people seem to do the iife thing.

[*] unless you use a third party extension like requirejs :D

rotor
Jun 11, 2001

classic case of pineapple derangement syndrome

Symbolic Butt posted:

[*] unless you use a third party extension like requirejs :D

this is what I'm sayin, seems like most people are doin this now, at least for things you'd expect to be shared

Careful Drums
Oct 30, 2007

by FactsAreUseless
guys how do i get good at programming

i ask this question all the time and try to act on it and here i am, still sucking more dick at it than a five dollar hooker

Marsol0
Jun 6, 2004
No avatar. I just saved you some load time. You're welcome.

Careful Drums posted:

guys how do i get good at programming

i ask this question all the time and try to act on it and here i am, still sucking more dick at it than a five dollar hooker

no one is good at programming. some people are better at pretending.

get better at bullshitting

Shaggar
Apr 26, 2006

Careful Drums posted:

guys how do i get good at programming

i ask this question all the time and try to act on it and here i am, still sucking more dick at it than a five dollar hooker

step 1) use java or c#

Careful Drums
Oct 30, 2007

by FactsAreUseless

Shaggar posted:

step 1) use java or c#

well this isn't the pl thread, i do c#

Symbolic Butt
Mar 22, 2009

(_!_)
Buglord

Careful Drums posted:

well this isn't the pl thread, i do c#

learn all the principles in SOLID and a few other ones like law of demeter

I don't know if this is gonna make you a better programmer but it's my specific "get better at bullshitting" advice

Valeyard
Mar 30, 2012


Grimey Drawer
learn PHP

Bloody
Mar 3, 2013

Symbolic Butt posted:

learn all the principles in SOLID and a few other ones like law of demeter

I don't know if this is gonna make you a better programmer but it's my specific "get better at bullshitting" advice

I don't know what these are

Soricidus
Oct 21, 2010
freedom-hating statist shill

Valeyard posted:

learn PHP
i second this. in the same way that a good catholic must learn the deadly sins.

Soricidus
Oct 21, 2010
freedom-hating statist shill

rotor posted:

this is what I'm sayin, seems like most people are doin this now, at least for things you'd expect to be shared

sure, you can work round some js flaws with third-party extensions, and some people use them some of the time, and this is not a bad thing, so far as it goes.

there is a huge difference, though, between "javascript has modules" and "most of the benefits of modules can be achieved in javascript by using one of various third-party libraries, provided you don't mind that they are not available out of the box, they are not mentioned at all in many of the books or tutorials that you might try to learn from, and since they are not standardized in any way there is no guarantee of future support."

Careful Drums
Oct 30, 2007

by FactsAreUseless

Bloody posted:

I don't know what these are

off the dome, without looking it up

S is singularity principle
O is open-closed (open for extension, closed for modification)
L is for liskov-substitution (idk what it is but thats what its for)
I is for in-out or something?
D is for .. gently caress i don't know


1/5 fail

Careful Drums
Oct 30, 2007

by FactsAreUseless

Careful Drums posted:

off the dome, without looking it up

S is singularity principle
O is open-closed (open for extension, closed for modification)
L is for liskov-substitution (idk what it is but thats what its for)
I is for in-out or something?
D is for .. gently caress i don't know


1/5 fail

actual answers
https://en.wikipedia.org/wiki/SOLID_%28object-oriented_design%29

Symbolic Butt
Mar 22, 2009

(_!_)
Buglord

Bloody posted:

I don't know what these are

if you want to impress a girl (or a guy) who is really into oop they'll love it

DimpledChad
May 14, 2002
Rigging elections since '87.
This is my understanding of the principles. Someone correct me if I'm wrong:

S ingle responsibility principle - a module/class should only be responsible for one area of functionality. The traditional formulation is that it should have only one reason to change. In other words, if you have a class that reads data from a file and then displays it in a window, you might have to change the class for two reasons: first, if the window needs to look different, and second, if the document format changes. That violates the single responsibility principle.

O pen/close principle - disallow making API changes that would break existing client integrations.

L iskov substitution principle - a child class must not break the API of its parent class. In other words, a subclass could be substituted for a superclass without having to rewrite any of its clients.

I nterface segregation - it's better to have a small interface with many implementations for different clients, than one big interface with methods for different clients. For example, instead of a Logger class with logToFile() and logToDatabase() methods, it's better to have an ILogger interface with a log() method, and then FileLogger and DatabaseLogger implementations.

D epend on abstractions, not on implementations. This means that, in the above example, it's better for a client of the logger to depend on ILogger than on any of its implementations. This way, you can easily swap out implementations. This principle is what makes Dependency Injection/IoC possible.

karms
Jan 22, 2006

by Nyc_Tattoo
Yam Slacker

Careful Drums posted:

guys how do i get good at programming

i ask this question all the time and try to act on it and here i am, still sucking more dick at it than a five dollar hooker

EVERY MORNING I WAKE UP AND OPEN PALM SLAM A VHS INTO THE SLOT. IT'S Design Patterns: Elements of Reusable Object-Oriented Software AND RIGHT THEN AND THERE I START DOING THE MOVES ALONGSIDE WITH THE MAIN CHARACTER, uncle bob. I DO EVERY MOVE AND I DO EVERY MOVE HARD. MAKIN WHOOSHING SOUNDS WHEN I SLAM DOWN SOME factory objects OR EVEN WHEN I MESS UP inheritance. NOT MANY CAN SAY THEY ESCAPED THE GALAXYS MOST DANGEROUS anti patterns. I CAN. I SAY IT AND I SAY IT OUTLOUD EVERYDAY TO PEOPLE IN MY maker faire bongo team AND ALL THEY DO IS PROVE PEOPLE IN a maker faire bongo team CAN STILL BE IMMATURE JEKRS. AND IVE LEARNED ALL THE patterns AND IVE LEARNED HOW TO MAKE MYSELF AND MY APARTMENT LESS LONELY BY SHOUTING EM ALL. 2 HOURS INCLUDING WIND DOWN EVERY MORNIng

Careful Drums
Oct 30, 2007

by FactsAreUseless
two awesome posts

Adbot
ADBOT LOVES YOU

triple sulk
Sep 17, 2014



KARMA! posted:

EVERY MORNING I WAKE UP AND OPEN PALM SLAM A VHS INTO THE SLOT. IT'S Design Patterns: Elements of Reusable Object-Oriented Software AND RIGHT THEN AND THERE I START DOING THE MOVES ALONGSIDE WITH THE MAIN CHARACTER, uncle bob. I DO EVERY MOVE AND I DO EVERY MOVE HARD. MAKIN WHOOSHING SOUNDS WHEN I SLAM DOWN SOME factory objects OR EVEN WHEN I MESS UP inheritance. NOT MANY CAN SAY THEY ESCAPED THE GALAXYS MOST DANGEROUS anti patterns. I CAN. I SAY IT AND I SAY IT OUTLOUD EVERYDAY TO PEOPLE IN MY maker faire bongo team AND ALL THEY DO IS PROVE PEOPLE IN a maker faire bongo team CAN STILL BE IMMATURE JEKRS. AND IVE LEARNED ALL THE patterns AND IVE LEARNED HOW TO MAKE MYSELF AND MY APARTMENT LESS LONELY BY SHOUTING EM ALL. 2 HOURS INCLUDING WIND DOWN EVERY MORNIng

  • Locked thread