12:17 AM
@MichaelT I found this to be a great way to make reasoning about untyped lambda calculus equally difficult as well as pointlessly involving eggs and alligators.

1 hour later…
1:24 AM
@MichaelT Yeah, you or someone linked that to me when I was in a rant a while back about SKI, maybe it was @psr
@psr Truth. Perhaps if I didn't already know untyped lambda calculus, or was a kid, it would have been less strange. It's still totally awesome, just not helpful.
I'm trying to figure out what combinators they are... actually is it more an example of typed lambda-mu calculus where the colors are types? The only logical definition I see for them is the identity combinator, but typing causes a break in recursion
the exit case as it were
something like T I T x = U x, and T I U x = U x
where T is a type and U is a type coming from the colors

1:43 AM
@JimmyHoffa I came up with another question: Which do you think is better? Type X or Type Y management?

@WorldEngineer A) I had to wikipedia that, and likely anyone you asked it in that way would have to B) the answer you want to hear is obvious, so that's what you'll get told

@JimmyHoffa true

9 hours later…
10:53 AM
review asked me to review this: programmers.stackexchange.com/review/first-posts/28155 first post. It would help to be able to read the question, but says: "question not found". How can he answer a question that does not exist? (Maybe this was one of the "test" questions, since on the review pages it said 1 first post to review and there were actually two of them)

2 hours later…
12:34 PM
@thorstenmüller It IS a test question - I just did an action on it and I passed ;-)

@MadKeithV you should have failed for doing something on an answer without even knowing the question ;)

@thorstenmüller Oh but I'm psychic. And sometimes you don't need the question to know the value of the answer (which is obviously 42).

1 hour later…
1:42 PM
Thought I would ask here before making a question about it... Why does Java have to use try...catch whenever converting a string to an integer? Maybe I'm mistaken, but this seems kind of unique to Java

Integer.parseInt("one") -- what should it do?
its returning a primitive value - not an object.

Is it not feasible to provide a version of int/etc. conversion that doesn't require an exception? Something where you could specify a default value, or an out parameter like C# does?
I understand Java can't pass primitives by reference, but I suppose I assumed internally it could

@Bob you could use an Integer (the object) instead and pass back a null, however that means that you will have some more complex code to check that you got a null back and handle that correctly.

^^^ @thorstenmüller, @MadKeithV - now you can know what you shouldn't have been voting on. link:

1:59 PM
Consider the flow of the code - try { int foo = Integer.parseInt(str); stuff with foo; } catch (NumberFormatException e) { ... } ---- vs Integer foo = Integer.parseInt(str); if (foo == null) { stuff with foo; } else { ... }
I would tend to say I prefer the first, with the exception handling than having "special case" code all over and letting it go through fine.

@MichaelT better yet, don't catch the exception; if you require the value to move forward, you can't do anything more anyway, let whoever called you deal with the fact that they are in a bad state

Consider also the case of parseInt("99", 8), or parseInt("2147483648"); ?
or parseInt("30.0")?

@MichaelT where did you pull the entire max int right out of your head?
I just remember max int as 2.14 billion

ah ok, so not out of your head. Was going to say...

2:08 PM
It would be trivial for someone to write a IntegerHelper.parseInt(String) that swallows the exception and returns a null... but don't take the power of the exception away from those who want it (and want to let it propagate up the call stack if that is what is appropriate).
So, rep back from the downvote delete don't circumvent the cap if in the same day, but do circumvent the rep cap if on a different day. Therefore, do all downvotes at the end of the day.
(whine about hitting the rep cap before getting into work... whine about hot questions and inflated rep for gnat)

Fair enough, but in my experience over-design is a common problem (and the OP seems worried about whether this is over-design). — dan1111 9 hours ago

@MichaelT - how do you create a bookmark from multiple chat items? And can I be selective? I want to pull Thorsten's and MadKeithV's comments regarding the odd review item

more "Don't design the solution, just do the solution, it's simpler that way and everybody knows KISS is the best!"

@GlenH7 Select the first, and then the last.

I hate that soooo many people think KISS means your job should be simple, not understanding it actually means the code should be simple, and it is no simple job to make that so

2:14 PM
@MichaelT Well that makes sense; I suppose practically speaking there's no real impact. I think I'm weirded out by the idea of using an exception to handle user/external input, the flow seems wrong somehow.

> perfection has been reached not when there is nothing left to add, but when there is nothing left to take away.

@MichaelT yes, or in common parlance "Perfection has been reached, when it was easy for me to do, and I didn't try to add or take anything away so I guess nothing else could have been taken away"
@GlenH7 looks like the bookmarks are based on a simple data model of start/end points rather than a collection, so... heap!

@MichaelT - thanks; @JimmyHoffa - simple is better than nothing! Unfortunately, I'm dumb and can't even figure out how to select chats.

Just don't do a y-combinator.
(that is neat)

### Part 1

3 hours ago, 1 hour 41 minutes total – 2 messages, 2 users, 0 stars

Bookmarked 43 secs ago by Jimmy Hoffa

### Part 2

2 hours ago, 1 minute total – 2 messages, 2 users, 1 star

Bookmarked 16 secs ago by Jimmy Hoffa

### Whole

23 secs ago, 4 seconds total – 2 messages, 1 user, 0 stars

Bookmarked 4 secs ago by Jimmy Hoffa

I win

2:20 PM
@JimmyHoffa - clearly. I relinquish the never-grasped guru head piece.

I wonder if you could use font colors and find a unicode aligator and egg...
2

Technically that's not really a heap anyway... what do you call a list of nodes with a list of nodes where node counts vary? N-Tree?

@thorstenmüller @thorstenmüller - I asked on Meta and ChrisF confirmed that was "working as expected" behavior since it was an audit review question.

Well, the current design is a "start and end and room" which leads to a very simple query. To do a collection would require one row per message... which could be prohibitive in large saved conversations.

2:26 PM
bananas, @JimmyHoffa, bananas. Not cutesy little musical notes.

@GlenH7 according to my study of charmap, verdana is decidedly lacking.
or charmap is.
Oh, this is arial. CSS, I will never understand you...

2:46 PM
The joys of living in a area where football is important... so far, the past hour of office conversation has been about the NFL draft (and making fun of Vikings picks... this is a Packer town).

@MichaelT In pittsburgh where I worked we had a dress code of slacks + button down shirts, but steelers jerseys were allowed any time, and that was the norm everywhere there. Beginning of the season they would have a meeting where people brought in tapes of old games where everyone would sit in a meeting room and watch the 70's steelers together and such..
football is religion there...
@MichaelT Are you a fan who enjoys it, or like me peering quizzically at them all wondering why they care so much?

I understand it, I'm just amused... I'm not a huge fan to the point of debating the relative merit of picks.

yesterday, by maple_shaft
I should start a tongue in cheek blog where I write about my thought processes in writing terrible code. I will be the Stephen Colbert of programming
@maple_shaft I sincerely think you should pursue this.

I agree. I'm wondering though if it should be called out its satirical, or not...
Btw, ever look at the polygot in the 404 page on SO?
137

Want a step-by-step through it? I'm the original author of the polyglot. The easy versions are Python, Perl, and Ruby: the only code executed is print(202*2);exit(); because they all treat # as a line-comment. Obviously, the code prints "404" and exits the program. The C code is fairly ...

@maple_shaft "The senior rejected my code in review again, he doesn't want me to return a plain object from my function, and have multiple returns that have multiple object types with no relationship between them... I guess I'll return a string, and write a function that converts that string into the correct object type, hopefully the senior doesn't notice that one returns a plain object..."
@MichaelT I never read it too closely, the term polyglot with it's meaning as combined types of code is a meaning I only heard recently.. previously I always thought it just referred to someone who could code effectively in many languages, not all at once

3:03 PM
It can be both... person, or the code itself.
I like how he got befunge in there too.

@MichaelT I consider myself a polyglot programmer; but I don't know how to write multiple languages in one code file, and I would definitely never try.. it's the all-at-once part that catches me off guard about that definition
befunge? the >+++ stuff is brainfuck isn't it?

Yep. Befunge 'starts' with the "v" on line 1.
A RNG in befunge:
```v>>>>.
12345
^?^
> ? ?^
v?v
v6789>```
It starts up in the upper left, moving right, the 'v' sends the program "counter" down, until it hits the ">"

That sends it to the right, which hits the "?" which will send it in a random direction.

So the ++++++.-----.+++++ stuff is probably befunge correcting the stack from the changes the brainfuck made to it
since they share syntactic elements

3:07 PM
> Essentially, all the characters in define are pushed on the stack and never used. Then v points our instruction vector downwards. Then we push another e on the stack, which happens to be an ASCII value of 101. Push 4 on the stack, multiply, turn right, hit the . and print 404 to the screen. @ stops the program there.
So it could be simplified to 'e' from "define" (as 101), '4' from the brainfuck line, the '*' from the print line, change vector, '.' to print.

3:19 PM
Casting downvotes when having over the rep cap for the day will not restore the additional rep gained that exceeded the rep cap earlier in the day.

2 hours later…
5:00 PM
Expecting nvarchar behaviour and getting nchar behaviour is very confusing when you haven't seen someone use an nchar in years...

I could imagine... though I work in a place where there are many fixed length fields being passed around, so there are many char rather than varchar's in the database.

5:14 PM
@MichaelT this was made more confusing by the fact that it wasn't fixed-length data, somebody just accidentally made the columns fixed-length while the data is variable length so wondering why queries aren't working when they're missing all the trailing whitespace and where the trailing whitespace is coming from... Double that with the ORM was generated off that scheme and I forgot to update the ORM after updating the schema...

5:28 PM
Hey
Can somebody lock this question
There are like 3 duplicates

Why should it be locked?
It's not getting low quality answers that I can see.

@ThomasOwens actually the accepted answer is terrible, it was just fastest gun..
I'm going to delete my answer because it just adds to the noise and vote up delnan's, he knows what he's talking about..

@JimmyHoffa There's nothing that can be done about that, other than down voting it.

I'm half inclined the Q should be locked for further answers though. It did become a bit of a mud pit, plus it's a duplicate of other questions...
I should go find one of the dupes and close it as such, didn't think about that

5:45 PM
20

My programming friends are always telling me that HTML is a markup language and C++ is a programming language. When I ask them what's the difference, they never give me a reasonable answer. What could make one call C++ a programming language, and HTML not?

The question itself is a bit missleading. First I thought it starts a flamewar between compiled and interpreted languages.

@thorstenmüller If you thought that was a flamewar, I wonder what your thoughts are on this one:
-1

My question has two parts... Are there any Christian countries, who would issue a Visa for Jesus if He were alive today Are there any non Christian countries, who would issue a Visa for Jesus if He were alive today I find it quite ironic you see, that the law and culture of many countries was ...

Programmers' rants and flamewars used to annoy me. Then, I started moderating Politics.
3

That is a truly hilarious Q

That's why I am not on any sites like this. Actually for the few moments when I wold like to have discussions I prefer Reddit.

Reddit is awesome, you can never tell where a discussion will take you.
in The Time Machine, Apr 18 at 5:34, by Yannis Rizos
@T.E.D. And I found it in a quite bizarre way. There was a post on Reddit about a beach in Greece, that somehow turned into a discussion about the debt crisis, that somehow evolved into three separate discussions: One about Greek politics, one about the current gun reform debate in the US and one about Greece's role in WW2. A comment in the last one mentioned WW2 Tweets. Reddit is extremely noisy, but sometimes you find hidden gems like that in the most unexpected places.

6:02 PM
@YannisRizos are you really going to wait for the community to dupe close that Q? It's too much of an "everyone's favorite topic to talk about" for that to happen anytime soon.. You should dupe close it mod style, plus it'll get you free rep to your old answer which is better than all the other ones on this new Q..
you got 2 flaggers to accompany your diamond in the message so you (unfortunately) won't look like a fun-hating nazi mod
@YannisRizos I editted your answer. Feel free to roll it back if it feels like I added a totally unnecessary and unrelated rant to your answer. Enjoy the bonus rep from the Q being bumped out of it's slumber from my edit either way.

@JimmyHoffa That... should have been a comment. It's a bit much for an edit.

@JimmyHoffa And he gave in and joined us as evil fun hating close voters.

@YannisRizos but as an edit I elevated it to full-on rant as opposed to just a grumble. I like my rants to be loud and bothersome.

@JimmyHoffa You need to use the "rant" tag at Meta then...

Q: I have something to say!
"This tag is awesome!"
[rant]

Nah, I'm nearing my trolling cap for the month, I think I'll hold that one for later..

Hmm... deleted user who posted just 4 days ago (a reasonable question). One wonders what prompted this.

@MichaelT Where?

7

I'd also want to know how can I draw them.

@YannisRizos @WorldEngineer mods, if I may ask about a flag of mine that was declined... ?
(since you two are here...)

@MichaelT Hm, that seems strange indeed. No idea what happened there.
@MichaelT Sure, which post was the flag on?

6:26 PM
-3

Worthless standard! All of the reasons given here are either historic, "that's the way we always did it", or user interface "because it fits my screen the way that I want". I use two monitors, no problem with fitting multiple windows on the screen. I use merge tools that show me exactly what h...

I flagged as "not an answer"
The question being...
164

Why is 80 characters the "standard" limit for code width? Why 80 and not 79, 81 or 100? What is the origin of this particular value?

What part of the question is it answering?

no idea from what I can tell but I didn't handle your flag

@MichaelT he didn't say it was answering that question, not an answer is "I hate purple!" a bad answer is "80 characters is 5 less than 85" an answer that doesn't answer the question is "Taco's are delicious due to their natural ecology"

@JimmyHoffa that's a good way of wording it

6:30 PM
The question is "why is it 80?" and "what is the origin?" -- the 'answer' is "I hate 80!" and "the only reason to use 80 today is..."
Neither of those pertain to the question being asked.

If the question was "why should I use 80 columns today", it would be an answer... a poor one. Though, as I see it, it doesn't answer the questions being asked at all and does not contribute to it. It isn't wrong or right, it just isn't an answer.

@MichaelT he's attempting to answer the question. Does his answer answer it? not at all really but the intent appears to be to answer. That's the best I can derive given that I didn't handle that flag.
it's like a high school kid getting up and giving a report about how the American Revolution was about "freedom and stuff". Does it answer why the revolution happened? no. Did he try to answer it? yes.

My interpretation is that is more a comment on the other "almost answers"
3

A related question is "why has 80 column persisted". Even the responses on this page are approximately that width. I agree with the historical reasons for 80 columns, but the question is why the standard has persisted. I would claim readability - for prose and code. Our minds can only absorb so m...

2

I personally stick to "about column 80" for my end of line because further than that causes wrapping or lost code when you print it. There's punch card legacy as well, but I don't think laser printers or 8.5x11 inch paper was set to conform to punch card limitations.

@WorldEngineer @MichaelT It's... borderline. Could go either way really.

6:40 PM
yeah
it's almost into "Frog Blast the Vent Core" Territory but not quite

If there's an attempt to answer the question somewhere in there, then it's probably this sentence:
> There is one reason, and one reason only, to limit your code to 80 columns, but the intent of the reason leads to a better metric of whether your code is too wide, and that is for readability of the code

@YannisRizos that sounds like a political soundbite

And that isn't asked by the question... and the AP (answer poster) states that he is aware of the historical reasons "All of the reasons given here are either historic..." -- which is what the question is asking

@MichaelT Well...
Hi Keith and welcome to Programmers. As you note in your opening paragraph, all the other answers give historical reasons for the 80 char limit. That's because that's what the question is asking: What are the historical origins of the standard. I'm afraid I'll have to remove your answer, although your observations are interesting, it's more of a side-discussion than an answer. — Yannis Rizos 9 secs ago

@YannisRizos Thank you. And I appreciative your diplomatic wording on there (maybe Politics.SE should be training to be a mod on any site... "mod here for a month before you get your diamond on the site you came from...")

6:53 PM
@MichaelT that's actually a great idea except that it would turn everyone away to the point that sites would find themselves very hard up to get moderators..

That's a transparent attempt to stack politics with your political cronies from Gardening and Landscaping.

@MichaelT It was a tricky one. I had to read it carefully (twice) to be absolutely certain it's not an answer, and... it wasn't a particularly enjoyable read. The OP is brand new, so I think I'll blame this one on forum-itis.

@YannisRizos I don't claim your job is easy, and it does take more care than I have with the 'just cast a downvote' - the lack of enjoyably factored into the downvote (though I've downvoted many answers in there that don't attempt to fully answer the question).

@JimmyHoffa I just got an upvote on that "is HTML a prog. lang" answer. Therefore your edit was a good one, and I won't rollback.

Hello. I would like to ask. Does anybody have an experience with working on several large projects? I'm at loss how to manage my time in order to be productive. Sorry if it is out of scope of this chat :)

7:01 PM
@MartyIX Chat doesn't have much of a 'scope'... so its a good one to ask here.
How many projects? how big? do you have a project manager? What process?

@MichaelT I'm working on my thesis and two work related projects. Projects are for several months of work.

So are these academic projects? or commercial ones?

Well, project manager.. we have bug tracker for project A and B. And I do know what needs to be done for my thesis.
The problem is rather if larger chunks of time are better or if it is better to switch between tasks after say 1 hour.
@MichaelT 2 commercial projects and thesis is an academic project
I tried Pomodoro technique (as it helps to work on tasks that are mundane for me)

The cannonical (given that this is a Joel related site) article on task switching - joelonsoftware.com/articles/fog0000000022.html

2

At my current company my programming position has recently changed. In the past it has been a technical/functional position where we choose the project to work on and followed it from blank IDE to teaching the end users how to use it. Now, my position is only programming with projects given to me...

7:06 PM
@MichaelT thank you!
@YannisRizos thanks

@MartyIX This one is relevant too, but I can't say I love the answers:
3

It is said that to work effectively we should focus and concentrate. But it is also true that to get more productive, one has to work a lot. So is it better to work on more than one project at a time to be more productive?

My take - go as far as you can with a big thing, and then if you get stuck switch and repeat.

@MichaelT I tried to do work on my thesis in the morning. Then I went jogging and afterwards I was working on projects A and B. The problem was that I was still thinking about A and B in the morning. Clearly my focus is not really good.
I've tried to think about all the problems and solutions (how would I write the code, how to program an algorithm, etc.) on paper (without access to a PC) and I've found it quite effective so far.
But still I just feel I'm not really in control of myself.

@MichaelT oh JoelOnSoftware encyclopedia, find me that article where joel starts off mentioning he just wasted an entire day or two, and sometimes that happens. Some days getting into the zone just can't occur

we really need to advertise Productivity.SE

7:15 PM
@MartyIX I am far from ideally organized myself... and so my advice may be... less than ideal. You might want to peruse productivity.stackexchange.com (not trying to chase you away form here, there are certainly others here who have better workflows than I do).
0

Sadly, about 30-50% of the Western world's food is thrown away. Personally, I waste about half of my food, due to poor fridge management. I forget what I have bought and find expired food located in the back of the fridge all the time. It's very annoying from a time perspective, as I have to wast...

@MartyIX getting things done is a skill earned from practice, seeing as you've been academic track for years, you likely just have little practice in the art of getting it done. Keep practicing and you'll get better.
@MichaelT "ideally organized" ?

I'm sure that applies to the office here too... can we migrate that to P.SE?

@MichaelT I would ask on the "productivity" chat but it is mostly empty. :)

The size of the chat is often related to the activity on the site, and smaller sites have even fewer in chat.

@JimmyHoffa You are right. Maybe it's just I try to come up with a great solution rather than finding a good one (with the perspective of improving it).

7:19 PM
@MartyIX Write the first version to throw away, also pick small simple requirements to start fulfilling, eat those little fingers on the elephants trunk, not the whole trunk or the whole elephant

@JimmyHoffa You are referring to "How do you eat an elephant? One bite at a time." (I've read it many times but I still don't know who is the author :)).

@MartyIX also learn to accept what works isn't perfect and never will be

Do not make "good" the enemy of "perfect"... or something like that.

You are right. I'll try to be more realistic.

A manager asked a programmer how long it would take him to finish the program on which he was working. ``It will be finished tomorrow,'' the programmer promptly replied.

``I think you are being unrealistic,'' said the manager, ``Truthfully, how long will it take?''

The programmer thought for a moment. ``I have some features that I wish to add. This will take at least two weeks,'' he finally said.

``Even that is too much to expect,'' insisted the manager, ``I will be satisfied if you simply tell me when the program is complete.''

7:22 PM
@MartyIX I've got the perfect solution, you have trouble getting things done? Use perl! I'm told getting things done is the only thing it's useful for...

From the Tao of Programming, Book 5, section 2. canonical.org/~kragen/tao-of-programming.html#book5

Plus perl never pushes you to make things perfect... just ask @MichaelT... ;)

haha
The programming languages are already chosen :) I can't change it but I'll keep it in mind for new projects :o)

Perl leads to a certain pragmatism in coding... though I've seen people try to prefect it.

@MartyIX I'm just trolling @MichaelT, ignore me

7:25 PM
oh, ok

@MartyIX Jimmy is a pure troll. He always gives the same output... and I'm trolling him there.

I don't always give the same outp--##

Coworker just got an error message from eclipse "cycle while computing" -- he's wondering if eclipse is telling him to go outside.

It is lunch time, that's not a half bad idea

7:32 PM
@MichaelT fire and motion, I remembered that one to be a detail regarding corporate strategy (which it is), but didn't remember at all that it was the one talking about not getting things done

@MartyIX In context, I'm a perl coder at heart and that leads to certain... pragmatism in my coding... Jimmy is a haskell coder at heart, and that leads to a certain "purity of thought and function".. which we kid each other about on a fairly regular basis.
And some day... err.. year, when perl 6 comes out, we'll be best of friends because our preferred languages run in the same virtual machine and can call each other all they want.

@MichaelT I appreciate the link regarding autotrephination, though didn't see where it related... On a side note, a friend of my wife's last name was Trepanier, I couldn't help but think Trephiner every time I saw her...

@JimmyHoffa further down in the page...
> I wasted a day of my life on that particular bug. But it's easily solved by a simple technology of shims or jump tables. Put on your thinking hat and you'll figure out how to make a linker that produces a single executable plus a jump-table that Microsoft can patch when they find a security hole. PS. Apple had this technology in the original Macintosh, 1984.

Ah
@MichaelT I didn't entirely understand his gripe there; .NET has a static linker, though maybe it came out later than I realize (I discovered it in '05, so it's not new..)

That article was written in early '04.

7:44 PM
Perhaps it was new when I found it then...

Or he was still working on something not the latest MS at the time.

@MichaelT and +1 from me too now.. if it was 99 I wouldn't have done it to give you the 100, but it just doesn't matter now..

The 'disappointing' thing to me on that answer is that it isn't my greatest answer... its a rather opinionated one that happens to have a snappy quote to it and the restatement of some truths. Though I won't begrudge the repwhore in me...
@JimmyHoffa And if you really wanted to help, you would have cast it after the fame falls off so it doesn't get lost in my rep cap ;-) ... though it still does contribute to the tag badges (I need more answers though)

haha, yeah, that's the way it is.. We write deeply comprehensive well thought out careful answers to complex and difficult questions sometimes, get 20 rep and never hear from it again, then one stupid question we write a fast quippy answer, the Q floats to the public somehow and boom...

I did one on branch prediction and finding the specs in the ARM processor of how it does dynamic and static branch prediction... 2 rep (one other answer, accepted, 1 rep).

7:57 PM
One of my highest score answers doesn't even really directly answer the question
It was just one of those everyone-has-an-opinion questions so it got tons of views

@JimmyHoffa A couple of months before I became a moderator I posted a completely nonsensical answer (on purpose, it was pure trolling). I even left an html comment in it saying "this is nonsense". It reached +40 before I deleted it.

My other high rep ones are the great {} question (which did have a bit of research with it), the pi as random (which was fun to do), and the length explanation of the string immutability (I was disappointed that the accepted answer was just a list, but no explanation of the issues in the list)
And for that fast quippy answer that gets highly voted...
176

Ask for a test case that fails without the change that succeeds with the change. If he can't produce one, you use that as justification. If he can produce one then you need to explain why the test is invalid.

Yeah, again everyone-has-an-opinion questions for the win..

They are unfortunately popular.

8:27 PM
or fortunately; they are likely where we get a majority of our participants initially

The problem is when they get stuck on 'hot questions' and then attract lots of poor answers with people adding their own two cents.

8:52 PM
2

I just wrote a little C# application to sort my MP3 files. I was tired of thinking "Didn't I just hear that artist?" or "How many times do I have to listen to 'The Way You Look Tonight?' (for example)." I have over 3000 songs so something was lacking in the shuffle algorithm my MP3 player uses. T...

It's so cool to see the answer to a question here being provably used to beneficial means
Makes me feel like the knowledge I share here might not all just be a magnificent waste of my time
(Because I CAN'T STOP EVEN IF IT IS)