[Chicago] Python for mortgages???

Lewit, Douglas d-lewit at neiu.edu
Mon May 18 18:09:07 CEST 2015

Hi Rob,

But there's something that I don't understand.  In Java (strongly typed)
this is a big no-no:

int x = 5;

(Later on in the program):

x = "Douglas"

(Yes, I could do this:
Object x = 5;

x = "Douglas";  /* But I think that's cheating!!! */

But in Java once you declare 'x' to be an int, you can't just suddenly turn
it into a String.

But in Python you can!  Which is so cool!  You can do this:

x = 5

(But later in the program.)

x = "Douglas"

No problem.

I guess I'm a little confused by the difference between static vs. dynamic
and weak vs. strong typing.  Okay Rob, I need a lesson here!   :-)

By the way, what's new with Perl?  Wasn't Perl sort of "the Python of the
90's"?  I don't much about it except for playing around with it a couple
times.  Is it something that I should try to master or is it becoming a
semi-obsolete language?

Oh yeah.... with my Mortgage calculator in Python, I think my total
interest is slightly off because the final payment is going to be less than
(or possibly equal to) all the other payments.  Ah well.... I think it's at
least a B+ program!  (It's not really for a grade.  I just like working on
these little financial projects.  Fun and interesting. )

On Mon, May 18, 2015 at 9:08 AM, Rob Kapteyn <robkapteyn at gmail.com> wrote:

> Just a quick note on a common misconception about Python.
> You wrote:
> 'Personally, I like the "feel" of the "weakly typed" or dynamic languages,
> such as Perl, Ruby and Python.'
> Python is NOT "weakly typed".
> It is "strongly, dynamically typed".
> Once Python determines the type of an object -- it does not change.
> Weakly typed languages (like Perl) often create horrible bugs in
> production when real-world data gets
> cast into an unexpected type.  This has given "weak typing" a (deservedly)
> bad reputation.
> These bugs never happen with Python.
> On Sun, May 17, 2015 at 12:16 PM, Lewit, Douglas <d-lewit at neiu.edu> wrote:
>> Hi Jimmy,
>> Thanks for the feedback!  Right now I mostly work with the Java crowd.
>> Honestly, nobody in my department has anything positive to say about Python
>> other than "it looks good on your resume".  One young lady who used to be
>> the graduate tutor in my department said, "Oh please, Python?  You can
>> learn Programming I in Python in just 30 minutes!!!  But C, C++ and Java
>> take work and study!"  But she was an arrogant little know-it-all and
>> -----.  (I'll let you use your imagination to fill in the blank! )
>> Personally, I like the "feel" of the "weakly typed" or dynamic languages,
>> such as Perl, Ruby and Python.  They remind me a lot of Maple and
>> Mathematica, which provided me with my first experiences in real computer
>> programming.  Java isn't bad, but I'm not thrilled with how people in my
>> department teach Java.
>> I want to flesh out the program a wee bit more.  Add more info to the
>> tuples, such as the amount of principal paid up to that point, the amount
>> of interest paid up to that point (or month I mean), and.... I guess that's
>> it!  I haven't got a clue how this would work for a *variable* rate
>> mortgage!  That would get VERY complicated!  With a fixed rate mortgage you
>> know that your payment must be greater than (amount borrowed)*(1 +
>> rate/1200) or you will never pay off your mortgage.  Your debt would either
>> remain the same or continue to accumulate more interest and actually get
>> larger.
>> On Sun, May 17, 2015 at 8:27 AM, Jimmy Calahorrano via Chicago <
>> chicago at python.org> wrote:
>>> Doug,
>>> couple points on this. Have you actually talked to people working on
>>> Python for years already? If you just talked to Java/C# developers that
>>> have never used Python then they doesn't know what they are talking about.
>>> I was one of them (c# developer for about 10 years), i had the tendency to
>>> under value javascript for example, and little interest on learning python.
>>> Things changed years ago, and I cannot be more grateful for people and
>>> situations that ended me working in python.
>>> Regarding the mortage escrow calculator that you are talking about real
>>> state companies doesn't calculate them, it is the actual lending company
>>> that needs to calculate the escrow, on middle size and big ones, they
>>> no longer use excel, since this is the most basic calculation that they
>>> should get done. I'd research to find out what features are missing on
>>> those systems, or if is something else that they need.
>>> thanks,
>>> Jimmy
>>>   ------------------------------
>>>  *From:* "Lewit, Douglas" <d-lewit at neiu.edu>
>>> *To:* The Chicago Python Users Group <chicago at python.org>
>>> *Sent:* Sunday, May 17, 2015 5:45 AM
>>> *Subject:* [Chicago] Python for mortgages???
>>> Hey there ladies and gents,
>>> I'm kind of proud of this, my latest little Python project.  I know my
>>> Formatter class is very Java-like, but hey, why not?  I've actually had
>>> more formal training in Java than in Python, so it makes sense that I bring
>>> a certain amount of the Java paradigm to my Python programming projects,
>>> which may not necessarily be a bad thing.  In chatting with CS professors
>>> and others in the community, I still get the feeling that a lot of people
>>> still think of Java as a "grownup programming language" while Python is
>>> just good for newbies, kids, and amateur programmers.  It's an attitude
>>> that I really don't like, and of course most of the people with that
>>> opinion have not really used Python that much anyhow!  So I kind of enjoy
>>> exploring the OOP aspects of Python and other pretty heavy-duty aspects of
>>> Python, demonstrating that it is just as much a grownup programming
>>> language as Java.  Unfortunately I have not yet explored the web page
>>> development capabilities of Python, but that is definitely on my to-do list
>>> for the near future.
>>> This program asks the question, "If I borrow some money to buy a house
>>> at a certain interest rate (expressed as a percentage) and if I pay a
>>> certain amount of money every month, then how many months will it take for
>>> me to pay off my mortgage?"  Also, what's the total interest going to be?
>>> I really like the program, but if anyone can suggest something to make
>>> it even better, then hey, by all means let me know.  But be polite!  I
>>> devoted a lot of time to this, so please no replies like, "Doug, your
>>> program sucks!"
>>> And if you sell my program to some big real estate company, I want a
>>> percentage of those profits!!!  (I suspect that most realtors use EXCEL to
>>> solve these exact same problems.)
>>> Enjoy the rest of your weekend and I'm looking forward to reading your
>>> feedback and criticisms.
>>> Cheers,
>>> Douglas Lewit
>>> P.S.  I probably should have used Python 3 for this, but I went ahead
>>> with Python 2 for this project.  Sorry guys, but if you run my script with
>>> Python 3 it definitely won't run!  The print statement won't work and
>>> neither will the generators.
>>> _______________________________________________
>>> Chicago mailing list
>>> Chicago at python.org
>>> https://mail.python.org/mailman/listinfo/chicago
>>> _______________________________________________
>>> Chicago mailing list
>>> Chicago at python.org
>>> https://mail.python.org/mailman/listinfo/chicago
>> _______________________________________________
>> Chicago mailing list
>> Chicago at python.org
>> https://mail.python.org/mailman/listinfo/chicago
> _______________________________________________
> Chicago mailing list
> Chicago at python.org
> https://mail.python.org/mailman/listinfo/chicago
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/chicago/attachments/20150518/a612ad66/attachment.html>

More information about the Chicago mailing list