• What are you working on?
    5,004 replies, posted
[QUOTE=Darwin226;49582909]The performance note is valid but I don't get what you mean by less safe. I'm assuming the WithGroupBox wraps the lambda into a try/catch so it can process failure properly. The way I see it, it's safer because it gives you get object on which you invoke the methods instead of just denoting the start and the finish and hoping that you do the correct things in between, mutating some implicit state machine.[/QUOTE] I hadn't thought about that, definitely my mistake. I don't think there's a difference in safety then though, since the program still wouldn't statically stop you from acting on the wrong control (assuming the same underlying system). Assuming C#, it would be nicest to be able to just [I]Add(...)[/I] content via a collection initialiser, but that would require some fundamental changes in the library (flagging the layout as dirty, which should be very cheap with proper implementation) or a complex wrapper that does this. [editline]24th January 2016[/editline] [QUOTE=Cold;49586064]How do people browse the shadertoy website, it ranges from 20+ second freezes to display driver crashes when you press the browse button in all major browsers.[/QUOTE] It used to be really bad on Firefox, but now it's completely fine in that regard. [editline]24th January 2016[/editline] [QUOTE=Fourier;49586562]You can do octree stuff do speed up greatly fluid simulations.[/QUOTE] If I'm not mistaken the search keyword for that in this context is "variable resolution" or similar. I read it speeds up the processing to a multiple.
[QUOTE=Shotgunz;49591502]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.[/QUOTE] Honestly I feel like the anti-OOP argument is a little over my head. I'm not really embarrassed to admit that even after watching the whole video adnz posted, I didn't [I]really[/I] understand the point. Maybe I'm just too much of an amateur to understand the philosophy behind all of it, but to me I just work however feels the most natural. When I'm working on a game in Unreal, the OOP model makes a lot of sense and I find it very convenient to use. In contrast, when working on the backend for my business application, it feels more natural to just work procedurally and process data as it comes. I never really sat down and had a big debate about whether or not I need to implement classes to abstract my model of the data, or represent clients as objects rather than just a collection of variables being accessed at a certain point in time, I just identified my problem and got to work on what seemed to be the most obvious and natural solution at the time. [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 don't know, I feel like this is kinda like saying "well C++ supports pointers, so why aren't you using pointers in your basic calculator program?". I understand there's a pretty significant difference between a feature like pointers and an entire paradigm like OOP, I'm just saying I don't think it should really matter for you to do things in a way that seems natural and efficient even if it contradicts the way your tools were "meant" to be used. JavaScript wasn't intended to be used for complex serverside back-end work, but if people can adapt it to fit that model appropriately, I don't see why it matters what the original purpose of the language was.
i have decided [video=youtube;WXypXOFJYSY]https://www.youtube.com/watch?v=WXypXOFJYSY[/video] the shitty mspaint game will be about an internet forum. you take control of a newly registered user and may go on quests to stop flame wars, help mods ban unruly users, join threads to rate posts, collect new avatars for your account and investigate the sudden swarm of 12 year olds joining the forums. why are they here? who sent them? is postal going to be in the game???? who knows! [B]EDIT:[/B]​ oh my god postal is watching me
When big languages like the one listed have their major feature be OOP, you're hurting yourself by not taking advantage of it. More than likely you'll end up using OOP in your program due to standard libraries anyway, so what defines not using OOP?
[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.[/quote] I'll try to put this nicely: This video is basically FemFreq for programming and I wouldn't have expected you of all people to fall for this empty garbage. (I watched it all.) Apart from some blatantly dishonest rhetoric (e.g. preemptively dismissing criticism), what Will is presenting here is a [I]superficially[/I] appealing and [I]internally[/I] consistent idea that has barely any grounding due to the sheer number of assumptions he makes. To me it seems he started with his conclusion and then built arguments to support it, which [I]sometimes[/I] is fine (e.g. in lawyering and certain political systems) but in science, economy and general advisory is fundamentally dishonest. He even redefines OOP and misrepresents the status quo to make it look worse than it really is. There are [I]many[/I] instances where he bases assertions about a general case on observation of a special one. In the end, what Will presents is a perhaps interesting [I]philosophy[/I] based on his opinion, but due to the video's fallacious nature it's just another fashionable guideline exactly like the ones he spends most of the video complaining about. All that said, I didn't rate your post dumb because I disagree with you or purely because the video is so bad, but because you're reposting an opinion presented as fact without adding any qualifiers. It's a completely useless argument and I'm glad to see most people here aren't falling for it (if maybe sometimes for the wrong reasons). (If this looks harsh it's because I'm passionate about intellectual honesty. Bad or misleading advice is something that needs to be stopped in its tracks as quickly as possible, as far as that's even possible at all.) [quote]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] This, on the other hand, is sensible. For me personally it's definitely not a system I'd do well with at all, since I'm much faster at writing encapsulated code with a good interface than non-OOP procedural stuff even during the first sketch, but I can see why what you do may be advantageous to you with the (dynamically typed and functionality focused) approach you use. I normally go with modular and data-focused code that's heavily shared between my projects, which means the ability to import libraries and string them together in half a minute is more important to me than to quickly heavily modify what it does. (Refactoring works still fine and the code structure is easy to follow anyway, unless I'm writing some really arcane low-level system that needs to handle or deny a ton of edge cases. It's all a matter of choosing sensible names for things you use internally.) I use a much more general version of OOP though rather than the terrible Business-Java-like approach the creator of that video tries to use as a base for his "criticism". [editline]24th January 2016[/editline] [QUOTE=roastchicken;49589004][pure speculation][/QUOTE] The same applies here, just that it's not even an argument related to what your post is in response to. If someone argues only about their own situation, you can't debunk that by changing the initial problem.
[QUOTE=Berkin;49594286]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][/QUOTE] Oh nice, thanks (for the random thing, not the toliet). I just needed something that handled floats better and forgot about System.Random. Also it took me a while to recongize you because I identify people by avatars :v: also god damn that c# is so sexy it makes mine look like trash
I've been reading a lot of code that uses C++'s auto keyword. If I understand it right, it's a very lazy way to not have to write out a variable or functions type. So it should try to guess the typedef, right? Like from previous definitions? Or something.
[QUOTE=false prophet;49595471]I've been reading a lot of code that uses C++'s auto keyword. If I understand it right, it's a very lazy way to not have to write out a variable or functions type. So it should try to guess the typedef, right? Like from previous definitions? Or something.[/QUOTE] auto for me just makes me program faster without having to remember the exact type required while coding. I consider it an aid to intellisense like things.
I'm making a mod for Half-Life where you can make camera maps from in game rather than mucking around in Hammer. It also has an external editing program where you will fine tune camera values. At the moment you cannot select cameras and modify them but yeah, it will be a two way connection with events. [vid]https://my.mixtape.moe/nztght.mp4[/vid] A camera map would be like this, except created much faster and have more features (eventually): [video=youtube;uUaTwKevfG8]https://www.youtube.com/watch?v=uUaTwKevfG8[/video] At the moment a camera can only be linked to a single trigger, but a camera should be able to be triggered either from an entity with the same name, or from different triggers. Both the game and the application communicating through IPC adds an interesting level to the development.
I'm not arguing against it. I've been using it a lot lately because I don't really want to try to remember types for weird things, such as random experiments.
[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 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] I mostly agree with you, but I don't think it's fair to categorically discount something or someone because they're "rare". What exactly the best method is also depends (quite possibly a lot) on the person in question, so many people actually [I]are[/I] using the right tool for the job when they're tweaking their default just a little. For example, if I want to make a web page from scratch and just need half an hour to bootstrap a concise C# DSL for emitting HTML I'd rather do that and fill in the rest as I need it by "templating" MDN into classes, than learning to use both HTML (which is a kind of language I'm not as efficient with) and some third-party templating system to concisely paste text files into each other. Either way the result is a static page, but I'll likely be done earlier the former way unless it's extremely simple and will keep that speed benefit for future projects. (I actually did this. The C# code is normally shorter than if I'd written it in HTML and CSS (for a reasonable templating system). Parsing Markdown would still have been shorter though in case I'd wanted to blog, and I admit I haven't looked terribly thoroughly into HTML replacements because doing so would have taken longer than the bootstrapping.)
[QUOTE=Tamschi;49595568]I mostly agree with you, but I don't think it's fair to categorically discount something or someone because they're "rare". What exactly the best method is also depends (quite possibly a lot) on the person in question, so many people actually [I]are[/I] using the right tool for the job when they're tweaking their default just a little. For example, if I want to make a web page from scratch and just need half an hour to bootstrap a concise C# DSL for emitting HTML I'd rather do that and fill in the rest as I need it by "templating" MDN into classes, than learning to use both HTML (which is a kind of language I'm not as efficient with) and some third-party templating system to concisely paste text files into each other. Either way the result is a static page, but I'll likely be done earlier the former way unless it's extremely simple and will keep that speed benefit for future projects. (I actually did this. The C# code is normally shorter than if I'd written it in HTML and CSS (for a reasonable templating system). Parsing Markdown would still have been shorter though in case I'd wanted to blog, and I admit I haven't looked terribly thoroughly into HTML replacements because doing so would have taken longer than the bootstrapping.)[/QUOTE] Don't get me wrong. I use Haskell for writing presentations. I'm only saying that "use the best tool for the job" is a bad rethoric when used to dismiss criticism for the platform you use. It implies the argument is pointless because you wouldn't use the said platform for things that have a better fit. But that's not true, is it? You write C# for static HTML, I write Haskell instead of LaTeX/PowerPoint.
Because filling a level with a huge amount of sample points that you don't even see would be a pretty bad idea and fixing the field to the camera would result in incorrect velocity reads as it moves I added a little pan system to my vector field. All it does is shift the vectors over to the other side (blessed be std::rotate) and reset their velocities as they go out of bounds. With this I'll have good performance (screenspace woop) but still get pretty good results as it's easy to extend the bounds outside the camera view a bit to get affectors from outside the screen to influence the field. [vid]http://puu.sh/mHL2D.webm[/vid]
I've been testing godot, and I'm in love with the animation system, it also tries to do a lot of other things differently. [video=youtube;Tsy_QIyKLbQ]https://www.youtube.com/watch?v=Tsy_QIyKLbQ[/video] I ported my character from animate, rigging was confusing at first, but it works really well. [T]http://i.imgur.com/qXzJmz0.png[/T]
The loading times are just horrible though.
^ Dragon programming example If you were just going to use a struct for it then why would you create a class hierarchy for it in Java? Seems biased.
I'm gonna fail my courses :v: Can't buy books. Hopefully my instructors will be okay with my using eBooks for a couple months or so. [oops] wrong thread :(
I haven't posted what I'm actually working on in a while. For a class project we were assigned to write a solution to the art gallery problem. You are given a polygon that represents a layout of the art gallery. The task is to place a minimal number of cameras so that every point in the polygon is visible from at least one of the cameras. The problem is NP-hard so the solution can't be exact. I'm using a genetic algorithm to minimize the number of cameras. Here's an example with a smallish polygon of a hundred vertices. [img]http://i.imgur.com/BZBGfF8.png[/img] [img]http://i.imgur.com/cMwxFKk.png[/img] [img]http://i.imgur.com/OWmtSrH.png[/img] [img]http://i.imgur.com/tnwsiuk.png[/img] [img]http://i.imgur.com/3oKAJOs.png[/img] [img]http://i.imgur.com/C3ITl7B.png[/img] [img]http://i.imgur.com/kYSIjYI.png[/img] [img]http://i.imgur.com/japxyDL.png[/img] I think there was a solution with 1 or 2 less cameras found but it was setup to render only when cam % 10 == 0 for debugging.
i replaced my cube scattering explosions with nothing because my performance is starting to suffer :|
[QUOTE=Nigey Nige;49597707]i replaced my cube scattering explosions with nothing because my performance is starting to suffer :|[/QUOTE] Use the [url=http://docs.unity3d.com/Manual/Profiler.html]Profiler[/url]
Fuck, I was just about to restart my OOP programming language, and now there's this whole debate in this thread about OOP vs procedural(?) wtf should I doooo
Restart your OOP language if it's a fun thing to do.
auto is one of the best things to happen to C++ and if you don't like it you can tell that to my boost::bimap<int, std::string>::const_iterator.
Speaking of OOP, here's the biggest argument in favor of it [url]https://github.com/EnterpriseQualityCoding/FizzBuzzEnterpriseEdition[/url]
[QUOTE=WTF Nuke;49598122]auto is one of the best things to happen to C++ and if you don't like it you can tell that to my boost::bimap<int, std::string>::const_iterator.[/QUOTE] I guess you're actually right. I always thought auto was fucking retarded. But given that templates are a thing in C++ and how utterly insanely complex they can be, it makes sense for auto to also be a thing, to bring balance to the force, and peace to the galaxy.
I use var all the time in C#.
[QUOTE=WTF Nuke;49598122]auto is one of the best things to happen to C++ and if you don't like it you can tell that to my boost::bimap<int, std::string>::const_iterator.[/QUOTE] Not to mention it gives you the ability to more easily change the types of functions and stuff later, like floats to doubles in your math library.
[QUOTE=WTF Nuke;49598122]auto is one of the best things to happen to C++ and if you don't like it you can tell that to my boost::bimap<int, std::string>::const_iterator.[/QUOTE] It would literally be impossible to implement the newest iteration of my Pattern library without it. I'm using it to (among other things) parse Crusader Kings 2 files, and this is one of the resulting types: [cpp]transform<sequence<between<0,-1,Expr>,ckstr::flags,between<0,-1,Expr>,exact<61>,between<0,-1,Expr>,sequence<between<0,-1,Expr>,exact<123>,sequence<sequence<between<0,-1,Expr>,ckstr::game_start_charlemagne,between<0,-1,Expr>,exact<61>,between<0,-1,Expr>,calendardate>,sequence<between<0,-1,Expr>,ckstr::charlemagne_spain_intervention,between<0,-1,Expr>,exact<61>,between<0,-1,Expr>,calendardate>,sequence<between<0,-1,Expr>,ckstr::saxon_wars,between<0,-1,Expr>,exact<61>,between<0,-1,Expr>,calendardate>,sequence<between<0,-1,Expr>,ckstr::blood_court_of_verden,between<0,-1,Expr>,exact<61>,between<0,-1,Expr>,calendardate>,sequence<between<0,-1,Expr>,ckstr::widukind_spawned,between<0,-1,Expr>,exact<61>,between<0,-1,Expr>,calendardate>,sequence<between<0,-1,Expr>,ckstr::viking_age_started,between<0,-1,Expr>,exact<61>,between<0,-1,Expr>,calendardate>,sequence<between<0,-1,Expr>,ckstr::varangian_guard_founded,between<0,-1,Expr>,exact<61>,between<0,-1,Expr>,calendardate>,sequence<between<0,-1,Expr>,ckstr::ogier_spawned,between<0,-1,Expr>,exact<61>,between<0,-1,Expr>,calendardate>,sequence<between<0,-1,Expr>,ckstr::norse_reformation,between<0,-1,Expr>,exact<61>,between<0,-1,Expr>,calendardate>,sequence<between<0,-1,Expr>,ckstr::christian_crusades_unlocked,between<0,-1,Expr>,exact<61>,between<0,-1,Expr>,calendardate>,sequence<between<0,-1,Expr>,ckstr::muslim_jihads_unlocked,between<0,-1,Expr>,exact<61>,between<0,-1,Expr>,calendardate>,sequence<between<0,-1,Expr>,ckstr::zoroastrian_priesthood_founded,between<0,-1,Expr>,exact<61>,between<0,-1,Expr>,calendardate>,sequence<between<0,-1,Expr>,ckstr::pagan_ghws_unlocked,between<0,-1,Expr>,exact<61>,between<0,-1,Expr>,calendardate>,sequence<between<0,-1,Expr>,ckstr::irminsul,between<0,-1,Expr>,exact<61>,between<0,-1,Expr>,calendardate>,sequence<between<0,-1,Expr>,ckstr::saoshyant_appears,between<0,-1,Expr>,exact<61>,between<0,-1,Expr>,calendardate>>,between<0,-1,Expr>,exact<125>>>,flags>[/cpp] Without auto I'd have to spell that whole thing out every time I used it :v:
[QUOTE=Dr Magnusson;49599245]It would literally be impossible to implement the newest iteration of my Pattern library without it. I'm using it to (among other things) parse Crusader Kings 2 files, and this is one of the resulting types: [cpp]transform<sequence<between<0,-1,Expr>,ckstr::flags,between<0,-1,Expr>,exact<61>,between<0,-1,Expr>,sequence<between<0,-1,Expr>,exact<123>,sequence<sequence<between<0,-1,Expr>,ckstr::game_start_charlemagne,between<0,-1,Expr>,exact<61>,between<0,-1,Expr>,calendardate>,sequence<between<0,-1,Expr>,ckstr::charlemagne_spain_intervention,between<0,-1,Expr>,exact<61>,between<0,-1,Expr>,calendardate>,sequence<between<0,-1,Expr>,ckstr::saxon_wars,between<0,-1,Expr>,exact<61>,between<0,-1,Expr>,calendardate>,sequence<between<0,-1,Expr>,ckstr::blood_court_of_verden,between<0,-1,Expr>,exact<61>,between<0,-1,Expr>,calendardate>,sequence<between<0,-1,Expr>,ckstr::widukind_spawned,between<0,-1,Expr>,exact<61>,between<0,-1,Expr>,calendardate>,sequence<between<0,-1,Expr>,ckstr::viking_age_started,between<0,-1,Expr>,exact<61>,between<0,-1,Expr>,calendardate>,sequence<between<0,-1,Expr>,ckstr::varangian_guard_founded,between<0,-1,Expr>,exact<61>,between<0,-1,Expr>,calendardate>,sequence<between<0,-1,Expr>,ckstr::ogier_spawned,between<0,-1,Expr>,exact<61>,between<0,-1,Expr>,calendardate>,sequence<between<0,-1,Expr>,ckstr::norse_reformation,between<0,-1,Expr>,exact<61>,between<0,-1,Expr>,calendardate>,sequence<between<0,-1,Expr>,ckstr::christian_crusades_unlocked,between<0,-1,Expr>,exact<61>,between<0,-1,Expr>,calendardate>,sequence<between<0,-1,Expr>,ckstr::muslim_jihads_unlocked,between<0,-1,Expr>,exact<61>,between<0,-1,Expr>,calendardate>,sequence<between<0,-1,Expr>,ckstr::zoroastrian_priesthood_founded,between<0,-1,Expr>,exact<61>,between<0,-1,Expr>,calendardate>,sequence<between<0,-1,Expr>,ckstr::pagan_ghws_unlocked,between<0,-1,Expr>,exact<61>,between<0,-1,Expr>,calendardate>,sequence<between<0,-1,Expr>,ckstr::irminsul,between<0,-1,Expr>,exact<61>,between<0,-1,Expr>,calendardate>,sequence<between<0,-1,Expr>,ckstr::saoshyant_appears,between<0,-1,Expr>,exact<61>,between<0,-1,Expr>,calendardate>>,between<0,-1,Expr>,exact<125>>>,flags>[/cpp] Without auto I'd have to spell that whole thing out every time I used it :v:[/QUOTE] the inclusion of random historical words in that mess makes it so much funnier
[QUOTE=Darwin226;49596139]Don't get me wrong. I use Haskell for writing presentations. I'm only saying that "use the best tool for the job" is a bad rethoric when used to dismiss criticism for the platform you use. It implies the argument is pointless because you wouldn't use the said platform for things that have a better fit. But that's not true, is it? You write C# for static HTML, I write Haskell instead of LaTeX/PowerPoint.[/QUOTE] I misinterpreted your previous post a little, in that case. You're right for the most part, though the only reason I use C# in particular is because I can enter the tags very concisely and with instant validation that way, and also get templating implicitly: [code]var wr = new AddableTextWriter(Console.Out) { Newline = "\n" }; wr += "<!DOCTYPE html>"; // The nested initializers break the autoformatter, so I thought I might as well use a compact bracket style. wr += new Html { {"lang", "en"}, new Head { new Meta("charset", "utf-8"), new Meta { {"http-equiv", "X-UA-Compatible"}, {"content", "IE=edge"}}, new Meta("viewport", "width=device-width, initial-scale=1"), new ShortComment("The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags."), new Comment { "etc."}}, new Body { {"role", "document"}, content}};[/code] If I knew how to (quickly) make a VS language extension (and had all the tags and most attributes here implemented to be verifiable), I'd instead go with code like [code]%%Content Html @lang en Head Meta charset utf-8 Meta @http-equiv X-UA-Compatible @content IE=edge Meta viewport "width=device-width, initial-scale=1 ShortComment "The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags. Comment "etc. Body @role document %Content[/code] since that's much shorter while still having a structure that works well with static validation and strong type safety.
Sorry, you need to Log In to post a reply to this thread.