|
brilliant!!!! i can always port.
|
# ? Sep 26, 2013 00:23 |
|
|
# ? May 13, 2024 08:13 |
gas (gay rear end Swinger)
|
|
# ? Sep 26, 2013 00:23 |
Socracheese posted:if you want it to run fast do it in a c-lang
|
|
# ? Sep 26, 2013 00:23 |
|
Pollyanna posted:what do you use classes for i'll try to explain this in basic terms while sidestepping any sick 'pos ignorance burns an easy example would be if you want to write a python thing dealing with 2d shapes, you might make a class called square which would contain a list of tuples which represent vertices that define where the square is, maybe even some variable that tells you what color it is. then there are class methods, i.e. functions that do something to your class object, so an example could be move_forward, and the function would manipulate ur vertices to "move" the square, like to move it up you might add some value to the y-components of the vertices. in reality tho if you want to mess with 2d stuff in python you can use the python image library and it does a lot of the work for you Socracheese fucked around with this message at 00:31 on Sep 26, 2013 |
# ? Sep 26, 2013 00:27 |
|
do it in ruby motion and get the power of both!!!!
|
# ? Sep 26, 2013 00:28 |
USSMICHELLEBACHMAN posted:do it in ruby motion and get the power of both!!!!
|
|
# ? Sep 26, 2013 00:29 |
|
okay, that makes sense. i get that objects n methods are good for simulating irl circumstances but how does that translate to a broader programming perspective, like for example how would you use oop for abstract things like an IM client? what would a typical class be in that regard? something like class Message? and yeah its prolly just that im inexperienced which is why i dont know what the gently caress Socracheese posted:i'll try to explain this in basic terms while sidestepping any sick 'pos ignorance burns but those are funny
|
# ? Sep 26, 2013 00:30 |
|
This is kind of entertaining, four developers are being pointed towards a two-day training on some visualisation toolkit, they have been provided with a list of questions and tasks to do before hand like write Fizz Buzz.quote:The Training is aimed for professional developers only. MrMoo fucked around with this message at 03:07 on Sep 26, 2013 |
# ? Sep 26, 2013 00:55 |
|
Pollyanna posted:okay, that makes sense. i get that objects n methods are good for simulating irl circumstances but how does that translate to a broader programming perspective, like for example how would you use oop for abstract things like an IM client? what would a typical class be in that regard? something like class Message? sure. let's look at an im client. say it has a class Window, which represents an open chat window. Let's give it a TextInputField, a Scrollbar, and a list of Messages. The Messages have an author and some text for the actual message... basically, the idea is that you break things down into natural components, and nest them inside each other, so that you can more easily abstract what's going on. the ConversationDisplay doesn't really know anything about what's going on inside the Messages; all it does is ask them how much space they need & then position them accordingly. likewise, the Messages don't know what they're being used for; for all they know, they could be displayed in a corner-of-the-screen notification bubble. everything is split up to be as simple as possible so you don't have to worry how everything combines with everything else; each class only has to deal with its own area of concern. classes are, in the end, a tool for making programs easier to understand.
|
# ? Sep 26, 2013 01:08 |
|
Pollyana if you're already comfortable with the basic python stuff (lists, tuples, dictionaries, opening a file idk) take a look at this course. Peter Norvig, the guy who teaches it, seems to be more of a functional programming kind of person and doesn't really like using classes regularly. imo this is the right approach with python. if you're insecure about python basics then check the mentioned cs101, I never watched it but I hear it's good. if you're into reading books check Think Python. I first learned python with that and it's p good. if you REALLY like oop, WHOA CLASSES AND STUFF then go learn ruby (if you don't care). but actually going with java would probably be the non-joke path to go but don't ask me about that, idk poo poo about java.
|
# ? Sep 26, 2013 01:18 |
|
I don't wanna be a p-langer forever and I plan to learn me some C# but I have absolutely no immediate thing to do with it at the moment so I'm still masturbating my mind with some bullshit
|
# ? Sep 26, 2013 01:20 |
|
Pollyanna posted:what languages are most popular for employers Java is for server jobs and Obj-C is for iOS jobs. They're both popular, so what matters the most is what kind of job you'd rather be doing.
|
# ? Sep 26, 2013 01:26 |
|
Nomnom Cookie posted:Java is for server jobs and Obj-C is for iOS jobs. They're both popular, so what matters the most is what kind of job you'd rather be doing. iOs jobs for sure. it's a pun too. Symbolic Butt posted:I don't wanna be a p-langer forever and I plan to learn me some C# but I have absolutely no immediate thing to do with it at the moment so I'm still masturbating my mind with some bullshit what does p-lang mean in this context. i thought it was just "programming language"? Symbolic Butt posted:Pollyana if you're already comfortable with the basic python stuff (lists, tuples, dictionaries, opening a file idk) take a look at this course. Peter Norvig, the guy who teaches it, seems to be more of a functional programming kind of person and doesn't really like using classes regularly. imo this is the right approach with python. i'm confident that i know the basics of Python, at least with regards to functional programming. and yeah python always seemed like more of a scripting language like MATLAB or something. i don't know why, but i don't like java PleasingFungus posted:sure. let's look at an im client. say it has a class Window, which represents an open chat window. Let's give it a TextInputField, a Scrollbar, and a list of Messages. The Messages have an author and some text for the actual message... it seems like this really works best when you're thinking of a typical application, like notepad or aim or chrome. something you can visualize and will eventually "have a look". the approach makes sense if you're making an im client, but it doesn't quite make as much sense if you're writing a web scraper or working with databases or something. that's kinda why i'm starting to look at gui stuff, python is good for the basic logic behind my stock analysis program but extending the functionality (i.e. making it a real app) is i feel better suited to a different language.
|
# ? Sep 26, 2013 01:34 |
|
Pollyanna posted:what does p-lang mean in this context. i thought it was just "programming language"? its u
|
# ? Sep 26, 2013 01:40 |
|
Pollyanna posted:it seems like this really works best when you're thinking of a typical application, like notepad or aim or chrome. something you can visualize and will eventually "have a look". the approach makes sense if you're making an im client, but it doesn't quite make as much sense if you're writing a web scraper or working with databases or something. that's kinda why i'm starting to look at gui stuff, python is good for the basic logic behind my stock analysis program but extending the functionality (i.e. making it a real app) is i feel better suited to a different language. definitely not. classes are a great way to break down the logic in any problem. think about like, a directory tree. I can have a class, File, and then a subclass of File called Directory (in this case, making directory inherit from File makes sense, because it really is a special case of File. in many cases you will use class composition instead of inheritance). The initialize method on Directory can call a method that searches for subfiles/directories within that dir, initialize them, and add them to an instance variable called file_array. every time a new directory gets initialized, it will check for its own subdirs/files within itself, and automatically initialize them. now you have a recursive data structure without needing to write a recursive loop, all you have to do is initialize the top directory. or if you're writing a pathfinding algorithm, it makes a lot of sense to have a class called "node" that represents one of the branches in a path. The node will ivars with pointers to its parent/child nodes. of course any problem can be solved without classes, it just makes many things way easier. if you're doing something like, writing a video encoder, you might have a couple of classes, say for something like a Frame, but i'd imagine it mostly comes down to lots and lots of computations. DONT THREAD ON ME fucked around with this message at 01:51 on Sep 26, 2013 |
# ? Sep 26, 2013 01:47 |
|
Pollyanna posted:iOs jobs for sure. it's a pun too. There you go. Time to start cranking out apps. Either you'll get a job on the strength of your portfolio or you'll start supporting yourself off your apps. Pollyanna posted:what does p-lang mean in this context. i thought it was just "programming language"? PHP Python Perl Ruby Pollyanna posted:i don't know why, but i don't like java I didn't like Java either until I started using it at work and learning the tools & libraries. Still, these isn't much point in using Java unless you're interested in systems programming. Pollyanna posted:it seems like this really works best when you're thinking of a typical application, like notepad or aim or chrome. something you can visualize and will eventually "have a look". the approach makes sense if you're making an im client, but it doesn't quite make as much sense if you're writing a web scraper or working with databases or something. that's kinda why i'm starting to look at gui stuff, python is good for the basic logic behind my stock analysis program but extending the functionality (i.e. making it a real app) is i feel better suited to a different language. OOP is about clumping together code and data in ways that make sense. Sometimes the clumps are obvious like Window and Button objects in a GUI, sometimes they're more abstract like a scraper task that hands off pages to the DB task. There are some cases where OOP doesn't make sense but they aren't as common as newbies think. Or just do like the last guy to work on my current project and hide your procedural code in static methods on a separate class.
|
# ? Sep 26, 2013 01:57 |
|
the thing with oop in python is that unless you're working with some kinds of stuff (web frameworks, guis) 90% of the time classes are way overkill. you already got modules, named tuples, function attributes, duck typing and whatever else. also, it always left me a strange impression how most introductory python courses seem to talk about classes last and it sounds so unnatural and... theoretical wishful thinking? I think I only got a good feel for oop when I messed around with ruby making a tetris game and it finally clicked with me how all the mumbojumbo makes sense in a language where oop is the main idiom. but idk, I'm a scrub. Pollyanna posted:what does p-lang mean in this context. i thought it was just "programming language"? definitive yospos consensus on p-langs are: Php, Python, Perl and Ruby those are pretty much all the slow and useless scripting languages. real programming heroes like Ulillillia use C. and lua and javascript are honorary p-langs I guess? the pl thread needs some serious discussion on this convention.
|
# ? Sep 26, 2013 02:02 |
|
OOP is about subtyping and dynamic dispatch, you don't even need classes to do it. but people have been taught "OOP = everything good" so they think it subsumes all modularity and polymorphism also javascript is definitely a p-lang.
|
# ? Sep 26, 2013 02:02 |
|
a p-lang is a language that pretends to be object-oriented, but has implemented "object" as "mutable hash map of string keys to arbitrary (possibly functional) runtime values, plus a pointer to a parent hash map"
|
# ? Sep 26, 2013 02:05 |
|
javascript is too bad to be a p-lang and lua is too uh, idk it's like no one programs just in lua it's always an extension of some other thing which makes it less of a plang
|
# ? Sep 26, 2013 02:06 |
|
JewKiller 3000 posted:a p-lang is a language that pretends to be object-oriented, but has implemented "object" as "mutable hash map of string keys to arbitrary (possibly functional) runtime values, plus a pointer to a parent hash map" for all the things i hate about perl and ruby this is not a core problem, both have real OO systems available (php, hosed if i know. i had bigger fish to fry than oo purity)
|
# ? Sep 26, 2013 02:17 |
|
lua is too scriptlang to be a plang nobody confuses it for a real lang which seems to happen all the fuckin time with php/python/ruby/js
|
# ? Sep 26, 2013 02:19 |
|
yeah lua is not useful enough to be a plang
|
# ? Sep 26, 2013 02:20 |
|
USSMICHELLEBACHMAN posted:yeah lua is not useful enough to be a plang this implies plangs are useful. i would've gone with "lua is too well-scoped to be a plang"
|
# ? Sep 26, 2013 02:21 |
the only good thing python has is its itertools lib
|
|
# ? Sep 26, 2013 02:51 |
being python-inspired is half the reason golang is unenjoyable to use because python syntax is loving ugly
|
|
# ? Sep 26, 2013 02:52 |
|
someone needs to write a fast ruby
|
# ? Sep 26, 2013 02:53 |
USSMICHELLEBACHMAN posted:someone needs to write a fast ruby there is one, it's called ruby 2.0
|
|
# ? Sep 26, 2013 02:54 |
|
Notorious b.s.d. posted:for all the things i hate about perl and ruby this is not a core problem, both have real OO systems available Perl has bless. PHP apes Java.
|
# ? Sep 26, 2013 02:58 |
|
sulk rackin' up the wrongposts like there's no tomorrow
|
# ? Sep 26, 2013 02:59 |
|
maybe i can give a better description p-langs take OOP, remove the static type system that makes complex subtyping tolerable and optimizable, and they enable mutability of just about anything at runtime, from adding/removing methods to changing the subtype hierarchy. the p-lang programming model is to write incomprehensible spaghetti dynamic dispatch code, and whenever you run into a problem, generate more of that code at runtime any gains that are possible from OOP are far outweighed by the negatives introduced by p-langs
|
# ? Sep 26, 2013 03:05 |
PleasingFungus posted:sulk rackin' up the wrongposts like there's no tomorrow if being nil is wrong then i don't wanna be right
|
|
# ? Sep 26, 2013 03:06 |
|
having nil is wrong unless nil has type alpha option and the alternative is a non-nil-tagged value of type alpha
|
# ? Sep 26, 2013 03:08 |
JewKiller 3000 posted:maybe i can give a better description if you're writing poor dynamic language code, that's on you for either writing poor tests and/or poor implementation outright.
|
|
# ? Sep 26, 2013 03:08 |
|
You just said that bad code is the programmer's fault. No poo poo, Sherlock.
|
# ? Sep 26, 2013 03:11 |
|
gucci void main posted:if you're writing poor dynamic language code, that's on you for either writing poor tests and/or poor implementation outright. no it isn't because dynamic languages remove perfectly good type checks for no acceptable reason. i shouldn't have to write those tests (of course i should write tests, just not for things that the compiler can easily check for me, if i would only give up my bad habits of writing in p-langs) seriously if you're going to write good code, then use a good programming language. there are two reasons to use a bad one: (1) your boss or the technical situation absolutely requires it, or (2) you are a bad programmer and you want a language that will accept your obviously incorrect programs on the condition that you never actually execute the parts that are wrong
|
# ? Sep 26, 2013 03:11 |
|
Doesn't GHC have a "gently caress the type system and make it compile" option? It's the best of both worlds.
|
# ? Sep 26, 2013 03:13 |
lol haskell
|
|
# ? Sep 26, 2013 03:13 |
|
tbh I wouldn't call javascript a p-lang unless you're doing something stupid like node.js or super heavy client side stuff. some javascript to validate a form is fine. obviously pre-compiled bytecode from a better language would be optimal, but as long as you aren't trying to write applications in it then whatever.
|
# ? Sep 26, 2013 03:15 |
|
|
# ? May 13, 2024 08:13 |
|
if you are actually constrained by a modern type system to the extent that you really cannot write the code you need to write, there will almost certainly be a magic cast you can use for such rare esoteric situations what you shouldn't do is say "gently caress type systems, i'm coding in python from now on"
|
# ? Sep 26, 2013 03:16 |