Two Plus Two Publishing LLC Two Plus Two Publishing LLC
 

Go Back   Two Plus Two Poker Forums > >

Notices

Programming Discussions about computer programming

Reply
 
Thread Tools Display Modes
Old Yesterday, 12:44 PM   #31276
Lattimer
I are smart
 
Lattimer's Avatar
 
Join Date: Feb 2009
Location: New England
Posts: 11,769
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

I missed the COBOL phase but I did have to learn Pascal, which was never used once after that course ended.
Lattimer is offline   Reply With Quote
Old Yesterday, 03:53 PM   #31277
saw7988
Carpal \'Tunnel
 
saw7988's Avatar
 
Join Date: Jul 2005
Posts: 11,362
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

I just wanted to come here and say that I've been doing a lot of Python recently, and basically every error I get ends up being something that would've been trivially solved with static typing.
saw7988 is offline   Reply With Quote
Old Yesterday, 04:39 PM   #31278
jmakin
 
jmakin's Avatar
 
Join Date: Jan 2008
Location: Streaming
Posts: 25,334
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

Quote:
Originally Posted by plexiq View Post
?! Of course it is.

Code:
if(x){a}
elseif(y){b}
elseif(z){c}
else{d}
is equivalent to:
Code:
if(x){a}
else{
   if(y){b}
   else{
      if(z){c}
      else{d}
   }
}
I have a really bad habit of nesting if’s and it’s what led me to try the ternary operator to save myself headaches
jmakin is online now   Reply With Quote
Old Yesterday, 04:40 PM   #31279
jmakin
 
jmakin's Avatar
 
Join Date: Jan 2008
Location: Streaming
Posts: 25,334
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

Quote:
Originally Posted by saw7988 View Post
I just wanted to come here and say that I've been doing a lot of Python recently, and basically every error I get ends up being something that would've been trivially solved with static typing.
I’m a huge proponent of strongly typed languages. Tbh if I landed a job that mostly dealt in python I don’t think I could do it. So far I am 2 quarters away from graduating and have managed to avoid typing a single line of python.

Btw you can have dynamic typing in strongly typed languages. I think C++ can do this as well as java.

Last edited by jmakin; Yesterday at 04:45 PM.
jmakin is online now   Reply With Quote
Old Yesterday, 06:17 PM   #31280
suzzer99
Carpal \'Tunnel
 
suzzer99's Avatar
 
Join Date: Nov 2005
Location: on top of the bell curve
Posts: 83,598
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

Quote:
Originally Posted by saw7988 View Post
I just wanted to come here and say that I've been doing a lot of Python recently, and basically every error I get ends up being something that would've been trivially solved with static typing.
How many of those would also be solved by a syntax-checking/linting IDE or text editor?

In Javascript I really can't think of a bug I've had that would have been caught by static typing, but not by linting. I'm sure there have been some but they just don't come up for me that often.
suzzer99 is offline   Reply With Quote
Old Yesterday, 06:36 PM   #31281
daveT
S.A.G.E. Master
 
daveT's Avatar
 
Join Date: Jun 2005
Location: Why didn't I use Clojure instead?
Posts: 21,917
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

What kind of data structures and functions are you using that the type matters? I feel like so much of the static -vs- dynamic typing really comes down to poor design.

I started with dynamic and used static later, so I guess I'm more aware of keeping things simple and stupid as a base approach to everything. Python falls apart hard if you start using a long list of args, kwargs, more than one return value, and so on, but I'm not sure why people do this at all (this is a great first step to cleaning disaster code bases, btw).
daveT is offline   Reply With Quote
Old Yesterday, 08:08 PM   #31282
saw7988
Carpal \'Tunnel
 
saw7988's Avatar
 
Join Date: Jul 2005
Posts: 11,362
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

I was doing scientific computation stuff with numpy and pandas. Numpy arrays, panda series, and panda dataframes can all kinda semi-interoperate to some degree but not completely. Maybe not the most generalizable case, but I do think static typing helps a ton in general with writing code that runs correctly the first time, greatly shortening development time.

Sent from my Pixel using Tapatalk
saw7988 is offline   Reply With Quote
Old Yesterday, 09:47 PM   #31283
Grue
Pooh-Bah
 
Grue's Avatar
 
Join Date: Mar 2004
Location: It is pitch black.
Posts: 5,006
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

Quote:
Originally Posted by suzzer99 View Post
In Javascript I really can't think of a bug I've had that would have been caught by static typing, but not by linting.


but lets get all on board with typescript because we really really need to type out "String" a thousand times...
Grue is offline   Reply With Quote
Old Today, 12:48 AM   #31284
daveT
S.A.G.E. Master
 
daveT's Avatar
 
Join Date: Jun 2005
Location: Why didn't I use Clojure instead?
Posts: 21,917
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

Quote:
Originally Posted by saw7988 View Post
I was doing scientific computation stuff with numpy and pandas. Numpy arrays, panda series, and panda dataframes can all kinda semi-interoperate to some degree but not completely. Maybe not the most generalizable case, but I do think static typing helps a ton in general with writing code that runs correctly the first time, greatly shortening development time.

Sent from my Pixel using Tapatalk
Yeah, I can get this. I think that a lot of that is with csv in particular. I've done quite a bit with csv and pandas, and really the initial domino is at csv's flimsy half-assed format combined with every spreadsheet program having it's own interpretation of what is correct, assuming "correct" means "does nothing consistently."

I'm a firm believer in keeping data strongly typed. In my experience, malformed data with improper typing is a layer of hell that sticks its tendrils throughout the rest of the program. A proper database makes an immense difference here.

When I talk about about static -vs- dynamic, I'm not really talking about raw data, I'm talking about the general system of programming. Of course, trashy data makes things a whole lot worse, and it's possible when people mean type, they really mean dealing with ****ed up data, which isn't the same thing at all.
daveT is offline   Reply With Quote
Old Today, 09:08 AM   #31285
saw7988
Carpal \'Tunnel
 
saw7988's Avatar
 
Join Date: Jul 2005
Posts: 11,362
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

I'm definitely talking about the general programming over the raw data. I dunno, as I've said before, I'm not a full on software developer, I do scientific stuff and occasional game programming. But there's something intangible that I really enjoy about having a rigid structure of rules in place that catch what seem to me a large subset of bugs before even running the program (which I don't have to tell you guys is a horrible way to find bugs given all the different ways program execution can branch out).

Not even necessarily for complicated things like arrays of classes containing a specific type or whatever. Like if I have a function that returns bool and I feed it into an if statement elsewhere in the code - and then I decide to change it to some kind of Result class, then it becomes super obvious with compiler errors how to change the rest of the code. Probably a bad/easily defeated example, I dunno. Even if I'm wrong here objectively, why does having this strictly defined type system give me so much pleasure? Lol.

ETA: And I don't think I'm alone here and kinda surprised at the general sentiment of this forum. The general internet world out there via googling and reddit (ok yea probably skewed I guess? but still) definitely favor static over dynamic as well.
saw7988 is offline   Reply With Quote
Old Today, 10:08 AM   #31286
RustyBrooks
Carpal \'Tunnel
 
RustyBrooks's Avatar
 
Join Date: Feb 2006
Location: Austin, TX
Posts: 23,260
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

Dynamically typed languages feel... more hackable. Java feels so restrictive to me, so pedantic and weird. Python and perl and tcl and ruby feel fluid and responsive. After a while you get used to writing in a style so that when you change what a function returns your other functions more or less still work OK.

Then you go sit down in Java and you want to change what a function returns and now you have to change the 90 places it's called because they were all storing the result in a Foo but now it needs to be a Bar.

In both cases, IDEs tend to paper over the suck that each paradigm provides, so I guess that helps. I tried, I really ****ing tried, to program modern java without an IDE and I failed. It was so painful. I can program python without one just fine. I can do C++ without one too but that's just because I know it inside and out.

Which is another point - most languages, once you're fluent, most of these annoyances just disappear and you never notice them again. Fish don't notice they're wet, etc. Most of the hurt happens when you're learning or dealing with something new.
RustyBrooks is offline   Reply With Quote
Old Today, 10:16 AM   #31287
jjshabado
Carpal Tunnel
 
jjshabado's Avatar
 
Join Date: Jul 2006
Posts: 21,854
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

Quote:
Originally Posted by RustyBrooks View Post
I tried, I really ****ing tried, to program modern java without an IDE and I failed. It was so painful. I can program python without one just fine. I can do C++ without one too but that's just because I know it inside and out.
Why try?

IDEs for Java are amazing. Much more valuable then their equivalent in Python. I'm not sure why you'd want to handicap yourself like that.

saw, I still maintain a legacy app that has a Python and a Java piece. Java is way easier to maintain even though building it was probably tougher and it has some annoying Java-ish idiosyncrasies.

If forced to choose between Java and Python for a large application I'd probably choose Java. But be mad that I was made to choose.
jjshabado is offline   Reply With Quote
Old Today, 10:21 AM   #31288
RustyBrooks
Carpal \'Tunnel
 
RustyBrooks's Avatar
 
Join Date: Feb 2006
Location: Austin, TX
Posts: 23,260
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

Quote:
Originally Posted by jjshabado View Post
Why try?
Because I don't program Java for a living. I needed to make a simple proof of concept for someone else to take over the finish line. I made the python version in about an hour or two, I thought I could make the Java one in an afternoon and I didn't want to install or set anything up. By the end of the day I had installed a Java IDE. It still took me 2 days to get something working. Most of that was not Java problems, but problems with Spring, which is neat/amazing/whatever but also a giant ball of impenetrable magic.

And actually for a large application I'd probably choose Java too. The more developers on a project, the more I'd want a statically typed language.
RustyBrooks is offline   Reply With Quote
Old Today, 10:43 AM   #31289
saw7988
Carpal \'Tunnel
 
saw7988's Avatar
 
Join Date: Jul 2005
Posts: 11,362
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

Quote:
Originally Posted by jjshabado View Post
Why try?

IDEs for Java are amazing. Much more valuable then their equivalent in Python. I'm not sure why you'd want to handicap yourself like that.

saw, I still maintain a legacy app that has a Python and a Java piece. Java is way easier to maintain even though building it was probably tougher and it has some annoying Java-ish idiosyncrasies.

If forced to choose between Java and Python for a large application I'd probably choose Java. But be mad that I was made to choose.
Yea agreed. I made an Android game in Java with IntelliJ and it was overall a relatively pleasurable experience. I do understand people's complaints with it though, and I would by no means say it's an optimal language. If I could go back in time I'd consider Kotlin or some other more modern language. I've been dabbling in Rust recently and have been loving it.

I don't even think the development time is that much worse for static languages assuming you're competent. Number of characters required to type is like the least important factor in determining development time.
saw7988 is offline   Reply With Quote
Old Today, 11:13 AM   #31290
jmakin
 
jmakin's Avatar
 
Join Date: Jan 2008
Location: Streaming
Posts: 25,334
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

Quote:
Originally Posted by RustyBrooks View Post
Dynamically typed languages feel... more hackable. Java feels so restrictive to me, so pedantic and weird. Python and perl and tcl and ruby feel fluid and responsive. After a while you get used to writing in a style so that when you change what a function returns your other functions more or less still work OK.

Then you go sit down in Java and you want to change what a function returns and now you have to change the 90 places it's called because they were all storing the result in a Foo but now it needs to be a Bar.

In both cases, IDEs tend to paper over the suck that each paradigm provides, so I guess that helps. I tried, I really ****ing tried, to program modern java without an IDE and I failed. It was so painful. I can program python without one just fine. I can do C++ without one too but that's just because I know it inside and out.

Which is another point - most languages, once you're fluent, most of these annoyances just disappear and you never notice them again. Fish don't notice they're wet, etc. Most of the hurt happens when you're learning or dealing with something new.


Find and replace with eclipse, should take like 30 seconds
jmakin is online now   Reply With Quote
Old Today, 12:44 PM   #31291
suzzer99
Carpal \'Tunnel
 
suzzer99's Avatar
 
Join Date: Nov 2005
Location: on top of the bell curve
Posts: 83,598
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

I'm old enough to have programmed in Java using UltraEdit. The first job we had TogetherJ - but it seemed more focused on tying the Java to UML (so useful!) than stuff like real-time compile checking. The next job had Jbuilder but it was so slow and clunky we never used it - even though the company had spent like $5k/seat lol. And I don't think it even had real-time compile-checkinge either.

The first time I really used an IDE was NetBeans I think in 2005. I was like wait - this is free *and* it instantly tells me when my compile is going to fail w/o actually running compile? Ok - yes now I can switch from UltraEdit. But it still sucked for like HTML and JS files - so I had to use both. Then I used Eclipse and UltraEdit together until 2013 or so when I switched over to all Sublime as I was doing almost no Java by then
suzzer99 is offline   Reply With Quote
Old Today, 05:27 PM   #31292
daveT
S.A.G.E. Master
 
daveT's Avatar
 
Join Date: Jun 2005
Location: Why didn't I use Clojure instead?
Posts: 21,917
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

I'm not for or against static typing. I guess that each person has their idea of hump that needs to smoothed out so each developer is on the same page.

I've had the chance to work on 2 Java code bases. The conversation is "can you tell me why this part is slow / isn't returning the correct result?"

They think the explanation is simple and they think these are 5 minute fixes.

I'm not sure what the exact hump is in these situations, as it appears to be many, but nothing I'd point my finger at and say "Oh, thank goodness this is a static type."

I don't outright refuse to work on Java codebases, but I've never been contacted by someone I felt comfortable working with, so I turn this work down.
daveT is offline   Reply With Quote
Old Today, 06:16 PM   #31293
Larry Legend
Celtic Pride
 
Larry Legend's Avatar
 
Join Date: Jul 2009
Location: Kyrie's earth
Posts: 41,391
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

"They think the explanation is simple... and 5 mins"

This was exceedingly common when companies wanted us to fix their websites. If you can do it while not sounding like a douche or a smartass, making a joke like "well I'm happy to hold for 5 minutes while you fix it " can help get them toward more realistic explanations.

I spoke to a recruiter yesterday who said, "react is really simple right, only like 5 lines of code? That's what a candidate told me." I pointed him toward the github page for react and had him click around it for a bit...

He said "wow, yea I should never say that again"
Larry Legend is offline   Reply With Quote
Old Today, 06:36 PM   #31294
toddw8
veteran
 
toddw8's Avatar
 
Join Date: Dec 2003
Location: Carried to Ohio in a swarm of bees
Posts: 2,459
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

When I started school the first intro to Java class forced us to use Eclipse and I absolutely hated it so I vowed after that to just do everything using Vim and the command line. That went fine until I took distributed systems and realized the first project would require ~35 classes. I caved and installed Intellij and was immediately so much more productive. I can't imagine working on a large Java codebase without an IDE.
toddw8 is offline   Reply With Quote
Old Today, 06:47 PM   #31295
daveT
S.A.G.E. Master
 
daveT's Avatar
 
Join Date: Jun 2005
Location: Why didn't I use Clojure instead?
Posts: 21,917
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

I had a further thought about the static thing as well. I could be wrong, but it seems to me that everyone goes on and on about "compilation errors." If you are programming a dynamic language as you would a static language (running "python myfile.py" after each change), you are doing it wrong.

Interactive programming is very different than compilation programming. In interactive programming, you should be writing small functions and making changes one line at a time. The program should be constantly running and you should be interacting with it in real time, making small changes and testing as you go along. If you pass a wrong type of arg, it will often error down the interpreter.

It doesn't mean you can't run "python myfile.py" after each change. I've had to work with codebases that required this, and the process is painfully slow to put it lightly. There are obviously a ton of errors, but if you can't figure out how to set up an interactive environment in Python, the problems go far deeper than static programming.
daveT is offline   Reply With Quote

Reply
      

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Forum Jump


All times are GMT -4. The time now is 08:26 PM.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © 2008-2017, Two Plus Two Interactive
 
 
Poker Players - Streaming Live Online