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.
 
  • Post
  • Reply
Blue Footed Booby
Oct 4, 2006

got those happy feet

nielsm posted:

Whatever you use for printing might very well have some kind of synchronisation to avoid multiple prints stepping over each other. Causing your threads to sort-of synchronise at your printing points.

One time working on a project in college I managed to get Visual Studio to throw a syntax error in the middle of a comment. I deleted the comment, and the error went away. Re-added the comment, error came back. Said "gently caress it" and got drunk. Don't remember what came of it.

Adbot
ADBOT LOVES YOU

pseudorandom name
May 6, 2007

Time for you to learn about trigraphs and digraphs!

bucketmouse
Aug 16, 2004

we con-trol the ho-ri-zon-tal
we con-trol the verrr-ti-cal

Blue Footed Booby posted:

One time working on a project in college I managed to get Visual Studio to throw a syntax error in the middle of a comment. I deleted the comment, and the error went away. Re-added the comment, error came back. Said "gently caress it" and got drunk. Don't remember what came of it.

You had some antivirus or something running and it hosed with the modification dates on your project's idb files. VS loves to do stupid crap like this. The project I'm working on currently has a weird postbuild step that makes vs flip the gently caress out and randomly not rebuild files unless the output produced by the postbuild is missing entirely.

omeg
Sep 3, 2012

About debug print: maybe if you don't print the compiler optimizes out some variables/expressions?

Golbez
Oct 9, 2002

1 2 3!
If you want to take a shot at me get in line, line
1 2 3!
Baby, I've had all my shots and I'm fine
At my job we call this Heisenberg-compliant. The code works when not being observed, but when observed it breaks. You can never see it and have it work at the same time.

Tesseraction
Apr 5, 2009

It's already been called a 'Heisenbug' for about 28 years, I'm afraid.

xtal
Jan 9, 2011

by Fluffdaddy

Tesseraction posted:

It's already been called a 'Heisenbug' for about 28 years, I'm afraid.

That's the opposite of what he described!

Volmarias
Dec 31, 2002

EMAIL... THE INTERNET... SEARCH ENGINES...

1337JiveTurkey posted:

var ┻━┻ = new WhateverException()
(╯°□°)╯︵ ┻━┻

Please tell me that this is a thing that can actually be some in some language.

tef
May 30, 2004

-> some l-system crap ->

Volmarias posted:

Please tell me that this is a thing that can actually be some in some language.

java script:

quote:

゚ω゚ノ= /`m´)ノ ~┻━┻ //*´∇`*/ ['_']; o=(゚ー゚) =_=3; c=(゚Θ゚) =(゚ー゚)-(゚ー゚); (゚Д゚) =(゚Θ゚)= (o^_^o)/ (o^_^o);(゚Д゚)={゚Θ゚: '_' ,゚ω゚ノ : ((゚ω゚ノ==3) +'_') [゚Θ゚] ,゚ー゚ノ :(゚ω゚ノ+ '_')[o^_^o -(゚Θ゚)] ,゚Д゚ノ:((゚ー゚==3) +'_')[゚ー゚] }; (゚Д゚) [゚Θ゚] =((゚ω゚ノ==3) +'_') [c^_^o];(゚Д゚) ['c'] = ((゚Д゚)+'_') [ (゚ー゚)+(゚ー゚)-(゚Θ゚) ];(゚Д゚) ['o'] = ((゚Д゚)+'_') [゚Θ゚];(゚o゚)=(゚Д゚) ['c']+(゚Д゚) ['o']+(゚ω゚ノ +'_')[゚Θ゚]+ ((゚ω゚ノ==3) +'_') [゚ー゚] + ((゚Д゚) +'_') [(゚ー゚)+(゚ー゚)]+ ((゚ー゚==3) +'_') [゚Θ゚]+((゚ー゚==3) +'_') [(゚ー゚) - (゚Θ゚)]+(゚Д゚) ['c']+((゚Д゚)+'_') [(゚ー゚)+(゚ー゚)]+ (゚Д゚) ['o']+((゚ー゚==3) +'_') [゚Θ゚];(゚Д゚) ['_'] =(o^_^o) [゚o゚] [゚o゚];(゚ε゚)=((゚ー゚==3) +'_') [゚Θ゚]+ (゚Д゚) .゚Д゚ノ+((゚Д゚)+'_') [(゚ー゚) + (゚ー゚)]+((゚ー゚==3) +'_') [o^_^o -゚Θ゚]+((゚ー゚==3) +'_') [゚Θ゚]+ (゚ω゚ノ +'_') [゚Θ゚]; (゚ー゚)+=(゚Θ゚); (゚Д゚)[゚ε゚]='\\'; (゚Д゚).゚Θ゚ノ=(゚Д゚+ ゚ー゚)[o^_^o -(゚Θ゚)];(o゚ー゚o)=(゚ω゚ノ +'_')[c^_^o];(゚Д゚) [゚o゚]='\"';(゚Д゚) ['_'] ( (゚Д゚) ['_'] (゚ε゚+(゚Д゚)[゚o゚]+ (゚Д゚)[゚ε゚]+(゚Θ゚)+ (゚ー゚)+ (゚Θ゚)+ (゚Д゚)[゚ε゚]+(゚Θ゚)+ ((゚ー゚) + (゚Θ゚))+ (゚ー゚)+ (゚Д゚)[゚ε゚]+(゚Θ゚)+ (゚ー゚)+ ((゚ー゚) + (゚Θ゚))+ (゚Д゚)[゚ε゚]+(゚Θ゚)+ ((o^_^o) +(o^_^o))+ ((o^_^o) - (゚Θ゚))+ (゚Д゚)[゚ε゚]+(゚Θ゚)+ ((o^_^o) +(o^_^o))+ (゚ー゚)+ (゚Д゚)[゚ε゚]+((゚ー゚) + (゚Θ゚))+ (c^_^o)+ (゚Д゚)[゚ε゚]+(゚ー゚)+ ((o^_^o) - (゚Θ゚))+ (゚Д゚)[゚ε゚]+(゚Θ゚)+ (゚ー゚)+ ((o^_^o) - (゚Θ゚))+ (゚Д゚)[゚ε゚]+(゚Θ゚)+ ((o^_^o) +(o^_^o))+ ((゚ー゚) + (゚Θ゚))+ (゚Д゚)[゚ε゚]+(゚Θ゚)+ ((o^_^o) +(o^_^o))+ (゚ー゚)+ (゚Д゚)[゚ε゚]+(゚Θ゚)+ ((o^_^o) +(o^_^o))+ (゚ー゚)+ (゚Д゚)[゚ε゚]+(゚Θ゚)+ ((o^_^o) +(o^_^o))+ (o^_^o)+ (゚Д゚)[゚ε゚]+(゚ー゚)+ ((o^_^o) - (゚Θ゚))+ (゚Д゚)[゚ε゚]+((゚ー゚) + (゚Θ゚))+ (゚Θ゚)+ (゚Д゚)[゚o゚]) (゚Θ゚)) ('_');

Bongo Bill
Jan 17, 2012

Somebody was asking me about whether there was a way to define constants in Javascript. God help me, there is. This is the example I ended up giving them, along with a warning not to do it:

code:
(function(){
    var _g_ = Function('return this')();
    Object.defineProperty(_g_, 'DEFCONST', {value: function(name, val){
            Object.defineProperty(_g_, name, {value: val});
        }});
})();

DEFCONST('MY_CONST', 42);
MY_CONST = 5; // does nothing
alert(MY_CONST); // 42

Zombywuf
Mar 29, 2008

Threaded code bug update, it now appears to depend on day of the week.

qntm
Jun 17, 2009

Zombywuf posted:

Threaded code bug update, it now appears to depend on day of the week.

We had a test case once which only ever failed on Sundays.

qntm fucked around with this message at 15:13 on Aug 12, 2013

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe

Zombywuf posted:

Threaded code bug update, it now appears to depend on day of the week.

OpenOffice Cannot Print on Tuesdays

NtotheTC
Dec 31, 2007


Zombywuf posted:

Threaded code bug update, it now appears to depend on day of the week.

I recommend reading though TheDailyWtf until you find the made up story that mirrors this problem, then work backwards from there.

Zombywuf
Mar 29, 2008

NtotheTC posted:

I recommend reading though TheDailyWtf until you find the made up story that mirrors this problem, then work backwards from there.

There is nothing that mirrors this problem, nothing I tell you.

I am currently suspecting the issue to be competing timeouts, that when one is hit that something waiting on the other timeout was not expecting causes the first to be ignored leading to the controlling thread to issue requests to an essentially defunct thread that is waiting to be told to exit due to the first timeout being hit. Various attempted remedies to this leading to cross thread calls being made to non-existent threads leading to segfaults (which are entirely timing dependant, somehow).

Currently waiting on a timeout to be hit so I can check my latest debug logging.

No Safe Word
Feb 26, 2005

Suspicious Dish posted:

OpenOffice Cannot Print on Tuesdays

I had somehow not heard of this one, nice


e: hah, wrong tab/window to ctrl+l, ctrl+c from

No Safe Word fucked around with this message at 22:57 on Aug 12, 2013

Malloc Voidstar
May 7, 2007

Fuck the cowboys. Unf. Fuck em hard.

That is not the link you meant to post.

carry on then
Jul 10, 2010

by VideoGames

(and can't post for 10 years!)

Nah it seems legit.

Click here to send a reply to this user.

Amarkov
Jun 21, 2010
So I changed one of the unit tests to be a bit more thorough; specifically, testing rectangular matrices instead of just square ones. Then the application broke. It turns out that we're using the unit tests to populate the main database.

It's not like the original designers didn't know a better way to do that, because they use an autoloaded XML file to populate the MySQL database...

Good Will Hrunting
Oct 8, 2012

I changed my mind.
I'm not sorry.
So uh, I just started on my first "real world assignment", a WPF application, and none of the classes, methods, XAML files or anything in the project have any comments or documentation whatsoever. There is no meta information explaining the structure of the application either. I've never worked with MVVM before so being thrown into this is rather disconcerting. Is this.. normal..?

Plorkyeran
Mar 22, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed
yes

Wheany
Mar 17, 2006

Spinyahahahahahahahahahahahaha!

Doctor Rope

Good Will Hrunting posted:

So uh, I just started on my first "real world assignment", a WPF application, and none of the classes, methods, XAML files or anything in the project have any comments or documentation whatsoever. There is no meta information explaining the structure of the application either. I've never worked with MVVM before so being thrown into this is rather disconcerting. Is this.. normal..?

Nobody writes comments.
If they do, they're unhelpful.
If they're helpful, they're out-of-date.

Also: Nobody writes commit messages.

Impotence
Nov 8, 2010
Lipstick Apathy

Wheany posted:

Nobody writes comments.
If they do, they're unhelpful.
If they're helpful, they're out-of-date.

Also: Nobody writes commit messages.

Sure they do.

r394 -
r393 oqpkczg
r392 asdf
r391 fix
r390 a
r389 a
r388 stuff
...
r2 stuff
r1 initial commit


The alternative being: Copy of index.php2copy of index.php.bak.index.php2.bak (2)
Edit: .old

Impotence fucked around with this message at 21:47 on Aug 13, 2013

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
I love working in open source.

1337JiveTurkey
Feb 17, 2005

Good Will Hrunting posted:

So uh, I just started on my first "real world assignment", a WPF application, and none of the classes, methods, XAML files or anything in the project have any comments or documentation whatsoever. There is no meta information explaining the structure of the application either. I've never worked with MVVM before so being thrown into this is rather disconcerting. Is this.. normal..?

If there's no documentation then there's no documentation to be incorrect. To get the real experience, the professor should have one group write a program that sends data to another group then have the other group read the data. Overall score between the two groups is based on correctness, then distributed based on the relative quality of their recriminations.

Zombywuf
Mar 29, 2008

Good Will Hrunting posted:

So uh, I just started on my first "real world assignment", a WPF application, and none of the classes, methods, XAML files or anything in the project have any comments or documentation whatsoever. There is no meta information explaining the structure of the application either. I've never worked with MVVM before so being thrown into this is rather disconcerting. Is this.. normal..?

The sooner you come to terms with it the less it will hurt. Welcome to the next 40 years of your life.

evensevenone
May 12, 2001
Glass is a solid.

Biowarfare posted:

Sure they do.

r394 -
r393 oqpkczg
r392 asdf
r391 fix
r390 a
r389 a
r388 stuff
...
r2 stuff
r1 initial commit


The alternative being: Copy of index.php2copy of index.php.bak.index.php2.bak (2)
Edit: .old

(Not mine)
code:

alias git-yolo='git commit -am "`curl -s [url]http://whatthecommit.com/index.txt[/url]`"'

New Yorp New Yorp
Jul 18, 2003

Only in Kenya.
Pillbug

Good Will Hrunting posted:

So uh, I just started on my first "real world assignment", a WPF application, and none of the classes, methods, XAML files or anything in the project have any comments or documentation whatsoever. There is no meta information explaining the structure of the application either. I've never worked with MVVM before so being thrown into this is rather disconcerting. Is this.. normal..?

I firmly believe that well-written code is self-documenting. That goes double if you have good unit tests that are grouped around expected behavior.

XML documentation is another thing; I make sure to always have that in-place and up-to-date, especially if I'm creating any sort of public API.

I'll write comments if I'm doing something absolutely horrible-but-necessary or counter-intuitive, just so someone who comes after me doesn't go "why the gently caress did he do that? I'm going to rewrite it in the more intuitive way..."

Che Delilas
Nov 23, 2009
FREE TIBET WEED

Good Will Hrunting posted:

So uh, I just started on my first "real world assignment", a WPF application, and none of the classes, methods, XAML files or anything in the project have any comments or documentation whatsoever. There is no meta information explaining the structure of the application either. I've never worked with MVVM before so being thrown into this is rather disconcerting. Is this.. normal..?

If you've never worked with any MVC-like pattern before, MVVM is a bit of a hill to climb, yeah. Are you even sure it uses MVVM? It's entirely possible to write WPF programs without employing that pattern.

Ithaqua posted:

I firmly believe that well-written code is self-documenting. That goes double if you have good unit tests that are grouped around expected behavior.

I like including triple-slash comments on all my functions at minimum, just to get them into intellisense.

Good Will Hrunting
Oct 8, 2012

I changed my mind.
I'm not sorry.

Che Delilas posted:

If you've never worked with any MVC-like pattern before, MVVM is a bit of a hill to climb, yeah. Are you even sure it uses MVVM? It's entirely possible to write WPF programs without employing that pattern.

Truthfully I don't know if it's proper MVVM. This is my first job out of school, and I haven't touched anything MVC-like.

The code is self-documenting enough for me to follow it. I'm not struggling to get things done, I was just surprised at the lack of any documentation on a project of this scope. Like I said, this is my first experience. The only other project I've worked on was an in-house prototype, which actually had stellar documentation (likely because it was being handed between people).

New Yorp New Yorp
Jul 18, 2003

Only in Kenya.
Pillbug

Good Will Hrunting posted:

Truthfully I don't know if it's proper MVVM. This is my first job out of school, and I haven't touched anything MVC-like.

The code is self-documenting enough for me to follow it. I'm not struggling to get things done, I was just surprised at the lack of any documentation on a project of this scope. Like I said, this is my first experience. The only other project I've worked on was an in-house prototype, which actually had stellar documentation (likely because it was being handed between people).

How much code is present in event handlers in the views? If the answer is "none" or "almost none", it's following MVVM properly. If the answer is "tons", it's not MVVM and you're in for a world of pain.

Volmarias
Dec 31, 2002

EMAIL... THE INTERNET... SEARCH ENGINES...

Ithaqua posted:

I firmly believe that well-written code is self-documenting. That goes double if you have good unit tests that are grouped around expected behavior.

Which, while nice and to some extent true, doesn't excuse you from actually writing documentation. One step above well written code that I can examine is well documented code that I don't actually have to physically examine to understand.

New Yorp New Yorp
Jul 18, 2003

Only in Kenya.
Pillbug

Volmarias posted:

Which, while nice and to some extent true, doesn't excuse you from actually writing documentation. One step above well written code that I can examine is well documented code that I don't actually have to physically examine to understand.

Documentation of a software product and/or API is a different story.

Volmarias
Dec 31, 2002

EMAIL... THE INTERNET... SEARCH ENGINES...

Ithaqua posted:

Documentation of a software product and/or API is a different story.

Ask me about the "self documenting" spaghetti code that my coworker has written that needs to be maintained. I dare you.

Plorkyeran
Mar 22, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed
If he did try to document it then you'd probably just be complaining about his incoherent and incorrect documentation instead.

MrMoo
Sep 14, 2000

If they can't write coherent code I cannot imagine coherent documentation. Maybe if he writes the documentation though a light bulb might flicker and the lack of a plan is noticed.

Crosscontaminant
Jan 18, 2007

Ithaqua posted:

I firmly believe that well-written code is self-documenting. That goes double if you have good unit tests that are grouped around expected behavior.
I agree, but I find the problem is that when you're actively working on the code and have the whole thing in your head, you can't tell the difference between "self-documenting" and "obvious to you and you alone".

Volte
Oct 4, 2004

woosh woosh
Self-documenting code can only ever cover the what, it can never cover the why. That said, I prefer a well written external document explaining the rationale behind the code to having to sift through tons of comments strewn everywhere (particularly massive headers that are bigger than the function itself). Plus when the documentation is external and tied to a particular version of the code, there's less of a mindfuck when you realize that the comments are out of date and don't spend 20 minutes trying to reconcile what the documentation says versus what the code actually does.

New Yorp New Yorp
Jul 18, 2003

Only in Kenya.
Pillbug

Volte posted:

Self-documenting code can only ever cover the what, it can never cover the why.

The "why" is (ideally) part of the commit message in source control. I've smacked devs upside the head (metaphorically speaking) for committing a changeset with a description like "removed the foo". Yes, I can look at a diff of the code and see that you removed the foo. Why did you remove the foo?

Crosscontaminant posted:

I agree, but I find the problem is that when you're actively working on the code and have the whole thing in your head, you can't tell the difference between "self-documenting" and "obvious to you and you alone".

That's why I'm a strong proponent of giving my unit tests good, descriptive names. You can look at my unit tests and get a sense of what my program is supposed to be doing. And since my tests pass, run in isolation, and only test a single thing, they confirm that the behavior is implemented as written.

For example (in C#, mentally transliterate to your language and testing framework of choice)

C# code:
[TestClass]
public class When_Frobulating_A_Foo
{
	[TestMethod]
	public void Frobulation_Should_Return_A_Bar_When_Frobulation_Succeeds() {}
	[TestMethod]
	public void Frobulation_Should_Fire_A_Frobulation_Suceeded_Event_When_Successful() {}
	[TestMethod]
	public void Frobulation_Should_Throw_An_Exception_When_Frobulation_Fails() {}
	// etc
}

New Yorp New Yorp fucked around with this message at 04:08 on Aug 14, 2013

Adbot
ADBOT LOVES YOU

Rocko Bonaparte
Mar 12, 2002

Every day is Friday!
I've come to the conclusion that having a good logging framework and logging statements to go with them also helps in explaining what is going on. It still doesn't explain why it's being done the way it is, but it does a marginal job of throwing some human language into the picture. OTOH I'm dealing with people that don't even want to declare classes in Python because that takes more keystrokes, so it's a losing battle.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply