Page 2 of 8
Posted: Thu Dec 24, 2015 3:25 pm
by GORDON
BTW I got a python right here in my pants.
Talking bout my penis
Posted: Thu Dec 24, 2015 5:24 pm
by TheCatt
Malcolm wrote:Is it a lot of actuarial computing, then?
It's a boatload of $$$
Posted: Thu Dec 24, 2015 5:49 pm
by Malcolm
Eh, programming is programming. All the fun mathy parts happen prior to that. One of my chief complaints about where I work now is the willful and active ignorance displayed when numbers and formula are in play.
Posted: Thu Dec 24, 2015 7:18 pm
by thibodeaux
Now you're just trolling.
Posted: Thu Dec 24, 2015 7:54 pm
by Malcolm
I've seen code devoid of design, forethought, or analysis. Shit, I've written it. I've also gone the other route and it's forced me to see programming as another form of mathematics. I just translate it to machine instructions. Most commercial coders I've known don't simply suck at math, they recoil in horror from anything worse than high scoop algebra.
Edited By Malcolm on 1451004895
Posted: Thu Dec 24, 2015 9:20 pm
by GORDON
I was once asked by a child if math was important to be a computer programmer. I said "Sometimes, but the main importance of math is to teach you how to think logically."
Honestly, as a typical business programmer I rarely had to do anything beyond / * + and -.
Posted: Thu Dec 24, 2015 11:53 pm
by Troy
print("This is a mortgage calculator that will find your monthly payment" + "
")
principle = input("What is the loan amount?" + "
")
principle = int(principle)
interest = input("What is the interest rate?" + "
")
interest = float(interest)
monthlyinterest = (interest * .01)/12
yearsofpayments = input("How many years would you like to make payments?" + "
")
yearsofpayments = int(yearsofpayments)
totalpayments = yearsofpayments * 12
term = (1 + monthlyinterest) ** totalpayments
paymentamt = principle * (monthlyinterest * term) / (term-1)
paymentamt = float(paymentamt)
print("monthly interest of {0:.3f}".format(monthlyinterest))
print("principle of {0:D}".format(principle))
print("term of {0:.3f}".format(term))
print("
" + "Your house would have a monthly payment of {0:,.2f}".format(paymentamt))
the video i was watching wrote the formula for this challenge totally wrong, it seemed like a weird test
e: the board auto captalizes "d" because it's a dickhead
Edited By Troy on 1451020129
Posted: Fri Dec 25, 2015 12:28 am
by Malcolm
Honestly, as a typical business programmer I rarely had to do anything beyond / * + and -.
I've occasionally had to break out exponents, the exponential function, logarithms, and the odd bit-wise operation. Outside of simple tree methods, I've never needed what I consider to be "real" algorithms, that is getting a solution through something besides brute force alone. However, it's nice knowing that kind of shit just in case it comes up. I did most of my grad work on this, this, and this. I have yet to encounter a commercial/biz problem in my working life that needs weaponry of that calibre or the umpteen zillion different kinds of time and space analyses I got indoctrinated with.
We once had the internal R&D department at work come up with a predictive thingy for us. It involved a little more than that but not much. Sophomore shit and nothing but a linear model. That said, no one could figure out how to plug the input args into it or what they were without calling them up. Then I got a look at it and explained it to my manager. He thought I was wrong and made me call up the R+D dude on the phone because I wouldn't back off. The guy on the other end of the line (who now works for Google), in his Americanized German accent, confirmed everything I said.
All the interviews I've run, all the candidates I've suffered through ... most of them can't write a Fibonacci function, let along write it the efficient way. I used to be incredulous when my LISP professor told us that most real world programmers fuck up writing a binary search method. Turns out he was right.
Perhaps the most important thing I've learned over the years -- there are lots of people who can churn out code; there aren't many who know what to do before you start coding or what quality code looks like. They just hack and god help you if you have to maintain their shit.
Edited By Malcolm on 1451021507
Posted: Fri Dec 25, 2015 1:01 am
by Troy
Malcom bring you curmudgeon ass to SF and teach me to code, thanks
Posted: Fri Dec 25, 2015 1:10 am
by Malcolm
Troy wrote:Malcom bring you curmudgeon ass to SF and teach me to code, thanks
I have actually looked at a Cali job in the past year, but it was near LA.
Posted: Mon Dec 28, 2015 4:15 pm
by TPRJones
They just hack and god help you if you have to maintain their shit.
Well, you'd never want to work with me, then. :p I can sometimes make magic, but the code I come up with to do it will be hacked all to hell and gone.
Most my "programming" these days is specifically for the purpose of manipulating numbers and doing math upon them. But that's what the computer is for, I don't have to do the math myself. You only need enough math to know how to code the formulas, not actually carry out the calculations.
Posted: Wed Dec 30, 2015 5:16 pm
by Malcolm
If something's one shot, then I don't care. If it's meant to be reused, it needs to be designed and thought out properly. The product I work on now has four different frameworks to query one fucking DB. FOUR. Three are hack jobs. One is so high-level, it's worthless.
One's nothing but a monolithic hack job and no one's really sure how it all works.
Another is abstract to a fault.
A third was obviously a rushed process they brute forced.
The fourth is literal to a fault.
Posted: Wed Dec 30, 2015 11:27 pm
by TPRJones
Well, I'm nowhere near that bad, at least.
Posted: Thu Dec 31, 2015 12:02 am
by Malcolm
The plan is to integrate them all into one next year sometime. Once you excise the stupidity inherent in the literal one, it's quite fluid. I got repeatedly yelled at for pointing out said stupidity at its inception.
Posted: Mon Feb 08, 2016 6:15 pm
by Troy
I wrote a very simple - yet awesome to me - hangman program on Saturday.
Reading a file, randomly picking a string out of an object, providing a graphical output to a user than changed based on their inputs, success and fail branches, all that sexy stuff. Hardest thing I had to do was figure out how to change each instance of a letter in the _ _ _ _ output instead of just one.
Then Sunday I spent the day figuring out why the Tower of Hanoi problem is solved using recursive functions. And then the Panthers lost. So Saturday was a lot better than Sunday.
Posted: Mon Feb 08, 2016 6:40 pm
by Malcolm
Then Sunday I spent the day figuring out why the Tower of Hanoi problem is solved using recursive functions.
If you can master recursion, you beat out 50% of the intro programmers out there. It's inefficient but elegant. If you want to fuck with your brain, try writing the Hanoi solution without recursion. Try a Fibonacci generator or factorial calculator next. I'd recommend hitting trees (specifically binary search trees) after that.
providing a graphical output to a user
Ah, ASCII. Think my first programmed game was Tic-Tac-Toe.
Edited By Malcolm on 1454974883
Posted: Mon Feb 08, 2016 6:48 pm
by TheCatt
Quick, introduce him to MVC.
Posted: Mon Feb 08, 2016 7:27 pm
by Troy
Malcolm wrote:Try a Fibonacci generator or factorial calculator next. I'd recommend hitting trees (specifically binary search trees) after that
Had done these already in a non openware book. They were much easier to grapple. Will check binary trees out next as that's the second time it was mentioned to me.
Actually there's a file called rabbitsfucking.py on one of my machines somewhere.
Posted: Mon Feb 08, 2016 7:32 pm
by Troy
TheCatt wrote:Quick, introduce him to MVC.
I think this is what Django is. I told would try to finish the course before I moved on to the next thing though 
Posted: Tue Feb 09, 2016 6:08 pm
by Malcolm
Django looks like a Python web framework, so I bet it has objects to implement the MVC pattern. That said, it doesn't hurt to know what it is on a conceptual level, because you could hear it applied to anything from webpage design to an individual widget in a UI. You'll also hear it riffs on it like MVP or MVVP or other bullshit acronyms that differ just enough for some desperate loser HCI graduate to write a thesis or dissertation on them.
After you can handle trees, I might focus a bit on DB interaction.