Open Side Menu Go to the Top
Register
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

12-12-2017 , 12:44 PM
I missed the COBOL phase but I did have to learn Pascal, which was never used once after that course ended.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
12-12-2017 , 03:53 PM
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.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
12-12-2017 , 04:39 PM
Quote:
Originally Posted by plexiq
?! 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
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
12-12-2017 , 04:40 PM
Quote:
Originally Posted by saw7988
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; 12-12-2017 at 04:45 PM.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
12-12-2017 , 06:17 PM
Quote:
Originally Posted by saw7988
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.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
12-12-2017 , 06:36 PM
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).
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
12-12-2017 , 08:08 PM
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
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
12-12-2017 , 09:47 PM
Quote:
Originally Posted by suzzer99
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...
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
12-13-2017 , 12:48 AM
Quote:
Originally Posted by saw7988
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.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
12-13-2017 , 09:08 AM
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.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
12-13-2017 , 10:08 AM
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.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
12-13-2017 , 10:16 AM
Quote:
Originally Posted by RustyBrooks
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.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
12-13-2017 , 10:21 AM
Quote:
Originally Posted by jjshabado
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.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
12-13-2017 , 10:43 AM
Quote:
Originally Posted by jjshabado
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.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
12-13-2017 , 11:13 AM
Quote:
Originally Posted by RustyBrooks
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
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
12-13-2017 , 12:44 PM
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
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
12-13-2017 , 05:27 PM
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.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
12-13-2017 , 06:16 PM
"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"
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
12-13-2017 , 06:36 PM
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.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
12-13-2017 , 06:47 PM
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.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
12-13-2017 , 08:58 PM
Most type systems feel like a cancerous growth of unneeded complexity to me. I'm working with typescript alot lately and people create types for every config/options argument that gets passed, complete with generics and optional values and the whole thing just pisses me off.

I like go's type system because it doesn't have generics but then I see all sorts of comments and blogs about how this is bad and blah blah abstract data types blah.

I think it was gamingmouse here who said that the idea of types is fundamental to programming and in dynamic languages you basically end up implementing it yourself anyway. I think he's right but I'd rather just implement it myself.

Compare redux saga's little type library (https://github.com/redux-saga/redux-...l/utils.js#L20) to the cluster**** that is typescript and I'll choose the former every time.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
12-13-2017 , 09:08 PM
I think that's probably confusing TypeScript with statically typed languages in general. TypeScript is a nailed-on addition to an existing language, so of course it's going to be clunky. Def don't understand your generics hate. Generics in C# are fantastic, for instance.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
12-13-2017 , 10:45 PM
simple type parameters for collections or whatever are fine. but the people working on programming languages can't seem to help themselves from building in extra constraints for the type parameters and then also logical operators so you can extend one or another interface or both.

just flip through this load of horse****, https://www.typescriptlang.org/docs/...ced-types.html

and since this stuff only comes up once in a blue moon it never sticks and I'm always trying to figure out whats going on. it's cancer.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
12-13-2017 , 11:23 PM
Quote:
Originally Posted by Larry Legend
"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"
One time, it was from a company who was developing their own system. They wrote it, been staring at it for 4 weeks, can't figure it out, and they expect me to fix the problem in 4 hours.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
12-14-2017 , 12:22 AM
The amount time type checking in javascript would have saved me while debugging is absolutely dwarfed by the amount of time typing out extra code in by doing it all in typescript would have taken.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote

      
m