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.
 
  • Post
  • Reply
FlapYoJacks
Feb 12, 2009

Beamed posted:

it's okay to explicitly state methods vs static functions op

self/this is terrible and bad.

Adbot
ADBOT LOVES YOU

Ellie Crabcakes
Feb 1, 2008

Stop emailing my boyfriend Gay Crungus

ratbert90 posted:

self/this is terrible and bad.
I dunno, you seem alright to me

Beamed
Nov 26, 2010

Then you have a responsibility that no man has ever faced. You have your fear which could become reality, and you have Godzilla, which is reality.


ratbert90 posted:

self/this is terrible and bad.

not shitposting: how would you differentiate the borrowing of self without, uh, explicit self?

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder
is self anything more than syntactic sugar in rust? I've gone pretty deep into that part of the language and I can't think of anything about self that can't be stated with functions that take foo as an argument.

i'm definitely not a fan of self in other languages, but rust's take on self is very different. but i'm coming from higher level languages so i'm curious what the c++ take on this is.

DONT THREAD ON ME fucked around with this message at 00:59 on Aug 18, 2018

Beamed
Nov 26, 2010

Then you have a responsibility that no man has ever faced. You have your fear which could become reality, and you have Godzilla, which is reality.


MALE SHOEGAZE posted:

is self anything more than syntactic sugar in rust? I've gone pretty deep into that part of the language and I can't think of anything about self that can't be stated with functions that take foo as an argument.

i'm definitely not a fan of self in other languages, but rust's take on self is very different. but i'm coming from higher level languages so i'm curious what the c++ take on this is.

i came from c++ but i guess spent enough time in Java hell that I might prefer any sort of escape

FlapYoJacks
Feb 12, 2009
Lots of languages get by just fine without needing a self or this syntax.

Ellie Crabcakes
Feb 1, 2008

Stop emailing my boyfriend Gay Crungus

Well if those languages jumped off of a bridge, would you too?

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder

ratbert90 posted:

Lots of languages get by just fine without needing a self or this syntax.

yeah but if this is gonna be your foundational argument for avoiding a language it needs to be something other than a avoidable syntactical shorthand.

and self in the context of rust is really not the same as this in javascript or java, because in rust you're not dealing with an object system. it's literally just syntactical sugar.

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder
well there's one case i can think of where self has different semantics: you need it you want to do dynamic dispatch. which is maybe your objection to begin with?

DONT THREAD ON ME fucked around with this message at 03:00 on Aug 18, 2018

tef
May 30, 2004

-> some l-system crap ->

ratbert90 posted:

self.
self.
self.
self.
self.
self.

you save almost ~40 characters per file and that means you're closer to the metal

tef
May 30, 2004

-> some l-system crap ->

ratbert90 posted:

Lots of languages get by just fine without needing a self or this syntax.

i mean, python does, by virtue of making it lexically scoped

in every other language with this or self, it's dynamically scoped

rust does the lexical option, which, if you'd done it you'd be shitpostng &self

tef
May 30, 2004

-> some l-system crap ->
unless you'e one of these lisp-2 weirdos who want to have different namespaces for functions and variables, like ruby, smalltalk, and java

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?
gods yes, give me explicit scoping any day

it’s one of the best things about Smalltalk and Objective-C

only in Common Lisp and Dylan do I not feel its lack when writing or especially when reading code, and that’s because they do full multimethod dispatch instead of messaging

Schadenboner
Aug 15, 2011

by Shine
How can I get myself to a place where any of what you guys are talking about makes any sense?

:(

raminasi
Jan 25, 2005

a last drink with no ice

Schadenboner posted:

How can I get myself to a place where any of what you guys are talking about makes any sense?

:(

start by googling terms you don’t understand, like I’m about to do

Soricidus
Oct 21, 2010
freedom-hating statist shill

Schadenboner posted:

How can I get myself to a place where any of what you guys are talking about makes any sense?

:(

yosposter, on deathbed: "that time i spent with people i loved was ok i guess, but drat i wish i'd had a better grasp of pl theory"

Doom Mathematic
Sep 2, 2008

Schadenboner posted:

How can I get myself to a place where any of what you guys are talking about makes any sense?

:(

Honestly, (1) program in more different languages, (2) compare and contrast the differences in how programming works in those languages and then (3) look up the proper technical terms for those differences.

Schadenboner
Aug 15, 2011

by Shine
I've literally never programmed anything more than pasting together powershell poo poo from stack exchange. :(

Mind you, I don't especially want to be a programmer but I'd like to at least be able to go :hmmyes: and fake it like I sort of can with processors.

Is there like an equivalent of this but for software?



E: I was so sad when I found out this guy was a right-libertarian fucko. :sigh:

gonadic io
Feb 16, 2011

>>=

Schadenboner posted:

I've literally never programmed anything more than pasting together powershell poo poo from stack exchange. :(

Mind you, I don't especially want to be a programmer but I'd like to at least be able to go :hmmyes: and fake it like I sort of can with processors.

Is there like an equivalent of this but for software?



E: I was so sad when I found out this guy was a right-libertarian fucko. :sigh:

he is? drat that's such a good book.

and software is entirely about hiding all that poo poo, so while technically you can "deep delve" into exactly how the python interpreter or gcc is written there's little advantage in doing it. instead start a tutorial like https://learnpythonthehardway.org/book/preface.html and that'll take you through

Powerful Two-Hander
Mar 10, 2004

Mods please change my name to "Tooter Skeleton" TIA.


Soricidus posted:

yosposter, on deathbed: "that time i spent with people i loved was ok i guess, but drat i wish i'd had a better grasp of pl theory"

poster: "come closer my children, let me share my final words.... there's no such thing as good programming and I must..... Get out"

child 1:"sorry what? I had warnings turned off"

Ellie Crabcakes
Feb 1, 2008

Stop emailing my boyfriend Gay Crungus

Soricidus posted:

yosposter, on deathbed: "that time i spent with people i loved was ok i guess, but drat i wish i'd had a better grasp of pl theory"
"Either the Object-Oriented Paradigm goes or I do!"

Stringent
Dec 22, 2004


image text goes here

Schadenboner posted:

I've literally never programmed anything more than pasting together powershell poo poo from stack exchange. :(

Mind you, I don't especially want to be a programmer but I'd like to at least be able to go :hmmyes: and fake it like I sort of can with processors.

Is there like an equivalent of this but for software?

just Google "software interviews"

Phobeste
Apr 9, 2006

never, like, count out Touchdown Tom, man

Peeny Cheez posted:

"Either the Object-Oriented Paradigm goes or I do!"

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder

Peeny Cheez posted:

"Either the Object-Oriented Paradigm goes or I do!"

when terrible programmers die they go to enterprise hell

Powerful Two-Hander
Mar 10, 2004

Mods please change my name to "Tooter Skeleton" TIA.


"rip dad, filled up too much memory and had to be killed. nothing left now but to have him garbage collected"

Ellie Crabcakes
Feb 1, 2008

Stop emailing my boyfriend Gay Crungus

public class EternalIronicPunishmentFactoryBuilderImpl

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder

tef posted:

you save almost ~40 characters per file and that means you're closer to the metal


eschaton posted:

gods yes, give me explicit scoping any day

it’s one of the best things about Smalltalk and Objective-C

only in Common Lisp and Dylan do I not feel its lack when writing or especially when reading code, and that’s because they do full multimethod dispatch instead of messaging

i mean, rust is already very verbose in ways that aren't very helpful, if you had to explicitly scope everything it would be even worse. self isn't my favorite either but it cuts down on a reasonable amount of noise and doesn't seriously impact the semantics of the language. it's not like it implicitly imports members of self into the namespace.

the language still allows you to explicitly scope everything, so you can enforce it in a lint or whatever.

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder
rust has many problems, not being explicit enough just doesn’t seem like one of them

Slurps Mad Rips
Jan 25, 2009

Bwaltow!

MALE SHOEGAZE posted:

rust has many problems, not being explicit enough just doesn’t seem like one of them

rust is cool, but I feel like I’m fighting api decisions more than anything else

also rustconf was cool

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder

Slurps Mad Rips posted:

rust is cool, but I feel like I’m fighting api decisions more than anything else

also rustconf was cool

there's been a lot of discussion about stdlib decisions lately. honestly i dont have enough experience with writing low level code to have a strong opinion. removing the Zero type annoyed me.

more than anything i think the language just isn't ready to replace C/C++ and so when people come from C/C++ and find they actually cannot do everything they want to do, they're reasonably a bit upset. sure, you can write unsafe rust, but writing unsafe rust requires a strong knowledge of how the compiler is going to gently caress with your memory, i really don't think it's the same as writing C. but that may just be me: i've only started with learning C in the last month or so.

however, as someone coming from a high level language, it's really fantastic. i get 90% of what C/C++ give me and I get everything I want from HLLs.

DONT THREAD ON ME fucked around with this message at 15:18 on Aug 18, 2018

comedyblissoption
Mar 15, 2006

implicit this for member variables sucks (in C++, java, and C#) because you will get variable name collisions and you can get confused about scope

it's such a problem that lots of programming conventions will make internal member variables be prefixed with strings like "_" or "m_"

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder

comedyblissoption posted:

implicit this for member variables sucks

comedyblissoption
Mar 15, 2006

the other criticism you could make against self/this is that rust shouldn't have had member functions in the first place and tried to be more like a functional programming lang

for better or for worse, Rust intentionally wanted its syntax to be more familiar to the mainstream and not turn off people by making its syntax look like haskell or ml or whatever

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder
tail call elimination is apparently an unsolved/potentially unsolvable problem w/r/t lifetimes/borrowing so fully embracing functional would probably be a bit weird.

but i agree. i want the language to succeed since i'm investing in it. member functions are probably the part of OOP people actually want, (even though they're orthogonal to OOP), and rust provides them without most of the bad stuff. it seems like a reasonable tradeoff to me.

Workaday Wizard
Oct 23, 2009

by Pragmatica
what are member functions in rust?

tinaun
Jun 9, 2011

                  tell me...

Slurps Mad Rips posted:

also rustconf was cool


yeah it was, i had lunch sitting next to like half the core team and never felt so inadequate

distressing amount of blockchain startups though

Shinku ABOOKEN posted:

what are member functions in rust?

functions defined in inherent impl blocks that take self

tinaun fucked around with this message at 16:42 on Aug 18, 2018

Slurps Mad Rips
Jan 25, 2009

Bwaltow!

tinaun posted:


yeah it was, i had lunch sitting next to like half the core team and never felt so inadequate

i sat next to some ex-c++ users and we all talked about build systems because of course we did since i was present

im gonna be working with Alex to improve the cmake crate though, and also add meson reading support

Symbolic Butt
Mar 22, 2009

(_!_)
Buglord

Schadenboner posted:

How can I get myself to a place where any of what you guys are talking about makes any sense?

:(

Symbolic Butt posted:

Programming Languages by Dan Grossman is a great intro to PLT. It's about learning 3 languages and their key ideas (SML, Racket and Ruby). it forces you to think about a lot of stuff you never really think about in introductory p-lang courses (typing, mutability, scoping, dispatch etc)

compared to CS212 this is hella formal and academic so it may or may not be your cup of tea. Starting with SML may be a huge shock but is totally worth it. I really like this course better than just learning just one fp language in isolation because it puts other paradigms side by side to give you a better perspective.

I don't recall if it goes through historical stuff like lisp-2 namespaces, but it definitely puts you into a place to understand what tef is rambling about

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder
so i'm working on generating interrupts for my emulator now. i can implement it synchronously and i'm sure it will work fine, but i'm very tempted to run the cpu in its own thread and send interrupts to it. this seems to better match how the machine would actually work. am i right here or am i just making excuses to play with futures?

Adbot
ADBOT LOVES YOU

Beamed
Nov 26, 2010

Then you have a responsibility that no man has ever faced. You have your fear which could become reality, and you have Godzilla, which is reality.


god, don't work with rust futures yet

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply