Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Locked thread
The Management
Jan 2, 2010

sup, bitch?
A pointer is just an address of some memory. Memory is what you make if it. I hope that makes it clear.

Adbot
ADBOT LOVES YOU

Sniep
Mar 28, 2004

All I needed was that fatty blunt...



King of Breakfast
i found a site that used register_globals today, it was just a random site on the net

i used it to put form submit POST data into a GET query string

nothing malicious

but seriously gently caress those guys for making my job easier, cuz, it was a cute hack at the moment to send a link that had form post data in the URI

but yeah dont do that

Hellsworn Barn
Apr 11, 2008

hi

JG_Plissken posted:

whats wrong with static data please don't blackball me

static things can't be changed and software that can't change is generally pretty lovely!!

X-BUM-RAIDER-X
May 7, 2008
attn all lovely programmers, especially sulk: the more you do your work, the better you will get at it. there is a general expectation in the programming industry that you will be left to your own devices to figure a lot of poo poo out on your own with minimal help from your boss, even if you're a noob. it sucks but it gets better and you just have to use whatever resources you get given to the best of your ability. if your requirements are vague, press your boss to be more specific. then stop being a little bitch and do your work.

X-BUM-RAIDER-X fucked around with this message at 07:24 on May 8, 2013

Moo Cowabunga
Jun 15, 2009

[Office Worker.




how lovely is sulk?

Moist von Lipwig
Oct 28, 2006

by FactsAreUseless
Tortured By Flan
programming is like one of the most well documented practices in human history, i'm no loving genius and i'm not a good programmer but figuring poo poo out isn't hard

rotor
Jun 11, 2001

classic case of pineapple derangement syndrome
I used to be pretty good at programming but now I hate it so I just do whatever because the answer to every loving architecture question is "who loving cares, we're gonna throw it out in a year or two anyway, do whatever the gently caress you want"

echinopsis
Apr 13, 2004

by Fluffdaddy
why is 99% of coding doing the same poo poo that's been done five billion times



include std.io


no poo poo. just assume it please compiler. it's as redundant as saying hi and goodbye to people you see every day

echinopsis
Apr 13, 2004

by Fluffdaddy
tef once recommended me a book on coding, I wonder what it was?

I want to read meta coding poo poo. like, not hardcore theory but explain why gotos are bad to me like I'm 5 years old

Knuc U Kinte
Aug 17, 2004

Programming ftw. Thought: What if God was a programmer and we're all just his code or whatever like in the Matrix. *takes a huge bong toke and gets a little bit high*

echinopsis
Apr 13, 2004

by Fluffdaddy

PleasingFungus posted:

half the common problems people have with pointers are just dumb syntax poo poo

int * foo, bar, etc

pointers are really very simple once you understand the basics!

except when you start dealing with funny pass-by-reference stuff (void foo(int& bar){}), dumb tricks/idioms like *foo++, etc

(basically the only reason pre/post-increment operators exist in tyool 2013 are to enable people who want to write unreadable code and/or to accidentally stumble into undefined language behavior)

but the basics of pointers are basically just one conceptual leap, and if you know how objects work in java/python/ruby then you're pretty much already there.

congrats!

can't pointers to pointers to pointers be used for some fancy efficient tricky code?


also I still can't even get my head around how even the most simple quine works... I need baby's first Quine written in basic and then run a debugger at 3 lines per hour just to follow it

tef
May 30, 2004

-> some l-system crap ->

PleasingFungus posted:

That's not what 'pass-by-reference' means.

When a function is 'pass-by-reference', the arguments are passed as pointers ('references') to the actual values, rather than the values proper. This means that you can modify the arguments (by dereferencing the pointer), which can be good or bad. It also means that you don't have to copy the values from one space in memory to another, which is important when dealing with large variables (arrays, big objects, etc).

In C and similar languages, you can actually work with pointers, so you can make the decision explicitly. (void foo(int a, int * b) - a is passed by value, b is passed as a pointer.) Java doesn't have user-defined pointers, so the language has to make the decision for you. The decision they made for primitives (ints, bools, etc) was 'pass-by-value'. In "int a = 1; foo(a); print(a)", the result printed will always be '1', no matter what happens in foo(). This is the primary appeal of pass-by-value: you can guarantee that variables passed as function arguments remain unchanged when you return to your own scope. It's a reasonable default.

Java objects, on the other hand, are passed by reference: if you pass in an object to a function & modify it therein, you can retrieve the modified value from the calling function. That means it's possible to 'simulate' pointers in Java by using objects. E.g. "class IntPointer { int containedInt; } IntPointer a = new IntPointer(); foo(a); print(a.containedInt) - the result could be anything! This is of course clunky & overly verbose, but if you like Java, that is probably right up your alley!

The (primary) reason that Java doesn't have pointers is that pointers let you freely tinker with memory. Unlike C, Java's memory is managed - instead of the programmer having to handle memory allocation & deallocation, it's abstracted into an operation of the JVM. That means, as another consequence, that the programmer can't be allowed to tinker with memory freely, because that would break the abstraction that lets Java's memory management works.


^^ This paragraph is the actual answer you were looking for, feel free to skip the rest.

*java objects are actually pointers with a very constrained set of operations that can be performed on them.

pass by reference isn't the same as passing a reference by value.

tef
May 30, 2004

-> some l-system crap ->
java is call by value. objects are stored as reference.

in a pass by reference language you can write a swap function.

actual languages that are pass by ref: perl

tef
May 30, 2004

-> some l-system crap ->
oh god what am I doing

tef
May 30, 2004

-> some l-system crap ->

echinopsis posted:

tef once recommended me a book on coding, I wonder what it was?

I want to read meta coding poo poo. like, not hardcore theory but explain why gotos are bad to me like I'm 5 years old

it was the practice of programming by kernighan and pike

tef
May 30, 2004

-> some l-system crap ->

chumpchous posted:

my company has been asking me if i want to move over to development full time. it's tempting because i honestly enjoy it a lot more than my real job (editing/coloring), but then i go into cavern of cobol or stack overflow and realize how hilariously underqualified i am to do any kind of real programming work.

i have no qualifications to do programming. most programmers have no idea what they are doing.

if you can write a for loop, and can count you are doing better than many people i've interviewed.


it is much easier to be a programmer if you stop caring about the quality of work you produce. if you get more money and have more fun doing code, just do it and drink yourself into oblivion to deal with the insecurity and ennui

FamDav
Mar 29, 2008

echinopsis posted:

can't pointers to pointers to pointers be used for some fancy efficient tricky code?

also I still can't even get my head around how even the most simple quine works... I need baby's first Quine written in basic and then run a debugger at 3 lines per hour just to follow it

pointers to pointers could be useful if for some reason you want to pass a pointer through an algorithm which modifies it. i would discourage you from doing this.

The simplest form of a quine is having a string version of the program with a blank spot where the stringified version ought to be. The body of the program just outputs that stringified version twice, once without quotes and once with quotes in the correct spot.

FamDav fucked around with this message at 08:38 on May 8, 2013

Moist von Lipwig
Oct 28, 2006

by FactsAreUseless
Tortured By Flan
i wish i had enough programming knowledge to dig really deep into like assembly it seems like the closer you get to raw silicon the closer you are to pure math/physics/enlightenment :lsd:

tef
May 30, 2004

-> some l-system crap ->

Moist von Lipwig posted:

i wish i had enough programming knowledge to dig really deep into like assembly it seems like the closer you get to raw silicon the closer you are to pure math/physics/enlightenment :lsd:

how bout this book ? http://www.nand2tetris.org

Moist von Lipwig
Oct 28, 2006

by FactsAreUseless
Tortured By Flan

thanks i'll give it a try :tipshat:

tef
May 30, 2004

-> some l-system crap ->

echinopsis posted:

can't pointers to pointers to pointers be used for some fancy efficient tricky code?


also I still can't even get my head around how even the most simple quine works... I need baby's first Quine written in basic and then run a debugger at 3 lines per hour just to follow it

a quine is a neat trick. from google this seems ok http://www.madore.org/~david/computers/quine.html


i also found this neat quine in python :3:

quine = 'quine = %r\r\nprint quine %% quine'
print quine % quine

FamDav
Mar 29, 2008

tef posted:

i have no qualifications to do programming. most programmers have no idea what they are doing.

if you can write a for loop, and can count you are doing better than many people i've interviewed.


it is much easier to be a programmer if you stop caring about the quality of work you produce. if you get more money and have more fun doing code, just do it and drink yourself into oblivion to deal with the insecurity and ennui

tef seriously you just need to find something that excites you. are there no jobs in the uk that you would find stimulating?

X-BUM-RAIDER-X
May 7, 2008
I enjoy programming in c++ because when I actually manage to do something useful with that language, I feel like a goddamn genius

tef
May 30, 2004

-> some l-system crap ->

FamDav posted:

tef seriously you just need to find something that excites you.

i'm dead on the inside.

quote:

are there no jobs in the uk that you would find stimulating?

http://www.theonion.com/articles/find-the-thing-youre-most-passionate-about-then-do,31742/

EMILY BLUNTS
Jan 1, 2005

Hmmmmmmmmmmmmmmmmmmmm




well of course

quote:

[SoapDocumentMethod("http://red-gate.com/webservices/ActivationServer/ActivateLicence", RequestNamespace="http://red-gate.com/webservices/ActivationServer", ResponseNamespace="http://red-gate.com/webservices/ActivationServer", Use=SoapBindingUse.Literal, ParameterStyle=SoapParameterStyle.Wrapped)]
public bool ActivateLicence(string activationRequest, out string activationResponse, out string errorMessage)
{
// This item is obfuscated and can not be translated.
}



:geno:
namespace Reflector.RickAstley
{
internal static class Roll
}



EMILY BLUNTS fucked around with this message at 09:34 on May 8, 2013

Jabor
Jul 16, 2010

#1 Loser at SpaceChem
Here I wrote a quine for you:

code:

Nomnom Cookie
Aug 30, 2009



gucci void main posted:

saying to read the specs to see how the code works is the worst argument, made only worse when non-native english speakers are writing some of your code

the wiki pages are the howto

Pittsburgh Fentanyl Cloud
Apr 7, 2003


The Management posted:

A pointer is just an address of some memory. Memory is what you make if it. I hope that makes it clear.

Thanks for the memory.

a nest of hornets
Nov 17, 2012

by Ralp

Sapozhnik
Jan 2, 2005

Nap Ghost
Programming is better suited to being taught by means of apprenticeships rather than degrees

this is how people learn to program in practice anyway, just in an informal and inefficient way

prefect
Sep 11, 2001

No one, Woodhouse.
No one.




Dead Man’s Band

Mr Dog posted:

Programming is better suited to being taught by means of apprenticeships rather than degrees

this is how people learn to program in practice anyway, just in an informal and inefficient way

ideally, you'd have a combination of formal education with the apprenticeships; i am always wishing i knew more "hard" computer science stuff

Share Bear
Apr 27, 2004

tef posted:

a quine is a neat trick. from google this seems ok http://www.madore.org/~david/computers/quine.html


i also found this neat quine in python :3:

quine = 'quine = %r\r\nprint quine %% quine'
print quine % quine

what do you use to keep track of bookmarks you have like a million links worth reading

PleasingFungus
Oct 10, 2012
idiot asshole bitch who should fuck off

tef posted:

java is call by value. objects are stored as reference.

in a pass by reference language you can write a swap function.

actual languages that are pass by ref: perl

yeah sorry I was real tired. I mentioned actual pass by reference in my second post in passing but basically I'm dumb.

also I've never used perl or other pass-by-reference languages so that's my excuse.

(fun fact: I originally described java as being universally pass-by-value, then I went back and edited it into the current state because if passing references by value isn't pass-by-reference, what is????)

((I'm dumb))

CuddleChunks
Sep 18, 2004

OBAMA BIN LinkedIn posted:

I enjoy programming in c++ because when I actually manage to do something useful with that language, I feel like a goddamn genius

This is me and C#. Hobby programming is all I end up doing since my very important CJ work doesn't have time for any code jibba jabba. Making little windows programs that automate tedious tasks helps me not top myself for one more day.

Thanks for being kinda handy, cee sharp.

NOTinuyasha
Oct 17, 2006

 
The Great Twist
finally, a thread for me

MononcQc
May 29, 2007

A thread for all

Cold on a Cob
Feb 6, 2006

i've seen so much, i'm going blind
and i'm brain dead virtually

College Slice
the best part of being a coder is going back and looking at old code and being like "what the hell is this poo poo this is terrible" then checking the repo history and seeing it was u

poemdexter
Feb 18, 2005

Hooray Indie Games!

College Slice
I left industry about a year ago because i was tired of crystal reports and db query writing. Now I'm in consulting doing crystal reports and db query writing. I sit in my driveway when I get home wondering if I should go inside or just hit the road and drive off a bridge so my wife and child can live off my life insurance for a few decades until she finds a husband that isn't a terrible husk of a human being with no purpose but to fix some reports that no one is going to see except some middle manager in the middle of nowhere. They probably won't even save the PDF after viewing.

finally, a thread for me.

Laserjet 4P
Mar 28, 2005

What does it mean?
Fun Shoe

Optimus_Rhyme posted:

I am a bad software developer and this is my life.

this read like a blog entry on codinghorror in an alternate universe

Adbot
ADBOT LOVES YOU

double sulk
Jul 2, 2010

poemdexter posted:

I left industry about a year ago because i was tired of crystal reports and db query writing. Now I'm in consulting doing crystal reports and db query writing. I sit in my driveway when I get home wondering if I should go inside or just hit the road and drive off a bridge so my wife and child can live off my life insurance for a few decades until she finds a husband that isn't a terrible husk of a human being with no purpose but to fix some reports that no one is going to see except some middle manager in the middle of nowhere. They probably won't even save the PDF after viewing.

finally, a thread for me.

:smith:

  • Locked thread