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
Notorious b.s.d.
Jan 25, 2003

by Reene
c and unix were basically designed as toys for cool dudes to fart around with. losethos or processing for beardy 1960s att employees. they didn't have focus groups or a budget or anything you know?

they imagined that having the type declarations resemble the way that each type was used in code would make it easier to learn, and ease of learning was pretty important for a toy platform.

Adbot
ADBOT LOVES YOU

Bloody
Mar 3, 2013

Innocent Bystander posted:

Lets be honest, nobody has

i write c on most days

gonadic io
Feb 16, 2011

>>=
it's time for the most noble of programmer traditions: pepper my code with trace statements and hope some obvious incongruity shows itself

coffeetable
Feb 5, 2006

TELL ME AGAIN HOW GREAT BRITAIN WOULD BE IF IT WAS RULED BY THE MERCILESS JACKBOOT OF PRINCE CHARLES

YES I DO TALK TO PLANTS ACTUALLY

AlsoD posted:

it's time for the most noble of programmer traditions: pepper my code with trace statements and hope some obvious incongruity shows itself

amen

all my work today has been writing data visualization code so i can work out where this thing is going off the rails

power botton
Nov 2, 2011

get hired by the NY times and write d3 for a living

FamDav
Mar 29, 2008

coffeetable posted:

amen

all my work today has been writing data visualization code so i can work out where this thing is going off the rails

this is actually cool and we built something at old work to visualize searches to see when it was making GBS threads the bed.

it was really cool when you could see it broke and just defaulted to a bfs. pretty patterns dawg.

MononcQc
May 29, 2007

Print statement debugging has been my bread and butter of debugging. Languages that allow tracing make that easier. When all else fails, I get a piece of paper and pencils and I think really hard.

prefect
Sep 11, 2001

No one, Woodhouse.
No one.




Dead Man’s Band

MononcQc posted:

Print statement debugging has been my bread and butter of debugging.

you have no idea how great it is to hear a Real Programmer say this. makes me feel (slightly) less terrible :allears:

prefect
Sep 11, 2001

No one, Woodhouse.
No one.




Dead Man’s Band
i am annoyed that java's string.replace doesn't take a regular expression

(replaceall and replacefirst do, but i am still annoyed)

EAT THE EGGS RICOLA
May 29, 2008

d3 owns do more things with d3

BONGHITZ
Jan 1, 1970

i thought they were removing the real money auction house in d3, is it still possible to make a living off of it?

Dr Monkeysee
Oct 11, 2002

just a fox like a hundred thousand others
Nap Ghost

Dessert Rose posted:

you may already know this but [given the thread we're in] that is actually legal c, it just won't result in what you think it will, which is why *p1 is the "standard"

if you write "int* p1, p2" p1 is an int* and p2 is an int

the real problem is declaring multiple variables on one line :barf:

i think the general idea is "int *foo" is the c convention (because c emphasizes use of values over types) and "int* foo" is the c++ convention (because c++ is all about the manipulation of types)

at least insofar as there are any consistent conventions in the c/c++ world (there aren't)

Dessert Rose
May 17, 2004

awoken in control of a lucid deep dream...

MononcQc posted:

Print statement debugging has been my bread and butter of debugging. Languages that allow tracing make that easier. When all else fails, I get a piece of paper and pencils and I think really hard.

personally i really like slime trail debugging but recently i have been trying to get into command line debuggers more.

last night i spent a couple hours working out how to disassemble a CLR method, find the actual x86 instruction for a branch decision, and rewrite the register it was testing at the proper moment to force a rarely-taken branch to execute. all from windbg

sure you can just do that with the vs debugger. good luck convincing a server admin to let you copy even the stripped-down debugger-only version to a server. even given that, copying 2gb+ over an rdp connection is lol.

meanwhile a single folder with windbg & all my extensions easily copies over

as a couple of bonuses, i look like a freaking wizard whenever i use it, and i can even debug programs i don't have the source for - this thing is crashing with an exception but isn't telling me all the details, what's causing it? oh i'll just load this up and examine the stack at this point and tada it's doing some stupid thing with the file name

it's a pain to learn but suuuuuper useful

Dessert Rose
May 17, 2004

awoken in control of a lucid deep dream...
like it's really hard to do slime trail stuff when you don't have a console, for example with a service

Malcolm XML
Aug 8, 2009

I always knew it would end like this.

Dessert Rose posted:

like it's really hard to do slime trail stuff when you don't have a console, for example with a service

trace logs

logs logs logs

auto alerts on logs



logs are the best

of course all my programs have been proven correct and

Posting Principle
Dec 10, 2011

by Ralp
is there a way to configure lager to email me on certain log levels, because that would be rad as hell and i would like it very much

Posting Principle
Dec 10, 2011

by Ralp
basically i want logbacks smtpappender in erlang

Shaggar
Apr 26, 2006
write something to send log events from earlang to a central java logger

MononcQc
May 29, 2007

Posting Principle posted:

is there a way to configure lager to email me on certain log levels, because that would be rad as hell and i would like it very much

Probably would have to make a custom error handler and using something like gen_smtp to make it work. I don't know of any known library to do it directly otherwise off the top of my head.

Shaggar
Apr 26, 2006
and/or stop using earlang.

Posting Principle
Dec 10, 2011

by Ralp

MononcQc posted:

Probably would have to make a custom error handler and using something like gen_smtp to make it work. I don't know of any known library to do it directly otherwise off the top of my head.

well its an excuse to finally write more erlang so i'll look into gen_smtp, ty!

Posting Principle
Dec 10, 2011

by Ralp

Shaggar posted:

and/or stop using earlang.

i like erlang, shaggar.

MeruFM
Jul 27, 2010
i suggest switching to javascript.

stoutfish
Oct 8, 2012

by zen death robot
visual basic

Deacon of Delicious
Aug 20, 2007

I bet the twist ending is Dracula's dick-babies
so is slime trail debugging where you have a message print whenever the program leaves/enters a function so you can see where it's going

Dessert Rose
May 17, 2004

awoken in control of a lucid deep dream...

Deacon of Delicious posted:

so is slime trail debugging where you have a message print whenever the program leaves/enters a function so you can see where it's going

yes, though it doesn't specifically have to be on enter/leave, you can of course also trace within the function

qntm
Jun 17, 2009

EAT THE EGGS RICOLA posted:

d3 owns do more things with d3

d3 owns once you're past the brick wall of a learning curve

Deacon of Delicious
Aug 20, 2007

I bet the twist ending is Dracula's dick-babies

Dessert Rose posted:

yes, though it doesn't specifically have to be on enter/leave, you can of course also trace within the function

oh i guess i do that then. mostly because i haven't bothered to learn other ways yet. but it's p handy

power botton
Nov 2, 2011

qntm posted:

d3 owns once you're past the brick wall of a learning curve

but my god once you're past i can't imagine writing charts or pictures anyway else

i feel like those lisp weenies who literally can't understand why people use any other language

its the best

Nomnom Cookie
Aug 30, 2009



java owns log all stack traces attach all jdwps

Morkai
May 2, 2004

aaag babbys
java is just the poor man's c#

Morkai
May 2, 2004

aaag babbys
rule 36 bitch

Dessert Rose
May 17, 2004

awoken in control of a lucid deep dream...

Morkai posted:

rule 36 bitch

jesus christ this is so far from the intent of r36 it has a completely different country code

Bloody
Mar 3, 2013

i like output pin toggle based debugging

especially in fpgas because you're just like 'huh i wonder what this retarded internal bus is doing' and then you just dump it to all of your gpios and sperg out with a logic analyzer and

Forums Terrorist
Dec 8, 2011

Dessert Rose posted:

jesus christ this is so far from the intent of r36 it has a completely different country code

there is a good reason that swsp got rid of it, shame about the other rules that were collateral damage

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder
i think im going to make a module for something that tweets out your print statements

Posting Principle
Dec 10, 2011

by Ralp

USSMICHELLEBACHMAN posted:

i think im going to make a module for something that tweets out your print statements

i bet you could write a logback appender or lager backend that did this it would be really cool

coffeetable
Feb 5, 2006

TELL ME AGAIN HOW GREAT BRITAIN WOULD BE IF IT WAS RULED BY THE MERCILESS JACKBOOT OF PRINCE CHARLES

YES I DO TALK TO PLANTS ACTUALLY

USSMICHELLEBACHMAN posted:

i think im going to make a module for something that tweets out your print statements

@shitmycodesays

Shaggar
Apr 26, 2006
Add twitter lib from maven
add logback-core from maven
extend appenderbase that posts 2 twitter and reads login deets from logback.xml

java is too easy.

Adbot
ADBOT LOVES YOU

tef
May 30, 2004

-> some l-system crap ->

MononcQc posted:

Print statement debugging has been my bread and butter of debugging. Languages that allow tracing make that easier. When all else fails, I get a piece of paper and pencils and I think really hard.

It's hard to run debuggers in production systems, especially after they've crashed. I found that many of my debug statements were worth keeping after the bug was found. Logging is lovely.

  • Locked thread