|
Beamed posted:it's okay to explicitly state methods vs static functions op self/this is terrible and bad.
|
# ? Aug 17, 2018 23:45 |
|
|
# ? Dec 7, 2024 06:33 |
|
ratbert90 posted:self/this is terrible and bad.
|
# ? Aug 17, 2018 23:52 |
|
ratbert90 posted:self/this is terrible and bad. not shitposting: how would you differentiate the borrowing of self without, uh, explicit self?
|
# ? Aug 17, 2018 23:53 |
|
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 23:59 on Aug 17, 2018 |
# ? Aug 17, 2018 23:57 |
|
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 came from c++ but i guess spent enough time in Java hell that I might prefer any sort of escape
|
# ? Aug 18, 2018 00:00 |
|
Lots of languages get by just fine without needing a self or this syntax.
|
# ? Aug 18, 2018 00:23 |
|
Well if those languages jumped off of a bridge, would you too?
|
# ? Aug 18, 2018 01:52 |
|
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.
|
# ? Aug 18, 2018 01:54 |
|
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 02:00 on Aug 18, 2018 |
# ? Aug 18, 2018 01:57 |
|
ratbert90 posted:self. you save almost ~40 characters per file and that means you're closer to the metal
|
# ? Aug 18, 2018 05:34 |
|
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
|
# ? Aug 18, 2018 05:37 |
|
unless you'e one of these lisp-2 weirdos who want to have different namespaces for functions and variables, like ruby, smalltalk, and java
|
# ? Aug 18, 2018 05:38 |
|
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
|
# ? Aug 18, 2018 08:34 |
|
How can I get myself to a place where any of what you guys are talking about makes any sense?
|
# ? Aug 18, 2018 09:47 |
|
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
|
# ? Aug 18, 2018 10:24 |
|
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"
|
# ? Aug 18, 2018 10:29 |
|
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.
|
# ? Aug 18, 2018 11:35 |
|
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 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.
|
# ? Aug 18, 2018 11:39 |
|
Schadenboner posted:I've literally never programmed anything more than pasting together powershell poo poo from stack exchange. 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
|
# ? Aug 18, 2018 11:43 |
|
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"
|
# ? Aug 18, 2018 11:43 |
|
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"
|
# ? Aug 18, 2018 11:44 |
|
Schadenboner posted:I've literally never programmed anything more than pasting together powershell poo poo from stack exchange. just Google "software interviews"
|
# ? Aug 18, 2018 11:49 |
|
Peeny Cheez posted:"Either the Object-Oriented Paradigm goes or I do!"
|
# ? Aug 18, 2018 11:51 |
|
Peeny Cheez posted:"Either the Object-Oriented Paradigm goes or I do!" when terrible programmers die they go to enterprise hell
|
# ? Aug 18, 2018 11:57 |
|
"rip dad, filled up too much memory and had to be killed. nothing left now but to have him garbage collected"
|
# ? Aug 18, 2018 11:58 |
|
public class EternalIronicPunishmentFactoryBuilderImpl
|
# ? Aug 18, 2018 11:58 |
|
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 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.
|
# ? Aug 18, 2018 13:52 |
|
rust has many problems, not being explicit enough just doesn’t seem like one of them
|
# ? Aug 18, 2018 13:55 |
|
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
|
# ? Aug 18, 2018 14:05 |
|
Slurps Mad Rips posted:rust is cool, but I feel like I’m fighting api decisions more than anything else 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 14:18 on Aug 18, 2018 |
# ? Aug 18, 2018 14:14 |
|
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_"
|
# ? Aug 18, 2018 14:17 |
|
comedyblissoption posted:implicit this for member variables sucks
|
# ? Aug 18, 2018 14:19 |
|
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
|
# ? Aug 18, 2018 14:22 |
|
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.
|
# ? Aug 18, 2018 14:30 |
|
what are member functions in rust?
|
# ? Aug 18, 2018 14:38 |
|
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 15:42 on Aug 18, 2018 |
# ? Aug 18, 2018 15:37 |
|
tinaun posted:
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
|
# ? Aug 18, 2018 15:46 |
|
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) 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
|
# ? Aug 18, 2018 15:55 |
|
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?
|
# ? Aug 18, 2018 16:37 |
|
|
# ? Dec 7, 2024 06:33 |
|
god, don't work with rust futures yet
|
# ? Aug 18, 2018 16:49 |