HNHacker News
TopNewBestAskShowJobs

chris_mahan

1,483 karma · joined June 25, 2012

http://christophermahan.com/
submissionscomments
chris_mahan··on Emails, court docs show how Sony stood up to Steve Jobs’ and Pixar’s wage-fixing
Agreed. I'm reading his book Creativity Inc. right now, and it's chock-full of goodness. Except that now, I question the very motives and integrity of the author, so the whole thing is completely suspect, and I might just not continue reading.
chris_mahan··on PostgreSQL Performance on Docker
Could it be that the virtualization layer does something with docker?
chris_mahan··on Maintaining digital certificate security
The Cathedral isn't finished and it's crumbling already.

Back to the Bazaar!

chris_mahan··on Don’t Be Scared Of Functional Programming
I think my comment is going to be that, from reading the parent, I understand that functional programming moves the code to the data and not the data through the code.

I can't do the mental gymnastics to think about the code that way.

When I think about the purpose of the code, the result of the code, before the code has been written, I do this by "compiling and running" in my head. Of course, there's no actual compiling. There's just thinking.

When I reason about the code, either code I'm going to write, code I wrote, or code other people wrote, I execute the code in my head.

I'm currently building a web-scraping system, to look information on partner web site. I'm using python 3, selenium, pyodbc to sql server. I'm also developing the same in C# (3.5) using the webbrowser component in systems.forms. It's got a lot of moving parts, lots of languages involved. I read the documentation for the tools, then I assemble in my head, essentially "running the code" in my head, and then, once all the edge cases are dealt with (are there iframes, popups, ajax async calls, flash and pdfs) then I design on paper, with boxes, and then, later, later, if it all works in my head, then I code it.

Can't do that if I can't reason in my head about what the program is going to do, exactly.

Functional Programming, for me, does not fit in my mental model, so I can't use it, regardless of actual implementation.

chris_mahan··on Don’t Be Scared Of Functional Programming
That still made no sense, sorry.
chris_mahan··on Python 2.7.8
I'd like to add that I am the go-to person in my department (of 50 people) for all things python. I had a guy (a data scientist) ask me how to install and use python on his machine in the past hour...
chris_mahan··on Don’t Be Scared Of Functional Programming
For completeness, I should add that I don't know what "reduce" means in this context.
chris_mahan··on Don’t Be Scared Of Functional Programming
"Edit: let's not forget your Python example uses a map, disguised as a for loop"

Mmmm, really? A map? Like Google maps? Like a paper map? unfamiliar terminology.

Seriously, I learned how to use for loops in 1984. Been using them ever since. Maybe that's the problem. Too old to learn new tricks.

chris_mahan··on Don’t Be Scared Of Functional Programming
Also, a machine with RAM that changes. Well, yes, and files that change too. I'm completely ok with that.
chris_mahan··on Don’t Be Scared Of Functional Programming
Thanks. I looked at the code you provided. it makes still very little sense to me.

You're right though that my using python language features like lists and file open and loops is like function, but I understand those, so I can use them.

chris_mahan··on Don’t Be Scared Of Functional Programming
Sadly, no.

It's like I asked for a tuna sandwich and you explained how to build the engine of the fishing boat to go catch the tuna off the coast of Baja.

I feel like I need a masters in computer science to understand what you wrote.

let me see:

# Python:

domains = []

emails = open("file_with_emails.txt","r").readlines()

for email in emails:

____domain = email.split("@")[1]

____if domain not in domains:

________domains.append(domain)

out = open("file_with_domains.txt","w")

for domain in domains:

____out.write(domain)

out.close()

input:

joe@msn.com

mike@aol.com

tim@aol.com

sam@hotmail.com

output:

msn.com

aol.com

hotmail.com

Simple no?

chris_mahan··on Python 2.7.8
Yeah, I don't send people there anymore, sadly.
chris_mahan··on Don’t Be Scared Of Functional Programming
By the way, for those who think programs like that are too simplistic, and not a good showcase for all the FP goodness, maybe that's part of the problem. I work in the corporation, and I we do simple things.
chris_mahan··on Don’t Be Scared Of Functional Programming
It's simple: the very concept of the program.

I want to write a program that reads one text file, and outputs another.

Let's say the first file contains a list of emails, one email per line.

The second file should contain the list of email domains in the first file, one line per email domain.

Procedurally, I would simply declare a list, read the file of emails, line by line, split each one on the @ symbol, and if the part on the right was not already on the list, I would add it to the list.

At the end, I would write the list to a new file, one line per item in the list.

How would one do that using functional programming?

chris_mahan··on Don’t Be Scared Of Functional Programming
I'm not scared. It just does not make sense to me.

Just because I speak French and English fluently does not mean I can speak Japanese. My wife is Japanese, and speaks it fluently. We've been together 19 years. I've tried to learn. it just does not make sense. It would be nice, because I have relatives there, and I could go live there, legally, but it just doesn't make sense in my brain.

What can I do?

Functional programming is the same. Every couple of years I take a look, and I recoil in confusion.

It also doesn't help that people make fun of me for seeming dumb.

chris_mahan··on Amazon sues employee for taking Google cloud job, in new test of non-competes
You mean that focus on the customer and profits are orthogonal?

There's something else afoot there.

chris_mahan··on Amazon sues employee for taking Google cloud job, in new test of non-competes
Stagnation comes from monopoly.
chris_mahan··on Why Everyone Should be Concerned By the Seizure of MyRedBook.com
Prostitution, despite being the oldest profession, seems to not have had a negative impact on the development of western civilization. Western civilization seems to be doing just fine.
chris_mahan··on Why Everyone Should be Concerned By the Seizure of MyRedBook.com
It's ok. The next version of the internet won't be using DNS anyway.
chris_mahan··on Amazon sues employee for taking Google cloud job, in new test of non-competes
"...then it can become an unhealthy environment for employers."

It's called competition.

chris_mahan··on Amazon sues employee for taking Google cloud job, in new test of non-competes
It's still wrong. If Google's offering is better than Amazon's for some customers, why can't the sales guy who used to work for Amazon tell the customers they should get Google's offering? Customer wins.

Am I missing something?

chris_mahan··on Amazon sues employee for taking Google cloud job, in new test of non-competes
Amazon, sorry, but unless you're paying his salary to sit at home, you're just whining because Google offered a better job.

You could have kept the guy, if he was so important to your business.

I'm not a happy Amazon Prime customer today.

chris_mahan··on Google, Detroit diverge on road map for self-driving cars
I'm old too. (45) and I have 2 cars in $30K-$40K range.

I would buy the self-driving car (2 of them) because I could read in traffic, or relax while listening to music, or watching a movie.

And if tired, on the way to Vegas from LA, push "autopilot button".

It's safer to let autopilot drive than to try to drive sleepy, trust me.

chris_mahan··on Best practices in modern web projects
That's what we do.

Works well.

Break the build, all stops, and we huddle and fix it.

Sort of like the andon cord in toyota factories.

chris_mahan··on Technical Debt 101
I am financially astute, and I've been working for small and large financial services firms.

When someone talks about taking on debt, it is critical to know the interest rate charged. Also very important are whether the debt is collateralized (example: car loan, house loan) or non-collateralized (credit card), along with how easily it would be to get out from under the debt if you cannot pay (can it be discharged in bankruptcy? how does it affect your credit rating?)

Very few (if any) financial people and senior managers could make the company liable to replay this debt unless these variables were known with relative certainty. To take on debt without this information could be deemed reckless and may expose the company to shareholder lawsuits, etc, and be job-ending moves for the people involved.

Back to technical debt? What kind of debt is it? Is it collateralized? What if you can't pay it? Can you write it off, or do you lose the company? Can you get out of it in bankruptcy? What's the interest rate?

I argue that "technical debt" is like an unknown debt. The interest rate is unknown, it is collateralized with the organization itself, and cannot be discharged in bankruptcy, short of bankrupting the entire company.

The prudent and reasonable thing to do would be to not take on the debt at all. Remember what Toyoda (the founder of Toyota used to say): Cash is your best friend, but debt is your worse enemy.

Who would borrow money to go to college and get an education at 40% interest rate a year? It would only be worth it in very rare cases. What about 20% a year? My wife put her college education on credit cards, paying foreign tuition rates, and we had fun paying it back, let me tell you. When I went to college, I went slower, paying as I went, but had no debt at the end.

If any company takes on debt, it is irresponsible for them to not do a thorough financial analysis of the impact of the debt.

What's the interest rate on technical debt? Who can say?

chris_mahan··on Technical Debt 101
That's when you tell them to go read Big Ball of Mud. http://www.laputan.org/mud/

Then they start to understand.

chris_mahan··on But why can't I send people their passwords?
Except, well, I use several computers, plus smart phone.
chris_mahan··on But why can't I send people their passwords?
I'm a software developer, but I'm done trying to remember passwords for every single site.

What do I do?

I just don't use the sites.

I've restricted, and continue to pare down, the sites that I use on the internet.

It's the truth.

I do keep my amazon.com account, so I can order paper and cardboard books the local bookstores don't carry, and read them on the sofa at my house, next to my floor lamp.

chris_mahan··on But why can't I send people their passwords?
Wait. how exactly do you transfer the encryption key to amazon?

And do they keep your key?

How long?

chris_mahan··on Google Cardboard
Will code for food?
← PreviousPage 3 of 31Next →