Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 188 189 [190] 191 192 ... 796

Author Topic: if self.isCoder(): post() #Programming Thread  (Read 887683 times)

Mego

  • Bay Watcher
  • [PREFSTRING:MADNESS]
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #2835 on: August 27, 2012, 01:19:37 am »

MorleyDev: I was the guy commenting on your livestream, asking questions and making fun of your pronounciations of things. ("Paradijims"? Really? :P) I wanted to take a look at your code, but I cannot for the life of me get it to compile. At first I tried to use Visual Studio, which was a nightmare. Then I got Eclipse up and running with a working Hello World program, but however I try to open your project it never works. It seems the best method to open the entire project is to create a workspace and then Import --> "Existing Projects into Workspace". However, in Executable/code/main.cpp there are tons of things underlined with red, notably shared_ptr, and I can't figure it out. Any help would be greatly appreciated.

No C++11 support maybe?

MorleyDev

  • Bay Watcher
  • "It is not enough for it to just work."
    • View Profile
    • MorleyDev
Re: if self.isCoder(): post() #Programming Thread
« Reply #2836 on: August 27, 2012, 02:06:49 am »

C++11 support (I use GCC 4.7 so probably won't build under Visual Studio or earlier GCC versions) and the latest Boost are required. Make sure the External/include folder and Libary/code/include are being used too as include directories in the project settings ^^

The actual executable is pretty unimpressive though, just a box you can move around.
Logged

Siquo

  • Bay Watcher
  • Procedurally generated
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #2837 on: August 27, 2012, 07:51:53 am »

tl;dr - I failed hard, but had a blast doing so.
Whenever I do programming projects, I always get stuck trying to write better code instead of writing working code and getting something rolled out. I feel your pain.
This is how I spent 6 days on the UI for a 7DRL Roguelike  :-\
Logged

This one thread is mine. MIIIIINE!!! And it will remain a happy, friendly, encouraging place, whether you lot like it or not. 
will rena,eme sique to sique sxds-- siquo if sucessufil
(cant spel siqou a. every speling looks wroing (hate this))

Nadaka

  • Bay Watcher
    • View Profile
    • http://www.nadaka.us
Re: if self.isCoder(): post() #Programming Thread
« Reply #2838 on: August 27, 2012, 09:27:43 am »

Yea, I've been trying to make sure I do thorough unit testing on my mot recent code project. I have twice as much code in my unit tests as I do in the program. I had over 97% code coverage at one point, now its 70 something. But having that much test built up should make it easier to pick back up after the inevitable slacker periods.

This is another positive point for java, junit is a great test platform.
Logged
Take me out to the black, tell them I ain't comin' back...
I don't care cause I'm still free, you can't take the sky from me...

I turned myself into a monster, to fight against the monsters of the world.

MorleyDev

  • Bay Watcher
  • "It is not enough for it to just work."
    • View Profile
    • MorleyDev
Re: if self.isCoder(): post() #Programming Thread
« Reply #2839 on: August 27, 2012, 10:56:08 am »

Though Junit's weirdness does influence every unit test framework that followed. Why is Assert.equals(expected, actual)? Why is the expected first? It just flies in the face of how everybody codes. Practically every piece of code I've ever seen has typically put if ( actual == expected ) { stuff } and the other way around just feels plain odd.

For C# at work we use Nunit and Moq. Only downside is the lack of "every function is virtual" in C# means you will hit "unmockable" classes you have to wrap. On the plus side, not practically every function in C# is virtual and developing that way encourages good interface design.

For C++ I use Google Mock with UnitTest++. The latter is fine (I did write custom output streamer so it goes in a nicer format and reports successes but that's about it), and the former...well, it works. None too pretty though...
« Last Edit: August 27, 2012, 10:59:47 am by MorleyDev »
Logged

Nadaka

  • Bay Watcher
    • View Profile
    • http://www.nadaka.us
Re: if self.isCoder(): post() #Programming Thread
« Reply #2840 on: August 27, 2012, 11:07:34 am »

I have used MBUnit for testing c#. Very similar to JUnit, but it it didn't integrate with visual studio as well as junit integrates with eclipse. Had to do local testing outside of visual studio.

At my previous job we had a multi-language codebase, mostly c# and java and we compiled, tested and deployed the whole thing from ant scripts running on a cruisecontrol continuous integration server. It was pretty slick, it even sent out blame emails alerting everyone who was responsible for breaking the build so we could shoot him with nerf guns.

Working on defense contracts isn't quite as fun.
Logged
Take me out to the black, tell them I ain't comin' back...
I don't care cause I'm still free, you can't take the sky from me...

I turned myself into a monster, to fight against the monsters of the world.

Mego

  • Bay Watcher
  • [PREFSTRING:MADNESS]
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #2841 on: August 27, 2012, 11:27:35 am »

It was pretty slick, it even sent out blame emails alerting everyone who was responsible for breaking the build so we could shoot him with nerf guns.

I need to apply to wherever that is.

Nadaka

  • Bay Watcher
    • View Profile
    • http://www.nadaka.us
Re: if self.isCoder(): post() #Programming Thread
« Reply #2842 on: August 27, 2012, 11:34:48 am »

It was pretty slick, it even sent out blame emails alerting everyone who was responsible for breaking the build so we could shoot him with nerf guns.

I need to apply to wherever that is.

Sadly it does not exist any more. The venture capital guys got cold feet literally only a few months before we were start getting income off of the shops biggest project. At first we got told to hold off cashing paychecks, then they paychecks bounced. Then we started getting our paychecks late, and then later. I bugged out asap, they guys who stayed to the end didn't get their final 2 paychecks.
Logged
Take me out to the black, tell them I ain't comin' back...
I don't care cause I'm still free, you can't take the sky from me...

I turned myself into a monster, to fight against the monsters of the world.

MagmaMcFry

  • Bay Watcher
  • [EXISTS]
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #2843 on: August 27, 2012, 11:58:18 am »

Though Junit's weirdness does influence every unit test framework that followed. Why is Assert.equals(expected, actual)? Why is the expected first? It just flies in the face of how everybody codes. Practically every piece of code I've ever seen has typically put if ( actual == expected ) { stuff } and the other way around just feels plain odd.
Wait, what? Isn't equality symmetrical? Can't you just write Assert.equals(actual, expected)?
Logged

Siquo

  • Bay Watcher
  • Procedurally generated
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #2844 on: August 27, 2012, 02:50:25 pm »

Though Junit's weirdness does influence every unit test framework that followed. Why is Assert.equals(expected, actual)? Why is the expected first? It just flies in the face of how everybody codes. Practically every piece of code I've ever seen has typically put if ( actual == expected ) { stuff } and the other way around just feels plain odd.
Wait, what? Isn't equality symmetrical? Can't you just write Assert.equals(actual, expected)?
You can, but some programmers prefer if("test" == var)  to if(var == "test"), because they are dyslexic and can't tell the difference between = and ==. I'm guessing that's why a lot of assertEquals functions do it in that order (PHPUnit does it also).
Logged

This one thread is mine. MIIIIINE!!! And it will remain a happy, friendly, encouraging place, whether you lot like it or not. 
will rena,eme sique to sique sxds-- siquo if sucessufil
(cant spel siqou a. every speling looks wroing (hate this))

Nadaka

  • Bay Watcher
    • View Profile
    • http://www.nadaka.us
Re: if self.isCoder(): post() #Programming Thread
« Reply #2845 on: August 27, 2012, 03:01:48 pm »

is assertEqual(expected, actual) is probably implemented with expected.equals(actual), as the == operator on objects only compares the reference. If it was actual.equals(expected) then it would throw a slightly less useful and possibly wrong NullPointerException if the actual result was null.

But none of that really matters for the order of parameters, which is really just arbitrary. The thing that annoys me is that the failure message is the first parameter when present. And that definitely breaks with convention where optional parameters are typically appended to the end of the list of parameters.
Logged
Take me out to the black, tell them I ain't comin' back...
I don't care cause I'm still free, you can't take the sky from me...

I turned myself into a monster, to fight against the monsters of the world.

zombie urist

  • Bay Watcher
  • [NOT_LIVING]
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #2846 on: August 30, 2012, 11:16:17 pm »

Does anyone know of a simple online tool that lets a small group of people work on code simultaneously?

Kindof like google docs, but for code.
Logged
The worst part of all of this is that Shakerag won.

kaijyuu

  • Bay Watcher
  • Hrm...
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #2847 on: August 30, 2012, 11:18:49 pm »

http://code.google.com/

You'll have to learn SVN or GIT or something of course, though.
Logged
Quote from: Chesterton
For, in order that men should resist injustice, something more is necessary than that they should think injustice unpleasant. They must think injustice absurd; above all, they must think it startling. They must retain the violence of a virgin astonishment. When the pessimist looks at any infamy, it is to him, after all, only a repetition of the infamy of existence. But the optimist sees injustice as something discordant and unexpected, and it stings him into action.

zombie urist

  • Bay Watcher
  • [NOT_LIVING]
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #2848 on: August 30, 2012, 11:26:09 pm »

Yeah that's too complicated. This is mostly for short HW assignments that are meant to be done with a partner or small group projects.
Logged
The worst part of all of this is that Shakerag won.

kaijyuu

  • Bay Watcher
  • Hrm...
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #2849 on: August 30, 2012, 11:26:45 pm »

Pastebin, then.
Logged
Quote from: Chesterton
For, in order that men should resist injustice, something more is necessary than that they should think injustice unpleasant. They must think injustice absurd; above all, they must think it startling. They must retain the violence of a virgin astonishment. When the pessimist looks at any infamy, it is to him, after all, only a repetition of the infamy of existence. But the optimist sees injustice as something discordant and unexpected, and it stings him into action.
Pages: 1 ... 188 189 [190] 191 192 ... 796