Let's get programmy!

If you have some randomness to share that you can't post elsewhere, this is the place to do it.
Post Reply

Is Assembly the best programming language?

Yes
3
9%
Oh God my eyes
3
9%
Oh God my brain
12
38%
I perform unholy incantations to keep Assembly at bay
4
13%
Real men write binaries by hand
10
31%
 
Total votes: 32
User avatar
Callid
Ratio vincit omnia.

Posts:
1433

Re: Let's get programmy!

Post by Callid »

Switching without Strings just looks... :|

Code: Select all

switch (file[i].substring(4).trim().hashCode()) {
    case 1990942351: { // = "skillList".hashCode()
        //does stuff
    }
}
If  ;), :D, ;D, ::), :P, :-X, :o or >:D are attached, that paragraph may not be 100% serious. Seriously.
This link provides further information.
Callid Conia Pact - Petitions - Archive
ranger
Community Villain

Posts:
3588

Re: Let's get programmy!

Post by ranger »

Akonyl wrote: that bottom-left panel's basically what happened when I started work, except in my case it was "oh hey we're gonna stick you in the office with these two guys so they can teach you" and then they were in the office maybe 10% of the time because they were working on projects that needed them elsewhere :V
My supervisor (very hot) and mentor are both really nice to me, but jesus whenever I check the office communicator they are ALWAYS in meetings.  It's hilarious; the co-ops all joke that they just go to meetings and don't do any work.

The phone/computer thing is true for me...I didn't have internet access to my desktop since day 1, and still don't.  I've been using a laptop that IT loaned out to me.  And the machine is still on Vista. And my phone doesn't work  :'(
Image
Image
Akonyl
Community Hero

Posts:
4200

Re: Let's get programmy!

Post by Akonyl »

my phone works, I'm just not sure how to use it 100%. I can call people, but I have 3 missed messages that have been sitting on it for ages because I forgot my voicemail password and don't know how to reset it  :-X
Callid wrote: Switching without Strings just looks... :|
that's not the switch's fault, that's your fault for using magic numbers. :P
User avatar
Callid
Ratio vincit omnia.

Posts:
1433

Re: Let's get programmy!

Post by Callid »

Akonyl wrote:
Callid wrote: Switching without Strings just looks... :|
that's not the switch's fault, that's your fault for using magic numbers. :P
Well, I have to. It has to be a number, and it must be constant (so no case "skillList".hashcode():). I don't really have a choice in that matter, if I want to use switches (and avoid those even more unsightly if-else-if-else-if-else...) :P
If  ;), :D, ;D, ::), :P, :-X, :o or >:D are attached, that paragraph may not be 100% serious. Seriously.
This link provides further information.
Callid Conia Pact - Petitions - Archive
Akonyl
Community Hero

Posts:
4200

Re: Let's get programmy!

Post by Akonyl »

Callid wrote:
Akonyl wrote:
Callid wrote: Switching without Strings just looks... :|
that's not the switch's fault, that's your fault for using magic numbers. :P
Well, I have to. It has to be a number, and it must be constant (so no case "skillList".hashcode():). I don't really have a choice in that matter, if I want to use switches (and avoid those even more unsightly if-else-if-else-if-else...) :P
http://docs.oracle.com/javase/tutorial/ ... /enum.html :I

but really, I just use nested ifs anyway.
User avatar
Kirbypepe
Wonder what I'll turn into =D

Posts:
135
Contact:

Re: Let's get programmy!

Post by Kirbypepe »

So how would anyone go about creating a memory manager efficiently?
Howdy Everyone=]

Things are fantastic. How about for you?

Thats cool.

Wait I just realized, who am I talking to????
Akonyl
Community Hero

Posts:
4200

Re: Let's get programmy!

Post by Akonyl »

use a language that takes care of garbage collection for you  :-X

Otherwise, though I never made one myself, you could probably make a generic class that serves as a pointer wrapper, and make a map of that maps a pointer's int address to a "copies" number, which upon creation / reassignment / destruction of the pointer wrapper, would increment or decrement that number accordingly, and have a "pointer manager" object that spends its time looking through for instances in the map where "copies == 0" and then deallocating that memory. There's bound to be some sort of issue with that implementation though since I've never actually tried it :P

but also, depends what you mean exactly by a "memory manager" I spose.

edit: Or if you're doing C++, they basically have this exact thing in a boost library: http://www.boost.org/doc/libs/1_48_0/li ... rt_ptr.htm
Last edited by Akonyl on January 31st, 2012, 5:23 pm, edited 1 time in total.
User avatar
Kirbypepe
Wonder what I'll turn into =D

Posts:
135
Contact:

Re: Let's get programmy!

Post by Kirbypepe »

Haha well I'm in a senior project group, and what they want to do right now is create a game engine. And with the game engine we will be writing everything from scratch to create a game for the next semester for the actual game engine. I'm going to be using C++ but apparently they want the memory manager to be like a large pool of memory that the engine builds off of.
Howdy Everyone=]

Things are fantastic. How about for you?

Thats cool.

Wait I just realized, who am I talking to????
Akonyl
Community Hero

Posts:
4200

Re: Let's get programmy!

Post by Akonyl »

So like, you'd just malloc a huge block of memory and then have your engine "malloc" that space off to all the new objects you make? That just seems unnecessarily restrictive to me, unless there's some reason they want all the game's memory to be in a contiguous block like that.
User avatar
Kogorou
*drinking beer and playing guitar*

Posts:
1132
Contact:

Re: Let's get programmy!

Post by Kogorou »

You forgot to add the option:
"Real Programmers use Butterflies"

How the heck to to expect me to programm without Butterflies ?
Kirbypepe wrote: So how would anyone go about creating a memory manager efficiently?
Take what you need.
Drop what you can.

That's the way I would do something like that.
Last edited by Conia on January 31st, 2012, 9:26 pm, edited 1 time in total.
ranger
Community Villain

Posts:
3588

Re: Let's get programmy!

Post by ranger »

@ Kogorou: ... -.-

I'm a code monkey intern slave.  I need more money.  And less grunt work. 
Image
Image
User avatar
Chekhov MacGuffin
Community Scholar
BAGA BGEGD EDBDEG A

Posts:
2684

Re: Let's get programmy!

Post by Chekhov MacGuffin »

Learning Python.

Formerly

class Helloworld {
   public static void main(String[] args) {
       System.out.println("Hello, world!");
   }
}


becomes

print 'Hello, world!'

Loving it already. Most of my programs are small, so Python is going to work well.
User avatar
Vylash

Posts:
3757
Contact:

Re: Let's get programmy!

Post by Vylash »

So yeah, how about that C++? Pretty crazy stuff
Image
Akonyl
Community Hero

Posts:
4200

Re: Let's get programmy!

Post by Akonyl »

THE CRAZIEST, PARKUR

and yeah, Python's probly pretty good for smaller stuff but I just hate the way it handles scoping (by indenting, not braces) :P

@ranger: I dunno what the place you're workin at does, but regardless of bein an intern they might have you on grunt work for a while. They didn't even allow me to touch a line of code for the first month or two, and only let me run tests to get acquainted with things. Most of the test cases, funnily enough, were written by an intern who had been working there for a while, so just because you're an intern doesn't mean you won't get to do actual work. :P
ranger
Community Villain

Posts:
3588

Re: Let's get programmy!

Post by ranger »

Python, scripting languages in general, are great.  Honestly, I feel like most people should probably learn python/ruby first rather than an OOP high-level language like Java or C++...the pseudocode makes a lot more sense for beginners, and the readability is so much better.  When I was a noobie, my god reading other people's code was horrific.  Especially when they didn't comment.  Hell it still is pretty horrific when it comes to some stuff.

But of course...scripting languages still got its flaws...but nothing that someone who isn't like a software engineer should fret about. its like..75 times slower in execution compared to like C++ and C but I mean, not really that important.  And, it kinda sucks compared to other languages when it comes to memory stuff.


@Akonyl: I just do a crapload of grunt work.  I'm at a semiconductor company, and I'm supposed to do like.. Automatic Testing on the processor level, so cool shit, but so far I've just been doing the nastiest and dulling XML parsing for tester data.  Shit is gross.  Especially when XML formatting can be extremely lenient.  Millions of HashMaps.  Millions.
Image
Image
Post Reply