|
HoboMan posted:ok so linq is still jank magic as far as i'm concerned so tell me if i'm wrong but it think the first select here is unnecessary don't think that first Select is even LINQ, think that's some data table thing https://msdn.microsoft.com/en-us/library/system.data.datatable.select(v=vs.110).aspx that appears to be sorting
|
# ? Apr 7, 2016 22:02 |
|
|
# ? May 25, 2024 14:34 |
|
anyway yeah you could get rid of the first select but you'd have to replace it with a LINQ sort after the LINQ select
|
# ? Apr 7, 2016 22:03 |
|
if you're dealing with yuuuge DataTable poo poo, in my experience you should try to use their native methods as much as possible. feeding them to a LINQ expression requires casting which is shockingly slow. i once found myself eating a ~6 seconds lag on a table of a few thousand entries just because i had a type annotation in a foreach loop. if the table is small though then gently caress it, LINQ all the way and forget their ugly-rear end mutation-happy API even exists. i even wrote myself extension methods for datatable/view/gridview just to avoid typing .Table.Rows.Cast<DataRow> every time
|
# ? Apr 7, 2016 22:30 |
|
Illusive gently caress Man posted:i still get my own stuff done, but it's def a time waster. lol if you don't waste as much time as you possibly can
|
# ? Apr 7, 2016 22:32 |
|
compuserved posted:lol if you don't waste as much time as you possibly can why do you think i even post in this thread?
|
# ? Apr 8, 2016 01:27 |
|
HoboMan posted:why do you think i even post
|
# ? Apr 8, 2016 01:32 |
|
hosed up part is that i do it around the clock tho
|
# ? Apr 8, 2016 01:32 |
|
aren't SQL statement mappers hot poo poo these days?
|
# ? Apr 8, 2016 02:22 |
|
fleshweasel posted:aren't SQL statement mappers hot poo poo these days? yep. and so is mongo.
|
# ? Apr 8, 2016 02:36 |
|
Dylan16807 posted:oh I know how the dumb feature works, but you can do very similar things in lots of statically-typed languages without taking advantage of implementation details and possibly your operating system, unless they've added Smalltalk/ObjC/Java-style reflection to C++11/14/17 without me knowing about it, you won't be able to implement something like this in a generic way because it requires looking up a variable given a string at runtime Stroustrup claimed last decade they wouldn't add that kind of reflection because it bloats binary sizes by 50% for .NET, I had to point out the same kind of stuff for ObjC only adds about 10% and for the level of power it gives the framework designer, that cost is very well worth paying for of course at that same meeting he said dynamic linking and stable ABIs were something best left to the market, so… eschaton fucked around with this message at 02:40 on Apr 8, 2016 |
# ? Apr 8, 2016 02:38 |
|
fleshweasel posted:aren't SQL statement mappers hot poo poo these days? Quite literally, in that they're rather popular and also giant turds.
|
# ? Apr 8, 2016 02:40 |
|
statement mappers are good. orms are bad.
|
# ? Apr 8, 2016 02:41 |
|
gonadic io posted:As much as I don't like programming in it that much, if you're making something that you plan to sell and have a free choice of language and infrastructure then C# is probably the best choice for stuff that isn't a website or a mobile app. if you're building an application for professionals to use to get work done you'll use Objective-C or Swift because that's what you use to program the only computers worth using
|
# ? Apr 8, 2016 02:43 |
|
Bloody posted:now if your using ammonia that's a whole nother ball of safety wax best treated with chlorine bleach
|
# ? Apr 8, 2016 02:44 |
|
everyone knows SQL, so lets throw all that away and learn this funky new orm api that has half the power, half the expressiveness and increases a huge amount of complexity. oh and none of the devs know how to really use it so we're back to doing thousands of single-row loads instead of anything vaguely intelligent
|
# ? Apr 8, 2016 02:48 |
|
homercles posted:everyone knows SQL, so lets throw all that away and learn this funky new orm api that has half the power, half the expressiveness and increases a huge amount of complexity. oh and none of the devs know how to really use it so we're back to doing thousands of single-row loads instead of anything vaguely intelligent this too has been my experience with orms
|
# ? Apr 8, 2016 02:49 |
|
and lets do all this in a plang language that has no code completion so devs wont even bother experimentally trying to code complete to see what functions they might be missing out on
|
# ? Apr 8, 2016 02:49 |
|
homercles posted:and lets do all this in a plang language that has no code completion so devs wont even bother experimentally trying to code complete to see what functions they might be missing out on i miss c# code complete
|
# ? Apr 8, 2016 02:50 |
|
js devs don't like to document poo poo, so i'm always trudging through source code to figure out what api's are available
|
# ? Apr 8, 2016 02:50 |
|
eschaton posted:if you're building an application for professionals to use to get work done you'll use Objective-C or Swift because that's what you use to program the only computers worth using im a mac user and i just have to lol at this
|
# ? Apr 8, 2016 03:04 |
|
integer division should have a separate operator imo, call it "div" or something, just not "/". if x = 1 and y = 2 then i want x / y = 0.5, i don't care if x and y are both ints. in fact i cannot think of a single instance in my programming career where i wanted the integer division behavior
|
# ? Apr 8, 2016 04:00 |
|
personally, I can't think of a single instance where I wanted dividing two integers to suddenly drop a dozen bits of precision because they're now floats. to each their own I guess.
|
# ? Apr 8, 2016 04:03 |
|
floating point is not the only possible representation of decimal numbers
|
# ? Apr 8, 2016 04:18 |
|
there is a part in a knuth book that talks about computing with rational numbers but i'm too fuckin stupid to understand it. something about chinese remainder theorems?
|
# ? Apr 8, 2016 04:32 |
|
chances are if you're integer dividing you're going on to use it as an index in an array or some poo poo
|
# ? Apr 8, 2016 05:06 |
|
eschaton posted:without taking advantage of implementation details and possibly your operating system, unless they've added Smalltalk/ObjC/Java-style reflection to C++11/14/17 without me knowing about it, you won't be able to implement something like this in a generic way because it requires looking up a variable given a string at runtime they're all accessed through the $, so you don't actually have to make them local variables. but if you really want an abomination it wouldn't be all that hard. make a declaration macro that creates the variable and then inserts the name and a pointer into the data structure. you don't need runtime reflection. it might not look exactly the same as php, but you can get pretty close. for extra fun replace $ with *, everyone loves overloaded dereferencing
|
# ? Apr 8, 2016 05:08 |
|
fleshweasel posted:im a mac user and i just have to lol at this the various mail apps for ios are probably all mostly written in obj-c or swift and are used a lot by professions for getting work done. and xcode, but counting that is kinda circlejerky and then, uh... keynote? i've never seen any evidence that anyone uses any of the other iwork programs, but i guess there must be at least a few users
|
# ? Apr 8, 2016 05:32 |
|
akadajet posted:js devs don't like to document poo poo, so i'm always trudging through source code to figure out what api's are available or they document poo poo only superficially, so it looks like good documentation at first
|
# ? Apr 8, 2016 05:52 |
|
hey speaking of Car extends Vehicle, i remember people talking about nethack's creature types and how one creature can polymorph into another type with different weaknesses and strenghts and such, and because of that, CaveTroll extends Troll extends Creature doesn't really work. so how would you check for a monster's weakness for petrification when the player hits it with a cockatrice corpse without going all code:
|
# ? Apr 8, 2016 06:00 |
|
I like the android javadoc search feature in the top-right for http://developer.android.com/reference/packages.html where you type in a package name substring and it highlights matches. Is there a nice way to take Java8 source code and source code for whatever libraries I'm using, and build a combined nicely styled javadoc with the package substring search to store locally?
|
# ? Apr 8, 2016 06:04 |
|
Wheany posted:hey speaking of Car extends Vehicle, i remember people talking about nethack's creature types and how one creature can polymorph into another type with different weaknesses and strenghts and such, and because of that, CaveTroll extends Troll extends Creature doesn't really work. you have weakness and type be components all things code:
|
# ? Apr 8, 2016 06:25 |
|
Wheany posted:hey speaking of Car extends Vehicle, i remember people talking about nethack's creature types and how one creature can polymorph into another type with different weaknesses and strenghts and such, and because of that, CaveTroll extends Troll extends Creature doesn't really work. multiple inheritance and multimethod dispatch in CLOS, so all that is done for you by the language Lisp code:
(I'm using the Dylan convention of putting angle brackets around class names above) multiple inheritance lets you create a cockatrice corpse attack by combining the classes, and multimethod dispatch lets you specialize the attack method on both parameters, so you only need to implement the meaningful combinations; the standard method combination system will take care of the rest you would probably really make <cockatrice-corpse-attack> not descend from <creature>, and instead take the instrument of an attack as a parameter when creating it. then you could specialize make-instance so that when it's asked for an attack using a cockatrice corpse, it returns an instance of the right <attack> subclass listening to the Software Engineering Daily interview with the Dwarf Fortress dude, I seriously thought he'd be better off with a system like CLOS than either single or multiple inheritance in C++
|
# ? Apr 8, 2016 06:33 |
|
Wheany posted:hey speaking of Car extends Vehicle, i remember people talking about nethack's creature types and how one creature can polymorph into another type with different weaknesses and strenghts and such, and because of that, CaveTroll extends Troll extends Creature doesn't really work. if you've got n attacks and m attackables you need to encode n*m cases, there's no way around it. the basic decision is whether you model the logic as a two-level tree, like your example (and if so, which order the levels are in) or a big matrix. the tree isn't a fundamentally bad way to do it, as long as you're not doing a big nested switch. e.g. you could create IAttackable, which could either simply declare a single Attack(AttackInfo) or a method for each type of attack (SwingCockatriceAt, WriteMeanTweetAbout, etc). then each monster would implement IAttackable and define how it's affected by each attack type. for the big matrix approach your language will need something more powerful than a basic c-style switch, like real pattern matching or multimethods.
|
# ? Apr 8, 2016 06:36 |
|
oh, and i meant to say that you are allowed to use any language you want. the discussion back in prehistoric days was about reimplenemting it in c++ using oop because that was a relatively new and hot thing.
|
# ? Apr 8, 2016 06:36 |
|
whoops, too slow
|
# ? Apr 8, 2016 06:37 |
|
"how do i do multiple dispatch in <language without multiple dispatch>" is one of the best ways to get a plethora of confidently wrong answers on stackoverflow, as dozens of people fresh out of undergrad will fall all over themselves to explain the visitor pattern to you
|
# ? Apr 8, 2016 06:42 |
|
JewKiller 3000 posted:integer division should have a separate operator imo, call it "div" or something, just not "/". if x = 1 and y = 2 then i want x / y = 0.5, i don't care if x and y are both ints. in fact i cannot think of a single instance in my programming career where i wanted the integer division behavior Visual Basic had \ for integer division Wheany posted:hey speaking of Car extends Vehicle, i remember people talking about nethack's creature types and how one creature can polymorph into another type with different weaknesses and strenghts and such, and because of that, CaveTroll extends Troll extends Creature doesn't really work. in the year 2016 you program games with the entity-component-system model, and create game objects by aggregating components. I find entity-component-system hard to wrap my mind around, it's radically different from model-view-controller. like, in ecs you're hardly expected to write any code, and when you do it's to create new components, but you totally can make a game out of pre-made components and only a very thin layer of glue. like you could make a billiards game that's 99% assets and other metadata for the physics and rendering engines and only the smallest amount of code to keep score, handle input, etc. in fact the Unity engine/development environment calls your code "scripts" like it was unimportant (and it is, the engine does the heavy lifting) I'm probably not explaining myself very well, but it's such a different kind of programming from what I/we usually do. there is no single place you can look at and say "there's the game logic", because the logic is spread among several components × objects. it's also a kind of programming where artists are absolutely vital, to the point that an artist can singlehandedly make a successful game with the vaguest and shittiest programming skills, and programmers who get into game development tend naturally to write engines instead of games hackbunny fucked around with this message at 09:42 on Apr 8, 2016 |
# ? Apr 8, 2016 09:37 |
|
JewKiller 3000 posted:integer division should have a separate operator imo, call it "div" or something, just not "/". if x = 1 and y = 2 then i want x / y = 0.5, i don't care if x and y are both ints. in fact i cannot think of a single instance in my programming career where i wanted the integer division behavior really? i rely on integer division a lot and can't think of any occasions where it's annoyed me that i had to use a non-integer type to get non-integer behavior. if anything, the thing that annoys me about dividing integers is that you have to do div and mod separately in most languages. i want to do like "n, r = x /% y" and get both at once.
|
# ? Apr 8, 2016 09:52 |
|
GrumpyDoctor posted:if you've got n attacks and m attackables you need to encode n*m cases, there's no way around it. the basic decision is whether you model the logic as a two-level tree, like your example (and if so, which order the levels are in) or a big matrix. the tree isn't a fundamentally bad way to do it, as long as you're not doing a big nested switch. e.g. you could create IAttackable, which could either simply declare a single Attack(AttackInfo) or a method for each type of attack (SwingCockatriceAt, WriteMeanTweetAbout, etc). then each monster would implement IAttackable and define how it's affected by each attack type. for the big matrix approach your language will need something more powerful than a basic c-style switch, like real pattern matching or multimethods. or a lookup table and int enums!
|
# ? Apr 8, 2016 13:12 |
|
|
# ? May 25, 2024 14:34 |
|
JewKiller 3000 posted:integer division should have a separate operator imo, call it "div" or something, just not "/". if x = 1 and y = 2 then i want x / y = 0.5, i don't care if x and y are both ints. in fact i cannot think of a single instance in my programming career where i wanted the integer division behavior integer div is really useful sorry
|
# ? Apr 8, 2016 13:57 |