ultrafilter posted:Academic departments are incentivized to teach intro classes that students feel good about. The language of choice before Python was Java, and when it comes to making beginners feel good, Python is a much better choice. well you're talking about college, which is a totally different thing. python is almost a reasonable choice at that level. in k-12 neither python or java really works at all. javascript honestly provides the best balance of accessibility, immediate ability to produce results, and relevancy.
|
|
# ? Feb 5, 2021 19:10 |
|
|
# ? Jun 6, 2024 02:24 |
|
My high school started with basic and then moved on to C. It should still be this way.
|
# ? Feb 5, 2021 19:23 |
|
DoomTrainPhD posted:My high school started with basic and then moved on to C. It should still be this way. We did Basic and then C++, but it was the APCS "C with a string class" C++
|
# ? Feb 5, 2021 19:24 |
|
more falafel please posted:We did Basic and then C++, but it was the APCS "C with a string class" C++ Acceptable. It's not that new programmers should suffer from C. It's that higher-level language abstracts way too much, which in turn creates terrible programmers. Ask new graduates how two strings are actually concatenated, and most of them couldn't answer properly. Let alone what a volatile is or the difference between the stack and heap.
|
# ? Feb 5, 2021 19:28 |
|
There's no reason to ever teach or use C for anything save maybe embedded programming. It's too abstract to properly teach low-level concepts and too low-level to properly teach abstractions.
|
# ? Feb 5, 2021 19:29 |
|
Hammerite posted:I don't get the point of the type annotations thing in Python. If you want type safety you may as well use a real programming language and get one at compile time. It's too late to shoehorn it in to your dynamically-typed scripting language once it's 20 years old or whatever. And no-one should be building anything in Python that's more complicated than a single file anyway (but I'm getting sidetracked). What are you even talking about? Are you aware of Python's massive popularity, or are you taking a stand against static typing because there's a different tool for it? The majority of my work's Python projects are 100% strictly typed and type safety is enforced at all stages of our deployment pipeline.
|
# ? Feb 5, 2021 19:37 |
Hammerite posted:I was being consciously provocative when I said you shouldn't use Python for anything more complicated than a single file. But also, coincidentally, it's what I actually do believe. It's documentation. It's helpful in the same way that documentation is, with the added benefit of adding IDE hints. That's about the size of it. DoomTrainPhD posted:I hear good things about Spring. I have used Django quite extensively over the years and quite like it as well. What can Spring do that Django struggles with? JVM vs Python, realistically. They're both made for the same purpose (a non-trivial server application), where python's natural advantages don't apply as well, and its natural drawbacks (hello GIL) start really hammering you.
|
|
# ? Feb 5, 2021 19:47 |
|
Volte posted:There's no reason to ever teach or use C for anything save maybe embedded programming. It's too abstract to properly teach low-level concepts and too low-level to properly teach abstractions. What language should low-level concepts be taught in?
|
# ? Feb 5, 2021 19:49 |
|
Pie Colony posted:What are you even talking about? Are you aware of Python's massive popularity, or are you taking a stand against static typing because there's a different tool for it? The majority of my work's Python projects are 100% strictly typed and type safety is enforced at all stages of our deployment pipeline. What does enforcement actually involve? Does it stop you from running code that won't work due to type issues, or does it just throw warning messages?
|
# ? Feb 5, 2021 19:49 |
more falafel please posted:What language should low-level concepts be taught in? verilog > asm > java
|
|
# ? Feb 5, 2021 19:52 |
|
ultrafilter posted:What does enforcement actually involve? Does it stop you from running code that won't work due to type issues, or does it just throw warning messages? Yes, if the type check fails, the build fails, the deploy fails, and the code is never run.
|
# ? Feb 5, 2021 20:13 |
|
Bring back Pascal, IMHO.
|
# ? Feb 5, 2021 20:16 |
|
Pie Colony posted:Yes, if the type check fails, the build fails, the deploy fails, and the code is never run. Again, it's not a type check, it's a type hint, and in Pythons case it's mainly for the programmers edification. If you want the build to fail, you run mypy in a CI/CD pipeline and it will enforce the type-hints.
|
# ? Feb 5, 2021 20:18 |
|
Borland Pascal ftw. e: fb
|
# ? Feb 5, 2021 20:19 |
|
Assembly is a terrible way to learn low-level concepts where you have to e.g. manage allocations, copy values around, etc. It’s not that you don’t still have to care about those things, it’s that most of your focus will be on worrying about other things. C has some warts, but its main problems as a programming language are in how it forces you to deal with exactly those things, so it’s good for learning them.
|
# ? Feb 5, 2021 20:25 |
|
DoomTrainPhD posted:Again, it's not a type check, it's a type hint, and in Pythons case it's mainly for the programmers edification. If you want the build to fail, you run mypy in a CI/CD pipeline and it will enforce the type-hints. If the types are checked automatically, it's literally a type check. I'm risking a lot by posting this, but here's my job's proprietary build tool: code:
|
# ? Feb 5, 2021 20:28 |
|
rjmccall posted:Assembly is a terrible way to learn low-level concepts where you have to, e.g., manage allocations, copy values around, etc. It's not that you don't still have to care about those things; it's that most of your focus will be on worrying about other things. C has some warts, but its main problems as a programming language are how it forces you to deal with exactly those things, so it's good for learning them. Exactly. Learning C is a good stepping stone to higher-level languages, as many of the same syntax or concepts still apply (for/while loops, enums, structs, basic types.) You also learn about the annoyances of various things that higher-level languages obscure, such as string handling, memory management, pointers/address' etc. Once you know the pain of string management in C, you can appreciate "foo" + "butt" a lot more!
|
# ? Feb 5, 2021 20:29 |
|
Pie Colony posted:What are you even talking about? Are you aware of Python's massive popularity, or are you taking a stand against static typing because there's a different tool for it? The majority of my work's Python projects are 100% strictly typed and type safety is enforced at all stages of our deployment pipeline. what does Python's popularity have to do with it? To answer your question, I am aware that Python is widely used. I don't know how you read that post and come away with the idea that I'm "taking a stand against static typing". I think it's clear from the post that I think static typing is a good thing and also that I'm circumspect about incorporating it into Python when the "everything is duck typed" philosophy of the language is so established. I'm glad you can enforce the type system as part of a build process. I had been under the impression that this wasn't really feasible. I'm happy to be wrong.
|
# ? Feb 5, 2021 20:35 |
|
My point was just that if you see a benefit in static typing, you should be happy that you can statically type code in one of the most popular programming languages.
|
# ? Feb 5, 2021 20:48 |
|
I believe static typing is better, but I'm not gonna tell people to switch away from dynamic typing if they like it. After all, if they wanted to be warned when they made a mistake, they wouldn't be using a dynamically typed language in the first place.
|
# ? Feb 5, 2021 20:59 |
|
I'm a weirdo in that I learned BASIC, then Z-80 assembly (to make calculator games), then "C with a string class" C++, then college where I learned a little Java, but mostly did things in C and C++. In my personal time I did most stuff in Perl 5 because I was an insufferable Unix kid in college. So when I learned about pointers I was confused for a while until I realized they were just memory addresses, just like in assembly. I also took a PL class in college where we did some Common Lisp, some OCaml, some Haskell, and some Prolog, and eventually I wrote a micro-lisp in Smalltalk.
|
# ? Feb 5, 2021 21:06 |
|
Bongo Bill posted:I believe static typing is better, but I'm not gonna tell people to switch away from dynamic typing if they like it. After all, if they wanted to be warned when they made a mistake, they wouldn't be using a dynamically typed language in the first place. I think dynamic typing just gives you greater flexibility. If you're writing a new function that you feel needs static typing, then you can temporarily enforce static typing without switching languages
|
# ? Feb 5, 2021 21:31 |
|
QuarkJets posted:I think dynamic typing just gives you greater flexibility. If you're writing a new function that you feel needs static typing, then you can temporarily enforce static typing without switching languages This is the opposite of true, because a static language can opt in to having dynamic types where needed but a dynamic one always pays the runtime costs.
|
# ? Feb 5, 2021 21:33 |
|
I'ma just drop Hillel Wayne's Epistemology of Software Quality into any god drat language or typedness debate.
|
# ? Feb 5, 2021 21:47 |
|
Everything has its place. If you don't know what you want to write yet, dynamic typing is the way to go. Once you've got a clear domain model and you want to write something for production with correctness guarantees and optimization, static typing really shines.
|
# ? Feb 5, 2021 22:17 |
|
Lot of terrible opinions itt, the worst one being that students should suffer lovely language so they appreciate the good ones more.
|
# ? Feb 5, 2021 22:51 |
|
xtal posted:This is the opposite of true, because a static language can opt in to having dynamic types where needed but a dynamic one always pays the runtime costs. Granted, statically typed languages can have dynamic types, but in my experience it is a pain in the rear end and really clunky to actually use them so I avoid them whenever possible.
|
# ? Feb 5, 2021 23:06 |
|
Logo was pretty cool
|
# ? Feb 5, 2021 23:17 |
|
Xarn posted:Lot of terrible opinions itt, the worst one being that students should suffer lovely language so they appreciate the good ones more. It has nothing to do with wanting them to suffer. They need to understand the fundamentals of what's going on behind the scenes.
|
# ? Feb 5, 2021 23:26 |
|
xtal posted:This is the opposite of true, because a static language can opt in to having dynamic types where needed but a dynamic one always pays the runtime costs.
|
# ? Feb 6, 2021 01:01 |
|
ultrafilter posted:Python being the only language that most machine learning/data science people know is a full-fledged horror. Found the poster who doesn't remember matlab.
|
# ? Feb 6, 2021 01:37 |
|
And then there is R
|
# ? Feb 6, 2021 01:45 |
|
Python as a machine learning platform actually makes a lot of sense for like 99% of use cases
|
# ? Feb 6, 2021 01:49 |
|
fritz posted:Found the poster who doesn't remember matlab. I got started long enough ago that matlab was the only choice, but most of the people who do ML don't remember those days at all.
|
# ? Feb 6, 2021 01:57 |
|
I don't think it is wrong, gradual typing tends to be at best performance neutral, and negative when you end up having runtime checks.
|
# ? Feb 6, 2021 02:55 |
|
xtal posted:This is the opposite of true, because a static language can opt in to having dynamic types where needed but a dynamic one always pays the runtime costs. Dynamic languages can have type checkers that don't impact runtime.
|
# ? Feb 6, 2021 03:34 |
|
more falafel please posted:We did Basic and then C++, but it was the APCS "C with a string class" C++ QBasic then Turbo Pascal for me.
|
# ? Feb 6, 2021 03:41 |
|
DaTroof posted:Dynamic languages can have type checkers that don't impact runtime. I am confused. But the definition of dynamic languages and run time is that if a language is dynamic, that type is checked at run-time, whatever time is taking to evaluating the type at runtime, that time is lost. Where a compiler have to do the same evaluation, but since is on compile time, is zero on run-time. ((( Except on some fancy dynamic OOP stuff that may recreate the same effect a dynamic language. ))) Is not this like saying. "Writting some code that will be interpreted before is executed ==( has fast )== Executing some code in the native language". That the impact of the interpreter is zero !? Tei fucked around with this message at 10:38 on Feb 6, 2021 |
# ? Feb 6, 2021 10:36 |
|
Tei posted:I am confused. I'm thinking of type checkers as diagnostic tools, not type checking performed at runtime. Like mypy for Python, solargraph for Ruby, dialyzer for Elixir, etc.
|
# ? Feb 6, 2021 12:54 |
|
|
# ? Jun 6, 2024 02:24 |
|
Python has a runtime type checking penalty even if you don't use type annotations. Both in the form of checking to make sure that the methods you call actually exist and in the form of explicit isinstance() checks in the code to make up for the lack of type safety. Static typing is good.
|
# ? Feb 6, 2021 15:21 |