• What are you working on?
    5,004 replies, posted
[QUOTE=adnzzzzZ;49587576][video=youtube;QM1iUe6IofM]http://www.youtube.com/watch?v=QM1iUe6IofM[/video] This guy makes a lot of good points. Lately I've been gravitating more towards procedural code as much as possible and it's nice to see someone explain a lot of the things I've been thinking about as this guy did. The only thing that for my use case specifically OOP still makes a lot of sense is when writing gameplay objects. The relationship here between code and simulation is a 1:1 mapping so it makes no sense to try anything else. But anything OTHER than gameplay objects it doesn't make a lot of sense to wrap in classes. The more important thing though is that I've been gravitating towards minimizing mental effort spent while coding, and this usually results in things that go against the "best" practices. For instance, I've been copy pasting a lot of my own code around lately instead of properly making it reusable, simply because it's the thing that takes less mental effort in the long run. In the general case doing this is bad, but when you're working alone it totally isn't because the code base is just so small. Even something like 100k lines of code you can still have the general way things are tied together in short term memory.[/QUOTE] I really think this video should be named "Why [B]I[/B] Think Object-Orientated Programming is Bad" I watched the entire video, and he does make good points against encapsulation and splitting up stuff-that-should-be-code into a billion functions, but ultimately programming is done how you want to do it. If you wanna do OOP, that's cool. If you wanna do procedural programming, that's cool too. There really isn't a "THIS WAY IS OBJECTIVELY WORSE THAN THE OTHER WAY" as stated in this video. Program how you wanna, and if it runs well and serves your purpose then who cares what other people think.
The C# community has me pretty disappointed right now. I want to parse webm-audio from a stream and tried to use NAudio because that's where everyone points to for anything C# and audio. NAudio has support for vorbis through "NVorbis", but webm container support is described in a help-wanted issue that's been open for almost a year. NAudio also has support for MediaFoundation which would put the decoding burden on Microsoft's classes. But not from streams! One can only open filenames and URLs (and if the URL is too long, I get an exception in native code with no MSDN documentation covering it). Poor work, Microsoft. No webm-specific libraries either. That made me realize that for what I want to do, [B][I]there are no libraries for C#[/I][/B] that can help. Node.js and Python have tons of library support for this kind of thing. Yet C#-- a more "serious" language-- has squat. I feel like everyone's packed up and left for the hip new languages. So now I'm building libwebm from source and hoping to god I can get C++ interop working.
[QUOTE=ZestyLemons;49589712]I really think this video should be named "Why [B]I[/B] Think Object-Orientated Programming is Bad" I watched the entire video, and he does make good points against encapsulation and splitting up stuff-that-should-be-code into a billion functions, but ultimately programming is done how you want to do it. If you wanna do OOP, that's cool. If you wanna do procedural programming, that's cool too. There really isn't a "THIS WAY IS OBJECTIVELY WORSE THAN THE OTHER WAY" as stated in this video. Program how you wanna, and if it runs well and serves your purpose then who cares what other people think.[/QUOTE] The problem is with defaults and the fact that you don't live on an island. If you're ever been to, well, pretty much any programming forum you can see people leave comments like "This is so stupid! You have to choose the right tool for the job!". And then we proceed to write 99% of code in an object-oriented style with the other 1% being bash scripts. That's NOT the best tool for the job and people actually picking different tools for different projects are so absurdly rare they might as well not exist. Our preferences, our workplace's preferences, our legacy code bases. Those are all the factors that matter infinitely more in the final choice of the language/platform/ideology/pattern/paradigm than the actual problem domain. We need to start accepting that and then accepting the criticism for the said platforms. [editline]23rd January 2016[/editline] If you've written C# for 5 years and dabbled in scheme for a semester in college you're not qualified to talk about the pros and cons of one over the other. If you've only ever written in dynamically typed languages you are NOT qualified to talk about static typing. If you've only ever written C, you are ABSOLUTELY POSITIVELY NOT QUALIFIED to talk about the downsides of OOP or Java or garbage collection etc. [editline]23rd January 2016[/editline] I know this all seems scattered or unrelated, but trust me. There's a strawman in my head and I'm beating the shit out of him.
[QUOTE=Darwin226;49589810]The problem is with defaults and the fact that you don't live on an island. If you're ever been to, well, pretty much any programming forum you can see people leave comments like "This is so stupid! You have to choose the right tool for the job!". And then we proceed to write 99% of code in an object-oriented style with the other 1% being bash scripts. That's NOT the best tool for the job [B]and people actually picking different tools for different projects are so absurdly rare they might as well not exist.[/B] Our preferences, our workplace's preferences, our legacy code bases. Those are all the factors that matter infinitely more in the final choice of the language/platform/ideology/pattern/paradigm than the actual problem domain. We need to start accepting that and then accepting the criticism for the said platforms. [editline]23rd January 2016[/editline] If you've written C# for 5 years and dabbled in scheme for a semester in college you're not qualified to talk about the pros and cons of one over the other. If you've only ever written in dynamically typed languages you are NOT qualified to talk about static typing. If you've only ever written C, you are ABSOLUTELY POSITIVELY NOT QUALIFIED to talk about the downsides of OOP or Java or garbage collection etc. [editline]23rd January 2016[/editline] I know this all seems scattered or unrelated, but trust me. There's a strawman in my head and I'm beating the shit out of him.[/QUOTE] Definitely have to agree with that, also I'm kind of curious so I'll leave this a question for everyone: What'd you learn first? Procedural programming or OOP, and how long did you do one before the other? Personally, I learned vb.net and Java in school before I learned C and C++. I did love the control I had in procedural programming, but I could never really shake the OOP side. I'm curious if learning one first makes the other more difficult to switch to.
[QUOTE=ZestyLemons;49589899]Definitely have to agree with that, also I'm kind of curious so I'll leave this a question for everyone: What'd you learn first? Procedural programming or OOP, and how long did you do one before the other? Personally, I learned vb.net and Java in school before I learned C and C++. I did love the control I had in procedural programming, but I could never really shake the OOP side. I'm curious if learning one first makes the other more difficult to switch to.[/QUOTE] I personally started with BASIC and Flash and then a bit of C. Only learned C# and OOP later and then did that for a few years. Now I pretty much write everything from personal projects to uni projects to work stuff in Haskell.
C++ was my first. Funnily enough it was the OOP aspect that actually got me really into it, those little examples like 'Dog' and 'Cat' inheriting from 'Animal'.
I wrote a simple cloth system for my engine and thought it'd be cool to have a vector field for testing forces on it. It turned out rather well so I'll be adding it to the main engine and use it for applying forces to cloth and particles. [vid]http://puu.sh/mGyAD.webm[/vid] Somehow it's very therapeutic to play around in, although my laptop isn't fastest when it comes to recording: [vid]http://puu.sh/mGzaW.webm[/vid] Also I got Spine integrated and there's a guy now (never mind the sluggish physics, Box2D synch issue): [vid]http://puu.sh/mGz3M.webm[/vid]
[QUOTE=ZestyLemons;49589899]Definitely have to agree with that, also I'm kind of curious so I'll leave this a question for everyone: What'd you learn first? Procedural programming or OOP, and how long did you do one before the other? Personally, I learned vb.net and Java in school before I learned C and C++. I did love the control I had in procedural programming, but I could never really shake the OOP side. I'm curious if learning one first makes the other more difficult to switch to.[/QUOTE] I didn't really start with either, but with both. Well I mean technically I started with autoexec.cfg for Half-life 2, but then I moved on to writing a mix of Batch, C#, and C++, learning all three as I went along, switching between then, until I eventually landed in C.
[QUOTE=Darwin226;49589810]The problem is with defaults and the fact that you don't live on an island. If you're ever been to, well, pretty much any programming forum you can see people leave comments like "This is so stupid! You have to choose the right tool for the job!". [B]And then we proceed to write 99% of code in an object-oriented style[/B] with the other 1% being bash scripts.[/QUOTE] What do you actually mean by 'OOP style'? It's probably related to the fact that I've read only code-bases for games and hobby projects, but I've hardly seen anyone actually use OOP properly, so I have some bias, yet most CPP code I've seen look more procedural than OOP due to all the object state reference daisy-chaining and crazy stuff people pull to make it work. If anything I'd call it procedural [I]but with a twist![/I]. [editline]23rd January 2016[/editline] I mean, if anything I could re-implement most of it by simply regex-ing things from obj.doStuff(...) to obj_doStuff(obj, ...) without losing any functionality.
[QUOTE=adnzzzzZ;49587576][video=youtube;QM1iUe6IofM]http://www.youtube.com/watch?v=QM1iUe6IofM[/video][/QUOTE] I deal with the OOP problems he listed on a daily basis, it drives me mad sometimes and there's nothing that i wish more than this practical "never use OOP again" alternative. Maybe he's "right", but i need way more info than that to ditch OOP. If there's any material that goes more in-depth on how to solve traditionally object oriented problems using other alternatives, i'd like to see that.
i tend to gravitate toward procedural programming. mostly because the people i listen to and have discussions with in the programming world are anti-oop (jonathan blow, casey muratori, a close friend who loves functional programming). the only other programmer i observed work/whatever was notch circa 2010, and despite the fact that he used java for all of his ludum dares and other stuff he didn't have any real opinions on oop, it was more "i know java so i will use java". all of that being said, i've made stuff in C#, object oriented c++, and procedural-C-with-a-few-C++-features-sprinkled-in and i tend to prefer the third. but take my opinion with a grain of salt (seriously) i'm just a person on the internet.
being anti oop when your language supports it is just making things harder on yourself. Artificial challenges on yourself do nothing but hinder progress imo.
[QUOTE=Map in a box;49592199]being anti oop when your language supports it is just making things harder on yourself. Artificial challenges on yourself do nothing but hinder progress imo.[/QUOTE] I'm not saying OOP is good or bad, but I don't understand that argument. Why would using a language feature just because it's there necessarily make things easier? All I get from your argument is "OOP is good, so if your language supports it you should use it", which is not really an argument.
If a language is designed for OOP it's probably a bad idea not to use that. Pick the language that's right for you.
Fucked up my class inheritance. OOPs [editline]23rd January 2016[/editline] [media]http://www.youtube.com/watch?v=XEaG1NEyK94[/media] [editline]23rd January 2016[/editline] Also I replaced explosions with something else. Feedback? [vid]http://zippy.gfycat.com/DearSlowBluebreastedkookaburra.webm[/vid]
[QUOTE=Darkwater124;49592718]If a language is designed for OOP it's probably a bad idea not to use that. Pick the language that's right for you.[/QUOTE] That's great advice for all the Smalltalk programmers in this thread. For everyone else it's a moot point.
why would you use Java, C++, C#, etc without actually using OOP? You're under utilizing what the language was designed for and it'll only hurt you in the long run.
[QUOTE=Darkwater124;49592718]If a language is designed for OOP it's probably a bad idea not to use that. Pick the language that's right for you.[/QUOTE] Yeah so I guess when do you pick a language that you actually want OOP in? I think it's interesting that even in game development, which is a place where you'd really expect object oriented to kickass based on that whole Dog derives from Animal whatever and it just makes sense right? But then in practice you look at Unity or Unreal and you're using component systems that give the illusion of being an object. [editline]23rd January 2016[/editline] [QUOTE=Map in a box;49593381]why would you use Java, C++, C#, etc without actually using OOP? You're under utilizing what the language was designed for and it'll only hurt you in the long run.[/QUOTE] I think the bigger take away is that these language shouldn't have been designed around OOP so much to begin with, and we see that now since the big thing now is for these languages to be able to support functional programming styles, and getting away from being so OOP. Java has lambdas, C# has em for a while, C++11 has them? etc
[QUOTE=Map in a box;49593381]why would you use Java, C++, C#, etc without actually using OOP? You're under utilizing what the language was designed for and it'll only hurt you in the long run.[/QUOTE] If OOP was enough those languages wouldn't keep evolving and adding features from other programming paradigms. Couldn't the exact argument be made for not using any single feature a language provides? I'm glad you mentioned C++ because that language departed from being OOP C a long time ago.
I keep managing to avoid having to use anything but C. Robotics? C. 3D printing? C/Arduino BS. Scientific computing?Matlab C, or just diff enough to be irritating. Instrument programming? Lol, C. I'm terrified of OOP tbh and hope someone doesn't suddenly drop it on me one day if I work in a lab this summer :v:
[QUOTE=paindoc;49593640] I'm terrified of OOP tbh and hope someone doesn't suddenly drop it on me one day if I work in a lab this summer :v:[/QUOTE] wtf is so scary about oop i dont get whyd you'd actively want to avoid learning it oop doesnt mean your code's gonna end up resembling Java EvilEdition or something i mean, unless you want it to
[QUOTE=paindoc;49593640]I keep managing to avoid having to use anything but C. Robotics? C. 3D printing? C/Arduino BS. Scientific computing?Matlab C, or just diff enough to be irritating. Instrument programming? Lol, C. I'm terrified of OOP tbh and hope someone doesn't suddenly drop it on me one day if I work in a lab this summer :v:[/QUOTE] you should probably bite the bullet and learn OOP like no matter what your opinion is on its merits/flaws it is pretty much impossible to gain meaningful employment without understand how to write OOP code, it's too common a practice in the industry to just skip over
[QUOTE=Darwin226;49593628]If OOP was enough those languages wouldn't keep evolving and adding features from other programming paradigms. Couldn't the exact argument be made for not using any single feature a language provides? I'm glad you mentioned C++ because that language departed from being OOP C a long time ago.[/QUOTE] Indeed. C++ has been much more focused on generic programming for a long time now, if you look at the standard library it's all heaps of templates and forms of static polymorphism. It was originally seen as primarily an object oriented/procedural language, but it's departed from that quite a bit now. [editline]24th January 2016[/editline] [QUOTE=Kybalt;49593484]Yeah so I guess when do you pick a language that you actually want OOP in? I think it's interesting that even in game development, which is a place where you'd really expect object oriented to kickass based on that whole Dog derives from Animal whatever and it just makes sense right? But then in practice you look at Unity or Unreal and you're using component systems that give the illusion of being an object.[/QUOTE] .. I hope that was not being serious, because those kinds of class hierarchies break down *so quickly* :v: I mean, a big reason games jumped onto the idea of entity component systems was partially to fix the problem with those kinds of insane inheritance hierarchies you inevitably end up with.
[vid]https://dl.dropboxusercontent.com/u/357850863/ShareX/2016/01/2016-01-23_20-07-37.mp4[/vid] unity physics is a fun I couldn't do the informative icon like I wanted to because it's literally like 100% transparency and it looks weird on a model. Also, does anyone know a good C# way to generate random numbers, I'm not familiar on the subject and Random.Range that the unity team provides is not very good.
[QUOTE=killerteacup;49593866]you should probably bite the bullet and learn OOP like no matter what your opinion is on its merits/flaws it is pretty much impossible to gain meaningful employment without understand how to write OOP code, it's too common a practice in the industry to just skip over[/QUOTE] Oh no, it's absolutely part of the plan. I'm trying to learn Python as my big new language now since it's quite common in astronomy and for data processing. [URL="https://plyades.readthedocs.org/en/latest/"]This[/URL] plus the coursera audio processing course are my main python interests atm. Lots of data and science programming in general tbh, since so much of the industry I want to get into is 90% simulation since the costs of space and/or fusion reactor hardware are not cheap. Did you know the current idea is to coat the plasma facing wall in lithium, to breed the tritium needed for the reaction? Oh, and lots of beryllium. So, $$$ It's not huge though, cus at my core I'm still a big dumb engineer working in hardware. Also, NASA spacecraft are programmed in C and a bit of C#, and C# is the one OOP I have some experience with. There's a job fair next week for "diversity" (I don't feel I belong, lol) so I'll be going and talking to a bunch of space companies then and seeing what they recommend for further learning
[QUOTE=awcmon;49593753]wtf is so scary about oop i dont get whyd you'd actively want to avoid learning it oop doesnt mean your code's gonna end up resembling Java EvilEdition or something i mean, unless you want it to[/QUOTE] [img]https://puu.sh/mHg0p/6264bca348.jpg[/img]
[QUOTE=thatbooisaspy;49593971][vid]https://dl.dropboxusercontent.com/u/357850863/ShareX/2016/01/2016-01-23_20-07-37.mp4[/vid] unity physics is a fun I couldn't do the informative icon like I wanted to because it's literally like 100% transparency and it looks weird on a model. Also, does anyone know a good C# way to generate random numbers, I'm not familiar on the subject and Random.Range that the unity team provides is not very good.[/QUOTE] You can use System.Random. Otherwise, if that's not flexible enough, [URL="https://gist.github.com/TheBerkin/1fe4d651e9b2aabb1046"]feel free to use my own[/URL], which is non-linear and has more features, e.g. branching and the ability to generate ranged floating-point numbers and 64-bit integers. [editline]24th January 2016[/editline] Oh, page king? Here, have a toilet. [IMG]http://i.imgur.com/i1XT2Pa.png[/IMG]
just some hw in c [t]http://i.imgur.com/mcUQfEY.png[/t]
[QUOTE=cody8295;49594343]just some hw in c [t]http://i.imgur.com/mcUQfEY.png[/t][/QUOTE] If you're looking for code criticism/review, it's easier for everyone if you post it in [code] tags rather than as an image. For school assignments in particular, it's helpful to know what constraints your teacher/professor has set.
[QUOTE=Berkin;49594286] Oh, page king? Here, have a toilet. [IMG]http://i.imgur.com/i1XT2Pa.png[/IMG][/QUOTE] [B]Shit-Ring Technology™[/B]
Sorry, you need to Log In to post a reply to this thread.