« first day (1342 days earlier)      last day (3624 days later) » 

8:00 AM
sounds like fun
 
user1804599
Don't hack.
 
user1804599
Write clean code.
 
rightfold is srs bzns
 
Ven
@rightfold put the PHP down -- you can still get away with it !
 
@rightfold how late do you arrive at work?
 
8:05 AM
Why don't you ask a new question? This question is over a year old... (I'm not your personal helpdesk. SO isn't either, but peopl may find your problem interesting and answer it) — sehe 8 secs ago
 
the first thing I do when I start refactoring a piece of code is I take care of lines that stand out as too long; I find that "skyscrapers" is a good term for them, if you look at the code like this
they stand out like hell and piss me off
 
> Why don't you just write a script to copy over everything you do?
 
Ven
FUD
reported
 
@AlexM. I'd be pissed if my screen was rotated 90 degrees too
 
user1804599
@StackedCrooked between 9 o'clock and half past 9.
 
8:07 AM
@sehe I rotated it so that lines look more like buildings, obviously :P
 
Ven
lies
 
okay you got me, my neck is broken
 
¬_¬ stupid java not being C++
 
@AlexM. Do you not have a column limit?
Mine's 125 columns.
 
almost always the long lines are just things like something = new Vector2(<some complex calculation for coords here>) that I do quickly on the spot just to see the results, and forget about
@Rapptz never used such a thing
 
8:12 AM
I just want to do template specialisation, but noooo
 
user1804599
@thecoshman Use Scala.
 
@AlexM. You might want to start m8.
 
@rightfold ¬_¬ you say that like it could just happen
 
Ven
@thecoshman it could.
 
you realise how much fighting would have to be done just change build systems (well script)
 
8:13 AM
@Rapptz does that auto-switch to a new line when you reach the limit, or does it issue some warning?
 
the red tape is stupendous
 
what editor do you use?
 
user1804599
@thecoshman what build system do you use?
 
user1804599
inb4 makefiles
 
because I'd rather it was something like the latter, since as I said above, long lines are caused by me doing complex calculations that are better off extracted in their own named variables first
 
user1804599
8:14 AM
@Rapptz Woot. Mine's 80.
 
I use monodevelop 4.0.1
 
@rightfold well, makefiles that just call antscripts :'(
 
@AlexM. My condolences buddy.
 
@Rapptz shit-eclipse
 
user1804599
@thecoshman fail
 
8:16 AM
@Rapptz I'm supposed to be able to use Xamarin Studio with Unity, but I never tried to actually do it; no idea what it breaks and what it does not
that's as close as I can get to a good IDE for unity
 
Ven
@AlexM. I used VS with unity D:
 
@rightfold it is a very old project people are reluctant to change from one thing they don't understand to another.
 
user1804599
I use IntelliJ.
 
@Ven was that in pleistocene?
 
Ven
@rightfold with unity ? lies
 
user1804599
8:17 AM
@Ven No, of course not.
 
user1804599
What the fuck would I use Unity for?
 
Ven
@AlexM. 'twas 2 or 3 months back
I first tried monodevelop with unity, but it just sucked too much, so I swapped onto VS.
 
it's a pain to get Unity to work with any VS that's not the full blown pro edition
 
Ven
Oh, but I have the full blown pro edition
 
and you can only get the debugging and all that to work with an expensive third party plugin
 
Ven
8:18 AM
free, cause i'm a student
so, it's probably why it all worked smoothly
 
that's because the pro edition is the only one IIRC that supports plugins.
 
probably, but it's known that Unity used to support the express editions too, ages ago
 
Ven
@AlexM. then m$ paid them not to anymore ;)
 
UnityVS Professional $249
 
@AlexM. How?
 
8:19 AM
^^ the plugin needed for debugging and stuff with VS pro
 
Ven
@AlexM. We were lucky enough to be kinda-sponsored by m$ on that one project, so it all went smoothly
 
@AlexM. no shit
 
what is written there seems to not be valid anymore
@Ven I can't tell my manager to pay $250 for a plugin so that I can set a column limit for my code, aside from the pricey VS pro
monodevelop forever
might as well become a fan
 
Ven
@AlexM. No, you definitely can't. But since we had the unity-m$ guy, it was just "there"
 
@AlexM. Oh. Not a plugin. Just using it as an editor lol
 
Ven
8:22 AM
though I never put the app on their store, gave up after 3 hours trying.
 
how silly
 
@Rapptz yes, now it's either VS pro or MonoDevelop
OR your own .exe that acts like monodevelop but instead starts the editor of your choice
that's how I experimented with coding in Vim for my unity projects
 
Ven
@AlexM. wtf
get some help dude
 
lol
 
user1804599
I wrote my Android project for school in Vim.
 
user1804599
8:24 AM
Fuck Eclipse.
 
Ven
I used AppCode for my android project (:
the emulator was terrible, though, but it's not idea's fault
 
I learned how Android's tools generate projects and what a project consists of just because I decided to use Vim and the command line for a simple project instead of letting Eclipse take over everything
I wouldn't do it again
but at least I know what happens when Eclipse shows me a progress bar
 
Ven
java code tries to run ?
 
user1804599
Although when I discovered that to pass something to an activity you have to make it either serializable or global I decided to not continue.
 
Ven
@rightfold Same with wphone apps, really.
I never did ios apps, only did mac os ones in obj-c, and it was the worst of the 3
 
user1804599
8:26 AM
Then Windows Phone has a terrible API as well.
 
same with data that needs to be kept between scenes in unity
 
Ven
Yeah, I just had a lot of global state in my unity one.
 
@rightfold if you want to pass simple stuff like a few ints or strings, use extras for the activity intent
 
Ven
static public int lives = 3;
 
user1804599
@AlexM. I want to pass objects that represent my data.
 
Ven
8:26 AM
and fuck this shit
 
@Ven do you like AppCode ?
 
Ven
@JohnPoison 'twas better than eclipse, a lot so
"like it" no, because fuck android and java.
 
user1804599
Of all the mobile platforms I've developed for iOS was the least terrible.
 
Ven
then mac os must be very different to ios.
 
@rightfold public static something ahoy!
 
user1804599
8:28 AM
I'd rather suffer from cancer than writing terrible code like that.
 
shrug
 
Ven
@rightfold :) enjoy your cancer
 
user1804599
@Ven No, I don't write code like that.
 
user1804599
Why the fuck would I? I'm not an idiot.
 
last time I used AppCode under Mac OS X for c++, I decided to stick with XCode, because AppCode doesn't understand auto and lambdas
 
8:29 AM
just use fragments I guess
 
user1804599
Globals are instant cancer.
 
keep the objects that you'd otherwise pass over to another activity in the main activity
and just switch between fragments
 
user1804599
Or don't develop for Android.
 
user1804599
Or make them serializable.
 
I was supposing you had to develop for android
 
user1804599
8:31 AM
I don't have to do anything.
 
Ven
I had to use unity. So, I had globals.
 
user1804599
I could do it if I wanted a grade but I didn't so I stopped.
 
user1804599
I'd rather spend my time on something useful.
 
jesus fucking christ rightfold, you're the new grumpy puppy today
 
Ven
red sea ahoy
 
8:33 AM
@Ven why don't you make a dummy game object with a script that would represent some configurable variables container (instead of globals)
 
Ven
@JohnPoison That's what I had. But it's still global state.
because the "dummy game object" has to be shared globally
 
@JohnPoison because that's a singleton
 
Ven
it's centralized global state, which is probably better, but still terrible
 
a gameobject with configuration info that you're forcing to keep alive between scenes is essentially a singleton that you can, I guess, delete, but never will
 
Ven
why would you delete it ? it's your state
 
8:35 AM
@AlexM. so why not? Singleton is evil only if you have tight coupling with it. But if you're using interface instead of exact class, it's not that bad
 
my point was, there's little conceptual difference between what you suggest and what ven was using
 
Ven
It's clearly that bad.
 
except yours requires a lot more work
 
Ven
yeah, there's very little difference
 
I feel like making a game
 
Ven
8:36 AM
@AlexM. it does, but it's a tiny bit cleaner because it's centralized
 
@AlexM. there's a pretty big difference between an object you create one instance of, and choose never to delete, and one which is actually designed so that one instance is always globally accessible, cannot be deleted, and where new instances cannot be created.
 
keeping the object alive, always working towards finding it when a scene is loaded, setting up references etc.
 
but I have no ideas
 
Ven
@Rapptz cow murdering
 
@jalf that's true in general, however for our particular case, the first requires more work and is used in the same way as the 2nd
references between objects in unity are best made in the editor, unless you want to search for objects in the whole scene at runtime and write extra code to set the references
using a persistent gameobject just makes you go that extra mile for little to no gain over a static field
 
8:39 AM
I like Service Container pattern and I found it useful. Just one singleton - service container.
 
user1804599
@JohnPoison Ugh, globals.
 
@AlexM. how can not adding complexity to a class require more work?
 
Ven
@jalf you're adding complexity
 
@jalf I said that adding requires more work
 
@rightfold so what's wrong with it?
 
8:41 AM
I agree with Mister sehe, you are not so far from being an asio expert dear mister M__. asio learning curve is a little bit tough, that post link may help you. — jean Davy 1 min ago
Huh. What the actual. Thanks for the upvote I guess :/
 
Ven
:D
gave you one too for the effort
 
user1804599
@JohnPoison you expose stuff through a global, basically making them globals as well.
 
Ven
^
 
@rightfold so?
 
user1804599
I don't see what's so wrong with function arguments.
 
user1804599
8:42 AM
They're easy to understand and easy to use.
 
user1804599
No global state.
 
@rightfold nothing wrong
 
@AlexM. and I'm saying that the first case I mentioned is literally just a class with nothing special. You create one instance if you need one instance, and that's all, nothing special is required in the class. The second case requires you to add nasty singleton machinery to the class to enforce that only one instance can exist. The latter is more code, always.
 
I agree with you completely
 
Ven
global constants are okay tho
 
8:43 AM
it's just that with some APIs and with some engines, that cannot always be achieved
 
user1804599
@Ven yeah, because they're immutable. :v
 
@jalf and I said that's a general case
 
user1804599
So you can basically go replace all their uses with their values in the source code and it would do the same thing.
 
in Unity's case that does not apply
 
Ven
@rightfold that was my point indeed
 
8:43 AM
110
A: Are global variables bad?

Brian RasmussenThe problem with global variables is that since every function has access to these, it becomes increasingly hard to figure out which functions actually read and write these variables. To understand how the application works, you pretty much have to take into account every function which modifie...

 
@AlexM. that... doesn't make sense
 
it does if you use Unity
 
Ven
I don't like global state because I'm not smart enough.
I'm not smart enough to calculate every single possibility of them changing in my code. So I don't use them
 
Unity makes it easier to write code than not write code? O.o
 
the bread and butter of Unity is the MonoBehaviour class, which gets attached to gameobjects; Unity uses reflection to execute the behavior contained in whatever inherits MonoBehaviour
 
Ven
8:45 AM
@jalf unity forces you to have global state
 
you don't new monobehaviours
you use a specialized method provided by unity which does its magic to add the object to the scene
 
Ven
Unity news ScriptBehavior (or smth) and they inject deps in it
 
@Rapptz I don't get it. If your class need some other object, it have to own some connection with it. It can be done via injection, so what's wrong with it ?
 
normally monobehaviours don't know about eachother so they must Find() themselves, if you don't somehow force some references in the editor first
 
@AlexM. irrelevant. Look at the comment I originally responded to:
12 mins ago, by Alex M.
a gameobject with configuration info that you're forcing to keep alive between scenes is essentially a singleton that you can, I guess, delete, but never will
 
8:47 AM
@JohnPoison You don't get what exactly?
 
My point was simply that a class which you can delete, but choose not to, is not a singleton. Even if you only have one instance, and even if you never delete that instance, it is not a singleton
 
@jalf You delete it when you get new settings and have them instead.
 
@jalf alright, I'm sure I agreed with that
 
:)
 
@Ven Nobody is.
 
Ven
8:49 AM
@DeadMG I guess so
 
@Rapptz why service container is bad? It's up to you how you are using it. It's not smart enough to use it like a global store.
 
Ven
/me guessed that was what the feature did
 
Xeo
yesterday, by Xeo
There, first answer in 7 months or so
 
Ven
@Xeo why did you stop ostracize for so long,btw?
 
Xeo
Too lazy, no interesting questions
 
Ven
8:53 AM
'feel you
 
Xeo
I have been answering questions in comments, mind you
 
Ven
Made the same 6-or-so pause
oh, so not that much of an hiatus
 
Xeo
I've just left the rep-grabbing to other people
 
I feel like shit and the only source of caffeine is two floors below :(
 
user1804599
Then go down two floors.
 
8:54 AM
Lol. Comment about bitfields in c++:
> I have used them long ago for on-the-wire formats. When I encounter such code now, I treat it like asbestos: It's probably safe if left undisturbed, but will likely require very careful cleanup and the coding equivalent of a hazmat suit if you have to touch any of it. :-)
 
Ven
I didn't answer any question from jan to june
 
@rightfold I can't, I'm stuck to this chair
 
user1804599
@AlexM. delete the chair.
 
Ven
@rightfold it's a global singleton, can't
 
can't, the chair is public static
lol
nobody told IKEA about good chair architecture practices
 
user1804599
8:56 AM
Get a better chair.
 
Xeo
@AlexM. Better than pubic static.
 
user1804599
cubic static
 
> "... there's more than enough rope there to let you shoot yourself in the foot..."
erm. what
 
user1804599
Rope is kinky.
 
metal gear solid: ropes of the patriots
 
8:58 AM
pubic chair
 
Ven
And instead of a ladder boss, it'll be a rope boss ?
Makes sense
 
@Ven it also features thread ocelot
 
user1804599
Is this the end?
 
user1804599
I see raging ravens in my dreams.
 
Ven
@rightfold then stop dreaming and work
 
user1804599
9:01 AM
No. Fuck you.
 
Ven
Okay, let's schedule that then
 
dammit rightfold stop being so chaotic evil, you're depressing me :(
 
Ven
that's not being evil, that's being d4rk.
 
user1804599
Woo, this is much better than .zshrc.
 
user1804599
~ $ function l
        ls -l
    end
~ $ funcsave l
 
Ven
9:11 AM
@rightfold y u no alias
 
user1804599
There is no aliassave.
 
user1804599
> alias is a simple wrapper for the function builtin. It exists for backwards compatibility with Posix shells. For other uses, it is recommended to define a function.
 
Ven
:P
 
It doesnt give the error but your script doesnt work :( It didnt delete anythink... — serdar Jun 10 at 13:40
 
9:21 AM
I find arguments here to branch out to many topics way too often
and thus to be very exhausting and a chore to go through
 
The problem is that it is mostly a futile affair to argue in here
 
Ven
not "mostly"
 
user1804599
Meh, fish sucks.
 
resistance is futile
 
whenever I get to deep in an argument I get out because I start to not be able to follow anymore lol
I'm falling asleep on this static chair
the lounge is more and more fuzzy
 
9:30 AM
25
Q: Why this code outputs more than 4 lines?

zerkms#include <iostream> int main() { for (int i = 0; i < 4; ++i) std::cout << i*1000000000 << std::endl; } I understand there is a signed integer overflow. What I cannot get is why i value is broken by that overflow operation? Online: http://ideone.com/dMrRKR Compiler: gcc (4.8)

3
lol C++
gotta love UB
 
Xeo
Hm, this looks kinda interesting.
 
@JohnPoison The only valid use case for Singletons I have found are stateless classes for which different objects would be indistinguishable from one another. Note that having multiple instances wouldn't be wrong in this case, it would just be inefficient.
 
@Xeo try dark messiah if you haven't already
haven't played lichdom but they seem similar, at least if you play DM as a mage
 
One example would be the empty immutable list. There's no point in having more than one.
 
Ven
@FredOverflow "singletons without state" are just "constants".
 
9:39 AM
@FredOverflow I use singleton only for service container. And yes, there's no point in having more than one
 
a service container is stateless?
 
nope
 
@JohnPoison have you heard of unit tests? I'd want each test to have its own service container.
 
@FredOverflow wow
 
" there's no point in having more than one" <- famous last words
 
9:43 AM
@jalf own instance or own type of service container. Do you mean that you run several unit test at once and each one will create the copy of service container ?
 
@FredOverflow Arguably, there's no point in "having" one at all, if its representation takes up no memory
 
@LightnessRacesinOrbit But you want an object with methods for the empty list.
 
@FredOverflow "Methods" don't take up memory either
inb4 yes in the code segment; go fuck
 
Sure, but when I say var foo = theEmptyList and I ask foo.isEmpty, then I want virtual dispatch, hence the empty list at least needs a vptr.
 
user1804599
@FredOverflow It's immutable so it doesn't matter anyway.
 
9:48 AM
> Note that having multiple instances wouldn't be wrong in this case, it would just be inefficient.
@JohnPoison Clearly you are infected with Singletonitis. We have all been there. Good luck.
 
@FredOverflow infected? Because I'm using ONE?
 
Ven
I remember when I was there. Boi was I wrong :B
 
@JohnPoison Don't worry, you're still in the stage of denial. I have been there. Unless you're working on trivial projects, sooner or later you'll have a revelation. Even Erich Gamma admits they are a bad idea.
 
Oh they're not that bad; people need to get off their high horse about it
 
@FredOverflow what's the alternative. Can you propose solution?
 
9:53 AM
@LightnessRacesinOrbit FUCK YOU FUCK SINGLETONS!!!
@JohnPoison make dependencies explicit
 
unity is always so quick at adopting new platforms
 
that article goes on and on and on about prescriptivist "patterns" and can go fuck
 
you can build games for anything with it, except Wii it seems
 
Ven
@AlexM. you don't build games for wii U
(no, I'm not mad because I don't have the new mario kart)
(fuck you)
 
@FredOverflow can you provide example?
 
9:54 AM
I already said you can't build for Wii
but Xbox One and PS4 are there
same for PS mobile
 
@JohnPoison There are so many articles on the Internet explaining how Singletons are bad and what you can do about it, I don't want to start from scratch here.
What most websites are about:
1. Porn
2. Monad Tutorials
3. Singletons are bad, mkay?
5
 
@FredOverflow so the most obvious solution is just pass service container as an injection to all classes that require it. Is it acceptable?
 
@JohnPoison Yes. If it turns out you're passing references "everywhere", then there is something wrong with your design; not every class should need access to your services.
That's one of the major problems of Singletons: They hide problems with your design.
(Why am I doing this, I said I was going to shut up?)
shutting up about Singletons now
 
@FredOverflow sure. I understand you. Thanks anyway
 

« first day (1342 days earlier)      last day (3624 days later) »