|
Mido posted:self sucks. tef posted:Lexical self is the best goddam thing in python, take a seat, shut the gently caress up, and learn why it's there. I have no loving patience for such foolish behaviour.
|
# ? Dec 7, 2014 17:23 |
|
|
# ? May 28, 2024 14:34 |
|
Python is fine and often a good choice, but it's dumb to pretend it doesn't have a bunch of warts. The same goes for pretty much every language. If you can't list a bunch of nasty design flaws in a given language, you probably don't know it as well as you think.
|
# ? Dec 7, 2014 17:34 |
|
So what's the argument people are making here?
I don't if any answer to this question is wrong or right.
Thermopyle fucked around with this message at 17:40 on Dec 7, 2014 |
# ? Dec 7, 2014 17:34 |
|
Let's meet in the middle here. "Python is a cool language that is nice to program in, but I find myself confused about its lexical scoping"
|
# ? Dec 7, 2014 17:42 |
|
So what's the deal with monads?
|
# ? Dec 7, 2014 17:46 |
|
seiken posted:
So what do you think of Perl compared to Python?
|
# ? Dec 7, 2014 18:49 |
|
Bruegels Fuckbooks posted:So what do you think of Perl compared to Python? Never really used it, don't have an opinion.
|
# ? Dec 7, 2014 18:56 |
|
Dominoes posted:So what's the deal with monads? Mo'nads mo' problems.
|
# ? Dec 7, 2014 19:01 |
|
Deus Rex posted:"I cannot rebut reasonable criticism of my pet programming language" I was going to do a point-by-point rebuttal, but then realized that would be petty and boring, so I chose a YOSquote instead.
|
# ? Dec 7, 2014 19:08 |
|
Thermopyle posted:Lexical self That's a good argument that self should be explicit as a parameter, but it doesn't address the issue of writing it every time you access a property. print(foo) currently checks locals then globals. Instead it could check locals, then self, then globals. Python has decided that this is too magic, but it's not incompatible with the other nice things about the way self is handled. (How would it know which object to do variable lookup in? It could take the one literally named 'self', there could be a special syntax in argument lists, or whatever else you can think of. You would be able to use this feature when defining a standalone function, and copy functions from one class to another, etc.)
|
# ? Dec 7, 2014 19:39 |
|
Dylan16807 posted:That's a good argument that self should be explicit as a parameter, but it doesn't address the issue of writing it every time you access a property. for a couple of reason * self is not already a keyword, and there are conventions where you would use a different word and there are people who are dumb and write something different. * changing the behavior of resolution to special-case self means methods are no longer just functions. this is unnecessary complexity (and its not even explicit complexity!)
|
# ? Dec 7, 2014 19:51 |
|
Soricidus posted:Python is fine and often a good choice, but it's dumb to pretend it doesn't have a bunch of warts. I like python a whole lot after having used it as my main professional work tool for close to a decade. However I recently decided to check out golang, and my first impression is that it's basically a better python. I'd love to hear you guys rip it to shreds if you can (and care to ).
|
# ? Dec 7, 2014 20:01 |
|
Karate Bastard posted:my first impression is that it's basically a better python. It is, enjoy
|
# ? Dec 7, 2014 20:12 |
|
A static type system without generics In The Year Of Our Lord 2014. The lack of exceptions is interesting but it means that if I want to do a bunch of things that could possibly fail in a row then I have a shitload of if err != nil { return err } everywhere.
vOv fucked around with this message at 20:20 on Dec 7, 2014 |
# ? Dec 7, 2014 20:15 |
|
vOv posted:A static type system without generics In The Year Of Our Lord 2014. The lack of exceptions is interesting but it means that if I want to do a bunch of things that could possibly fail in a row then I have a shitload of if err != nil { return err } everywhere. Given the way they handle duck typing/interfaces, generics haven't felt necessary. That said I could see it being annoying if you're trying to roll your own generic data structure. I actually sorta like the explicit error handling but that's just from previously writing a lot of C/C++. (The C++ code avoided using them as a rule)
|
# ? Dec 7, 2014 20:42 |
|
Karate Bastard posted:I like python a whole lot after having used it as my main professional work tool for close to a decade. However I recently decided to check out golang, and my first impression is that it's basically a better python. I've heard that a lot of people who like Go really like Rust, but my assumption is that Go and Rust are each suited to performing different tasks. Depending on what you're doing, it might be worth checking out Rust
|
# ? Dec 7, 2014 21:01 |
|
Dominoes posted:So what's the deal with monads? They're just a monoid in the category of endofunctors, what's the problem?
|
# ? Dec 7, 2014 21:31 |
|
SavageMessiah posted:They're just a monoid in the category of endofunctors, what's the problem?
|
# ? Dec 7, 2014 21:51 |
|
Progressive JPEG posted:Given the way they handle duck typing/interfaces, generics haven't felt necessary. That said I could see it being annoying if you're trying to roll your own generic data structure. There are other ways to do explicit error handling, like Rust's Option and Result types. But you can't implement those in Go because you don't have generics.
|
# ? Dec 7, 2014 22:18 |
|
Hi, poster Mido here, you may remember me from such posts as Mido posted:Recovered python addict chiming in. the problem with python, and what i was trying to illustrate with my example before you blew it out of proportion, is that there's a lot of "okay so heres a language construct -- but..." when teaching it. I think a type strict language like C#, Java or Processing is better suited for teaching beginners. type strict environment, consistent and well specced syntax a cyberpunk goose fucked around with this message at 22:22 on Dec 7, 2014 |
# ? Dec 7, 2014 22:20 |
|
Mido posted:Hi, poster Mido here, you may remember me from such posts as I don't know how academic programming courses are setup, but I learned from problem-solving - ie I needed to accomplish a specific task, so I learned and coded as much as I needed to make it happen. I could see a course presenting an assignment where you create objects and call their methods to do math and print text. It wouldn't have come up in practical learning; you'd just write a function to do math and print. Dominoes fucked around with this message at 22:57 on Dec 7, 2014 |
# ? Dec 7, 2014 22:38 |
|
Mido posted:Hi, poster Mido here, you may remember me from such posts as Hmm, I think you blew my response out of proportion. I was just pointing to someone who explained why explicit self was as it was and why it's a good thing.
|
# ? Dec 7, 2014 22:54 |
|
Thermopyle posted:Hmm, I think you blew my response out of proportion. I was just pointing to someone who explained why explicit self was as it was and why it's a good thing. I don't mind self in principle, implicit 'this' is the same kind of object instance magic just with a different approach. It's all pretty arbitrary. My only point is that Python by its design is a very slippery language which I have found to be a frustrating thing when teaching people who are very new to programming. Dominoes posted:New/self-taught programmer - Started with Python. Had a very easy time learning it. 'self' wasn't an issue since objects aren't important until you do complicated projects - ie you're no longer a beginner. My main struggle with objects was figuring out why you'd use them instead of dictionaries and functions. Thanks but I have tutored quite a few people who wanted to learn python and this has been a common sticking point. I am glad you didn't have a problem with it. a cyberpunk goose fucked around with this message at 23:22 on Dec 7, 2014 |
# ? Dec 7, 2014 23:20 |
|
Soricidus posted:guys, guys, this language that I am intimately familiar with behaves the way I expect, so clearly what it does is natural and logical and anyone who thinks it's flawed or inconsistent simply doesn't get it I actually literally and unironically found Ruby to behave exactly like I expected it to when I was learning it. It's a super fun language to write in for that reason.
|
# ? Dec 7, 2014 23:44 |
|
Mido posted:Thanks but I have tutored quite a few people who wanted to learn python and this has been a common sticking point. I am glad you didn't have a problem with it. Maybe it's a self-taught vs taught-to issue? I also taught myself on python, and at the time I recall that lexical self was no more or no less of a braintwister than the rest of the basic object model. I didn't understand why things were done that way, but I accepted it as part of the magic. Later, it prompted me to look under the hood and figure out the (fairly simple) mechanism at work, which I don't think I would have done with a magic pseudo-variable like this Now, if there's anything in Python I'm not fond of, it's super().
|
# ? Dec 8, 2014 00:06 |
|
Corla Plankun posted:I actually literally and unironically found Ruby to behave exactly like I expected it to when I was learning it. It's a super fun language to write in for that reason. Honestly Python isn't terrible. It has some idiosyncrasies due to its age. Most people live with them, or decide other benefits of the language (and the technically strong, not-complete-hipster community) outweigh the issues it does have. The horror, though, is Perl 5. And 6 too.
|
# ? Dec 8, 2014 00:41 |
|
C code:
|
# ? Dec 8, 2014 02:14 |
|
Haystack posted:Maybe it's a self-taught vs taught-to issue? I also taught myself on python, and at the time I recall that lexical self was no more or no less of a braintwister than the rest of the basic object model. I didn't understand why things were done that way, but I accepted it as part of the magic. Later, it prompted me to look under the hood and figure out the (fairly simple) mechanism at work, which I don't think I would have done with a magic pseudo-variable like this Do you dislike super() in other languages as well, or do you specifically dislike Python's version of super()?
|
# ? Dec 8, 2014 02:37 |
|
Dominoes posted:I'm too stupid to understand functional programming. But functions are cool, and so are Python's functools and itertools modules! In case it wasn't clear, that was a joke. Nobody expects that definition to be meaningful to anyone but ekmett.
|
# ? Dec 8, 2014 03:30 |
Haystack posted:Later, it prompted me to look under the hood and figure out the (fairly simple) mechanism at work, which I don't think I would have done with a magic pseudo-variable like this In what way is this a "a magic pseudo-variable?" E: In what way is it even a variable? Joda fucked around with this message at 04:00 on Dec 8, 2014 |
|
# ? Dec 8, 2014 03:39 |
|
Joda posted:In what way is this a "a magic pseudo-variable?" ...it looks like a variable when you use it?
|
# ? Dec 8, 2014 04:42 |
|
Joda posted:In what way is this a "a magic pseudo-variable?" Assignment to this used to be the way to do dynamic object allocation, before Stroustrup came up with new. This is the main reason why this is a pointer (it should have been a reference all along).
|
# ? Dec 8, 2014 06:39 |
|
sarehu posted:Honestly Java without an IDE is fine. It's better than Python or Ruby (or any dynamically typed language) without an IDE. I once had a programming test for a job where you had to write working code in a webpage - no syntax checking, no api lookup and you were timed and had a restriction of failing if you hit alt-tab or switched out of the browser. the joys of owning an ipad were then apparent
|
# ? Dec 8, 2014 09:11 |
All I meant was that the use of the this keyword as a pointer to the instance for which you called the member function in question makes sense (e.g. object at this address/ + whatever offset for the member variable or function you're trying to access is at.) Whether it's a pointer or a reference isn't really important; I'm fine with the way Java does it too. I just genuinely don't get the "magic pseudo variable" comment.
Joda fucked around with this message at 09:40 on Dec 8, 2014 |
|
# ? Dec 8, 2014 09:36 |
|
Why? It's a pseudo-variable because it's used like a variable except you can't assign anything to it yourself. It's magic because it's explicitly defined nowhere, yet points to the current object.
|
# ? Dec 8, 2014 10:55 |
|
Joda posted:E: In what way is it even a variable? If it's not a constant, then it's a variable, and if you're writing a program in which this is a constant, then your design is weird. If it has to be an lvalue to be a variable, then functional languages have no variables.
|
# ? Dec 8, 2014 11:21 |
|
TheresaJayne posted:I once had a programming test for a job where you had to write working code in a webpage - no syntax checking, no api lookup and you were timed and had a restriction of failing if you hit alt-tab or switched out of the browser. Ugh, why would you ever want to work for a company that did this kind of interview?
|
# ? Dec 8, 2014 12:49 |
|
TheresaJayne posted:I once had a programming test for a job where you had to write working code in a webpage - no syntax checking, no api lookup and you were timed and had a restriction of failing if you hit alt-tab or switched out of the browser. Holy poo poo what a dumb test
|
# ? Dec 8, 2014 12:49 |
|
Isn't that just an imitation of whiteboard interview? Those are quite common afaik.
|
# ? Dec 8, 2014 13:20 |
|
|
# ? May 28, 2024 14:34 |
|
Nobody expects a whiteboard to compile. Or they shouldn't, at least.
|
# ? Dec 8, 2014 13:51 |