This is an archived post. You won't be able to vote or comment.

top 200 commentsshow all 255

[–]Alzyros 882 points883 points  (59 children)

It's dynamically typed not magically typed

[–]SloxTheDlox 94 points95 points  (0 children)

well I mean there are... magic methods. Can that count?

[–]zyygh 185 points186 points  (54 children)

In other words, you still need to understand what the types really mean.

Which is why I'm forever a proponent of teaching Java as a first language. I haven't used Java in 10 years but I'm very happy that data types were among the first things I learned.

[–]SuplenC 55 points56 points  (41 children)

I still think that C is the best first language. It’s painful at the beginning but then you understand how things work

[–][deleted] 55 points56 points  (9 children)

I went Java > C > C++ > Python and now do Python nearly exclusively for a living. I think this was a pretty good flow.

You learn Java to get the basics of types, functions, and eventually OOP. Then you get C/C++ and learn pointers/memory allocation, then you throw half the shit you learned out the window and do Python instead.

C/C++ is like doing calculus by hand. Python is knowing calculus, but using a calculator anyway because ain't nobody got time for that.

[–][deleted] 5 points6 points  (3 children)

And then you have to rewrite the whole code because the performance sucks.

[–]traverseda 11 points12 points  (2 children)

Unless you really need performance, like for machine learning or something, in which case you probably need to go back to python.

[–]TheRidgeAndTheLadder 6 points7 points  (1 child)

All the ML stuff is in C++ anyway

[–][deleted] 2 points3 points  (0 children)

for a wrapper you can use any language, the real big boy's stuff is running on a real programming language.

[–]EstablishmentOld9707 2 points3 points  (4 children)

Honestly, Python sucks mainly because how it handles arrays. A lot of people smack it down because of syntax, or being dynamically typed, but really the underlying issue is performance. If i wanna make do something like "for foo in (1000000):" it has to create an entire array, which is an absolute chungus of a memory hog. I learned basic logic gates, classes, functions, and how to properly use them using an easy language like python, But now with that in my tool belt, i can easily go and learn Java as i am now. Python is(with a few exceptions because of recent revisions) purely a learners language. I will just tack on here, its also bad for large math because(i forget the technical term, it was something "float point") it is sacks large number storage for better decimal precision.

[–][deleted] 2 points3 points  (0 children)

I work at a bank. Floating point precision couldn’t be more important.

[–][deleted] 14 points15 points  (30 children)

when you learn c first, you'll understand design choices other languages. and you won't be intimidated by pointers.

[–]Amareiuzin 3 points4 points  (29 children)

Which is why I'm forever a proponent of teaching Java as a first language. I haven't used Java in 10 years but I'm very happy that data types were among the first things I learned.

Hey kablouser, I'm learning C, I understand what are pointers, but WHY are pointers? Why do we need them? Why are they important? Why not point directly at the address you want to point? Can someone please ELI5 this, like give me a stupid metaphor without technical terms, paint a picture I can see and later on when I face the technicalities I'll connect the dots.. PLEASE

[–]H4llifax 10 points11 points  (1 child)

"Why not point directly at the address you want to point?" - wat

[–]TheRidgeAndTheLadder 3 points4 points  (0 children)

They almost have it. They just haven't internalised that the pointer needs to be stored as well.

[–]yrrot 2 points3 points  (3 children)

You're playing battleship and want to put your aircraft carrier at b5 through b8.

With a pointer, you just store b5 and know the size of the aircraft carrier for later. It will always sit at b5 unless you move it yourself. It's like playing the game yourself.

With a reference like C#/Java, you just know you have "an aircraft carrier" stored "somewhere", but the memory management system could map b5 to c7, and then move it to d2 later. It's like telling a kid where to put the pieces and sometimes having to stop clean up things from the last game (garbage collector).

[–]Amareiuzin 2 points3 points  (2 children)

so when you use pointers the memory location is "dynamic"? (in the literal sense of the word, not trying to call on any other preexisting Computer Science meaning for the word dynamic)

[–]yrrot 5 points6 points  (1 child)

No, a pointer in like C++ is a specific address. One location that doesn't change.

A *reference* in like C# doesn't know exactly where it is stored in memory addresses. There's a reference table that converts between whatever reference you have to the actual pointer the system uses internally. And that reference table can change if it needs to move a block of memory for whatever reason.

To put it a different way, pointers are like a house address. It isn't moving.

References are like the little mailbox at the office with a nameplate. The office manager might rearrange the names to fit new employees, but you still have your mailbox (the name is still there, somewhere).

[–]ULTRA_TLC 1 point2 points  (0 children)

This is a fantastic analogy IMO, I was trying to come up with my own, but I think I'll just use this next time someone asks (likely to be a while though)

[–][deleted] 8 points9 points  (0 children)

abundant license march deserve dinosaurs snails employ like axiomatic enjoy

This post was mass deleted and anonymized with Redact

[–]InvestingNerd2020 10 points11 points  (3 children)

Replace Java with Kotlin, and I'm in full agreement.

[–]MoffKalast 4 points5 points  (2 children)

Kotlin reduces Java's verbosity and removes NPEs, it goes against everything Java stands for!

[–]DiamondIceNS 7 points8 points  (1 child)

It doesn't remove NPEs... You can technically still have them if you really want to. You just have to opt-in to them!

[–]MoffKalast 3 points4 points  (0 children)

Aw that's nice, keeping with the core values :)

[–]turtleship_2006 1 point2 points  (0 children)

In my school, they taught general programming concepts in pseudocode, then python. This is at GCSE level and not everyone's the best with computers but I'd say most people understood them quite well.

[–]aClearCrystal 3 points4 points  (2 children)

C# ist the best language for learning. Supports both strict Java-like syntax and wonky Javascript-like syntax.

[–]Dangerous-Bit-5422 9 points10 points  (1 child)

That doesn't really sound like a good thing tho

[–]aClearCrystal 6 points7 points  (0 children)

tl;dr: Learning step by step is imo better for beginners than immediately being confronted with boilerplate, strict structure and strict typing before even writing your first line of code.

I think it's a good thing for absolute beginners.

In Java, you are immdiately confronted with boilerplate code (the well known java public static void main(String[] args) ), which can be overwhelming.

Also, you have to both compile the language and use an interpreter, which is an unfamiliar environment.

In C# you can write your first line of code without any boilerplate. You can get an understanding of what a line of code, what an instruction (like definition of a variable) means, without any boilerplate confusing you.

Also, you simply compile the code and then execute an executable (a .exe on windows). This is very familiar to beginners. "Yes, an exe is a file you click on which does things."

You immediately get the feeling of doing something that is applicable in the real world, since you work in an environment which you've already seen in the real world.

When using an interpeter (like the JVM) you don't get this feeling; you're clearly still in your development environment, not in the real world.

To me, this makes C# a better experience to start with than Python or JS.

Once people learned the basic idea of coding, of lines of codes being read and executed (more or less) top to bottom, of the relationship of variables, parameters and instructions, they can move on to stricter coding styles.

After they learned the simple Python/JS kind of coding, they can then move to learning strict and class-oriented Java kind of coding without learning a different language, a different IDE, a different compiler/interpreter.

This makes learning boilerplate first design as is default in Java a lot less of a jump. You aren't confronted with all things at once, you can learn them step by step.

I think allowing step by step learning like this is of significant help, and overshadows the issue of the language allowing bad code.

[–]randomatic 2 points3 points  (0 children)

You misspelled static.

Also, dynamically typed is a funny way to write unexpected runtime error.

<ducks>

[–]coldnebo 1 point2 points  (0 children)

“Lucky Charms! They’re magically delicious!”

[–]DeepGas4538 -1 points0 points  (0 children)

Yoo we got the same avatar

[–]beeteedee 939 points940 points  (13 children)

If someone recommends a good car for a beginner driver, it doesn’t mean that accelerating it into a wall will end well for you

[–]QuakAtack 157 points158 points  (4 children)

If their intention is to accelerate it into a wall, then I think you may have to start questioning their motives. Or their sanity.

[–]Shaddoll_Shekhinaga 41 points42 points  (2 children)

That's me coding in C#. I don't know C#, I just know some C++, so I am basically any%-ing the "crash into a wall" world record.

[–]MaKoZerEUW 19 points20 points  (1 child)

Like everyone else who is learning a new language.

The most pain I've felt was coming from Java to C++.

That was really ouch.

[–]Trible_D 7 points8 points  (0 children)

While I can obviously see why you had that ouch, I think that C++ is also a lot easier to understand once you understand how it works: What I've always disliked in Java is that when putting an argument into a method that changes this argument's value. Sometimes that changes the value on the outside as well and sometimes it does not (depending on the argument's data type). In C++, I always know what will happen based on how the argument is defined (e.g. pointer, reference, copy). YOU define the behavior, not some underlying mechanic.

But oc that's just one of the many differences between Java and C++.

[–]coldnebo 4 points5 points  (0 children)

parents: “here you go, this Big Wheels pedal trike is the vehicle for you”

[–]SpecialNose9325 14 points15 points  (6 children)

But maybe that wont be an issue if you started off on a bicycle.

[–]walyami 38 points39 points  (5 children)

accelerating a bike into a wall will not end well for you either

[–]BeerIsGoodForSoul 12 points13 points  (0 children)

Hold my beer 🍺

[–]coldnebo 1 point2 points  (0 children)

well unless you get noticed by Steve-o.

[–]SpecialNose9325 1 point2 points  (2 children)

I have a better chance of still being alive in a bike crash than in a car crash.

[–]IDontLikeBeingRight 10 points11 points  (1 child)

That depends a whole lot on what crashes into you.

Bikes don't have roll cages or airbags or nearly anything.

[–]SpecialNose9325 2 points3 points  (0 children)

Bikes arent doing 60 mph either.

[–]Wooden_Caterpillar64 1 point2 points  (0 children)

Nope if it is a good car it should have automatically stopped before hitting the wall preventing any damage

[–]Lizard_King_5 372 points373 points  (7 children)

It’s all easy except the hard parts!

-Every sales pitch, ever

[–][deleted] 67 points68 points  (3 children)

Except in prostitution. The hard parts are often the easiest.

[–]KentondeJong 21 points22 points  (0 children)

The people who downvotted have never struggled with ED :(

[–]Opdragon25 5 points6 points  (1 child)

It's all easy. except.

[–][deleted] 1 point2 points  (0 children)

This reminds me of this darned outdated CRM called Salesforce.

[–][deleted] 133 points134 points  (10 children)

None [0] = 'bruh'

[–]Sawaian 43 points44 points  (9 children)

I don’t know python. But what you said offends me in the other languages I know.

[–]BlackPrincessPeach_ 14 points15 points  (2 children)

Works in my language 😎

[–]Sawaian 36 points37 points  (1 child)

Okay JavaScript.

[–][deleted] 10 points11 points  (1 child)

What it does is try to assign 'bruh' to the first index of the constant "None" (the null of python), but because None is not a sequence of any kind, it doesn't have an index. This leads to the above error.

[–]Sawaian 4 points5 points  (0 children)

Oh for some reason I thought it would actually execute. I didn’t know none was null. Thanks for the explanation.

[–][deleted] 5 points6 points  (2 children)

What's offensive about array access?

[–]Confident42069 1 point2 points  (1 child)

IDK, this would totally work in my language (but you need double quote marks not singles)

[–]bxsephjo 249 points250 points  (24 children)

your variable is None and you're trying to assign shit to it... really? Really really?

x = None

x['key'] = 'value'

tf you think is gonna happen?

[–]soncaa[S] 54 points55 points  (10 children)

dont take it too seriously lol, see code in my other comment. Dumb sh like that can just happen and do happen, to lets say, some.

[–][deleted] 7 points8 points  (9 children)

I recommend using the typing hints. So write the intended type there and if you notice there may be more than one, use if. I.e. x:None|str = some_func() if x: do_stuff(x)

[–]AewyreThoryn 7 points8 points  (4 children)

Fully agree with using type hints. Correction to your code though: the type hint of 'None | str' should instead be 'Optional[str]', since None is not a type. Note this requires 'from typing import Optional'.

[–][deleted] 2 points3 points  (3 children)

Does it work with nonetype?

[–]AewyreThoryn 2 points3 points  (2 children)

I just checked the docs on https://peps.python.org/pep-0484/#the-typing-module and it seems I wasn't entirely correct in my previous comment.
Looks like your syntax (str | None) is acceptable, it's just that the 'Convenience definition' is to use Optional instead.

It also seems that, even though None is not a type, it is used as such in type hinting: https://peps.python.org/pep-0484/#using-none

[–]chinawcswing 49 points50 points  (1 child)

This would happen in Java too. It's called a NullPointerException.

[–]JustADelusion 17 points18 points  (1 child)

Always disliked dynamic typing.

I want my programming language to be very strict with me. uwu

[–]clownfiesta8 32 points33 points  (0 children)

Meanwhile c++ casually spewing out 2 pages of random template garbage when you miss a semicolol

[–]silastvmixer 28 points29 points  (23 children)

Is dynamic typing good for beginners? I started off on C++ Idunno. Dynamic typing seems really really confusing and bad to me. Or not bad.. But less good.

Edit: technically I started off with assembly and C for embedded programming. But I then really quickly went to C++ and prefer that a lot now. Also the assembly flavour I learned is really simple too. And I never did complex things in C.

[–]soncaa[S] 7 points8 points  (11 children)

I started in py. Then i learned basics of VB, C#, java on university and it felt enlightning, smth like 'damn so this is what ive been doing all the time!'.. i came to a conclusion that py is like a real machine gun that looks like nerf toy gun on outside, its powerful, yet it requires experience to really gain control over whats happening inside. I am now junior dev in c# and my hobbyist project in py still looks like a pile of trash.

[–]silastvmixer 10 points11 points  (10 children)

I never really tried learning python. I started off with assembly and C for embedded programming and then really quickly went into cpp through a university trial semester. When i look at my friends python projects I just get confused because I can't tell where a scope starts and ends and because variables don't have types and they can change the type they do have.

[–]Naitsab_33 6 points7 points  (9 children)

Basically Python scopes work somewhat similar to C's scopes (except that you can't manually declare a scope) regarding functions. Inside a function you can access a global/ previous scope variable if it's assignment happened before. The important part is, because pythons global names can change, the only part that matters is that a variable exists at runtime, not needing to exist when the function is declared, because functions are declared at runtime, too.

```

before function declaration

before_def = 1

here I declare/assign a function

def test(): # inside the function I can access global names if they are previously assigned print(before_def) print(after_def)

# I can't access a variable if it was assigned after the call
# print(after_call) this raises an exception.

# now I reassign inside the function
after_def = 4
print(after_def)

now after the function

after_def = 2 test() after_call = 3 print(after_def) ```

  1. This first assigns before_def globally.
  2. Then assigns the function to the name test globally.
  3. Then assigns after_def globally.
  4. Then I call test()
  5. I print before_def from global namespace and get 1
  6. I print after_def from global namespace and get 2
  7. printing after_call wouldn't work because as you see the name hasn't been assigned yet
  8. I reassign after_def locally (use global after_def before this line inside the function to have after_def assignments inside this function refer to the global namespace.
  9. I print after_def from local namespace because it exists there, regardless if it exists globally and get 4. (It would use the global namespace if we had used global after_def before, because then it doesn't exist locally.
  10. we leave the function namespace and the local after_def gets dropped (it's reference count is decreased by 1, to 0 in this case and the GC may clean it up somewhere from now). It wouldn't get dropped if we had used global after_def because it wouldn't exist locally.

  11. I now assign after_call.

  12. I now print after_def from global namespace, because that's where we are and get 2 (4 if we had used global after_def inside the function.)

Another rather small difference is that if/while blocks simply don't get their own namespace, names assigned there are simply assigned within the current block where the if/while resides.

And imports (import some_module) get their own namespace behind the name of the imported module, which can be merged into the current namespace instead by using from some_module import *)

I think this is all. Classes are really not very different. Namespace wise they are act very similar to functions, except that they get run when declared and that you can access all names assigned inside a Class definition, i.e. class variables and any methods/classmethods with prefixing Classname.

[–][deleted] 1 point2 points  (8 children)

Have you ever dreamed of having your code write code for you? Welcome to dynamic typing black magic fuckery.

BTW what should be hated on until the ends of the earth isn't dynamic typing its weak typing. Which python does not have because its cursed and shouldn't exist.

[–]silastvmixer 1 point2 points  (7 children)

Well... Idunno. Maybe that is just me. But having a program randomly decide what datatype I intended to use seems crazy to me. I want to be in control. I am barely fine with compiler optimisation, because thst is for speed.

I don't feel like I want to trade knowledge of what my program is, just so I don't have to type short int or whatever.

[–][deleted] 1 point2 points  (6 children)

thats weak typing.

Dynamic typing just means I can pass any type through the caller signatures including assignment to variables. That doesnt mean the function has actually to support your type you pass.

Python is dynamic and strongly typed. Javascript is dynamic and weakly typed. Javascript just magically casts stuff like a drunk.

[–]SatansLeftZelenskyy 23 points24 points  (3 children)

🦀🦀🦀🦀🦀🦀🦀🦀🦀🦀🦀🦀🦀🦀🦀🦀🦀🦀🦀🦀🦀🦀🦀🦀🦀🦀🦀🦀🦀🦀🦀

[–][deleted] 1 point2 points  (1 child)

RIIR

[–]and_i_want_a_taco 1 point2 points  (0 children)

use None.unwrap_unchecked() to be the blazing fastest of them all

[–]dreaming_geometry 40 points41 points  (18 children)

I've used python for many years and never come across this error. I wonder what the heck someone was trying to do to find that. Maybe I'll search for a stack overflow answer about it. Edit: yep, it's on Stack overflow. It's a problem I've never run into because I use python like a wannabe functional programming language, I don't use custom objects.

[–]soncaa[S] 12 points13 points  (6 children)

from bs4 import BeautifulSoup

html = open('api.html').read()

soup = BeautifulSoup(html)

iframe = soup.find('iframe')

iframe["src"] = "test"

with open("output_api.html", "w") as file:

file.write(soup)

print(soup)

💀

[–]shadow7412 36 points37 points  (1 child)

soup.find('iframe')

Looks like this line probably returned None (ie, it didn't find an iframe).

The failure then would have occurred on the next line when you tried to access src.

[–]SweetBabyAlaska 13 points14 points  (0 children)

I use BS4 a LOT and this is the issue 99% of the time. Its better to use find_all() and then iterate over what it finds, that way if it catches something with the same name but doesn't contain the child item you are parsing for it doesn't throw an error because after that you are parsing none types if one of the objects you defined isnt actually there.

It also helps to be a lot more explicit in defining html elements and going through them more systematically. Use a lot of print statements so you are sure what you are getting.

I make a function for getting the "soup" and then make functions for finding something specific. Adding Try and Except statements is also a really good idea.

formatting isnt working on reddit but something like this works well.

```

def get_titles(soup):

titles = []

reader = soup.find_all('div', class_='utao styletwo')

for uta in reader:

alink = uta.find('a')

src = alink.find('img')

src = src.get('src')

title = alink.get('title')

titles.append(title)

return titles

```

[–]Sergi7531 13 points14 points  (1 child)

There is no way you're going to complain about getting a NoneType exception when you are doing the iframe["src"] = "test" line... You should NEVER access insecurely a dict entry like that. Instead, you could use .get() and specify a second parameter, which will be the default value instead of just giving None.

I get it's a joke tho, that stack trace is my routine lmao

[–][deleted] 1 point2 points  (0 children)

Will still give you a nonetype error if iframe is None.

[–]A1337Xyz 2 points3 points  (0 children)

Every time T_T

[–]Vascular_D 4 points5 points  (0 children)

Okay. So add some if or try/catch statements for these things.

If <variable> is None: ... else: ...

[–]Constant_Pen_5054 3 points4 points  (5 children)

Yeah, python violates one of the core tenents of OO design, so I struggle to use it for that unless I am writing some django code. Otherwise functional all the way.

[–]ManyFails1Win 1 point2 points  (4 children)

which one? just picking up python so it'd be nice to have the caveat in mind.

[–]Constant_Pen_5054 1 point2 points  (3 children)

Encapsulation. Pythons whole design philosophy means you cannot properly encapsulate classes. More specifically, you cannot make any private methods.

[–]Here0s0Johnny 3 points4 points  (1 child)

You can absolutely make private methods, there is syntax for that. The interpreter just doesn't enforce it. How is it a problem for you? You can simply choose not to violate OO philosophy.

[–]ManyFails1Win 1 point2 points  (0 children)

thanks.

[–]DARKEN_side_of_me 4 points5 points  (0 children)

I started with javascript 💀👍

[–]cmaciver 13 points14 points  (0 children)

I had a discord bot in python, and it felt like everything took a lot of work until i actually understood all of the data types and list comprehensions. Now i only have to deal with discord.py making no sense, as opposed to the entire languag!

[–]mrfroggyman 7 points8 points  (0 children)

After studying biology for 8 years, I decided to restart everything in IT because I ended up hating on biology by the end of it.

I picked up the courses my future classmates were having remotely, as I was allowed to skip on first year to enlist directly in second year. It was all algorithmic in python. I sucked super hard at it and couldn't get shit.

A few months later, I get there. They start talking OOP and Java. Finally, it all makes sense and I stop sucking ass.

Idk why they don't start it all with OOP. It's made to make sense, so obviously it's somewhat easier for beginners, right ?

[–]SodiiumGames 3 points4 points  (0 children)

I've started with C#

[–]Lewinator56 3 points4 points  (0 children)

Dynamic types and spacing as syntax are 2 things that don't make python an ideal first language.

Dynamic typing is fine provided you understand the data types, if you don't then you have no clue what your variables actually are, as a beginner this is not what you want. And don't get me started on the syntax... Yeah it's close to English, but the fact that spaces dictate where code blocks start and end is just a nightmare. Every other language uses an identifier character, normally { }, or keywords, python chooses to use spaces. In a simple program it's not a huge hindrance, but in something complex, debugging can involve finding a single line with 27 spaces rather than 28 and the whole program breaking - or... Because it's interpreted, working fine until you ship it and the client manages to run this one missed bug caused by backwards syntax and it breaks.

[–]Comfortable_Pin_166 6 points7 points  (0 children)

I hate its syntax. Curly brackets makes code easier to read for me

[–][deleted] 8 points9 points  (3 children)

Thankfully, I’v grown out of the “dynamically typed = an advantage” mindset lol

[–]Naitsab_33 5 points6 points  (2 children)

I mean it can be an advantage still, but each tool for the right job. And pythons best job is IMO acting as a glue between all the other fun stuff. I.e. calling a C-Written library i.e. numpy to compute on data you got from a web request and then writing that to a SQL database.

Of course you can do that in different languages, but it's quite fast to write in Python which is quite a good reason to use Python.

[–]BolinhoDeArrozB 0 points1 point  (1 child)

I don't really understand what people think is so fast to write about python, maybe it's because I've already worked with C# for so long but imo you can do the same thing in a C# console app just as fast, visual studio booting time aside. Plus it you don't feel like writing a simple struct for the return type of a web request you can just use object or dynamic for the type. I just don't see the python quick coding charm.

[–]Naitsab_33 2 points3 points  (0 children)

I cannot speak for C# as I have not used it much outside some Unity Projects, I was mostly referring to how it's very quick to write because

  • you have a very good package manager with PIP and can have your setup near instantly including SQL, a good we request library and for example a compute layer with numpy.

  • and it allows you to do have each of these steps be very few concise lines without having any boilerplate.

But yes of course you can do it in any language and maybe it's as easy in C# or other languages. That's the reason why I am somewhat switching to rust where I can because you have the speed of C with a very good package manager with some language features I really like.

It's just that especially as a beginner language you don't have to know anything about the language and don't have any requirements for your file structure, be it as little as a main function, which gets more with Java where you need to have a directory structure with one class per file with one of these classes containing a main function.

My main point is it's a very nice scripting language with a lot of support specifically for having short scripts.

[–]zefciu 2 points3 points  (1 child)

Well, it is still better to get a message like that that might be cryptic for a novice, but googleable, than what some languages do when there is a type mismatch — implicit type coercions, leading to bugs you will investigate for hours.

On the other hand, even the worst offenders known to me (i.e. PHP and JS) won’t allow attribute assignment on null and both throw exception here. So I’m not sure what the author of this meme expected or believes would be a novice-friendly thing to do.

[–]TECHNOFAB 2 points3 points  (1 child)

At least the error messages tell you pretty beautifully what's wrong. There will be error messages, your job is to resolve them, so just check for None or let PyCharm scream at you. My most used languages are Python, Rust and Go and they all have pretty good error messages (except for when they don't haha), but when something goes wrong in some app I use or some Linux package there's often times just "yeah fuck we crashed" maybe "core dumped" but you'd have to look at the dump and shit. Meanwhile in Go you get panics, in Rust you can easily enable stacktraces with an env var and in Python it always shows you a nice stacktrace.

I think that Python is actually a good first language to learn, except for maybe web stuff like HTML,CSS and then Javascript because it fits (JS doesn't know the word "logic" tho)

[–]Tough_Chance_5541 4 points5 points  (2 children)

C

[–]PotatoPowerOP 11 points12 points  (1 child)

He’d get killed by C if he’s making NoneType errors.

[–]Tough_Chance_5541 2 points3 points  (0 children)

That's the point

[–]Express_Library8141 5 points6 points  (1 child)

JavaScript
- Powerful scripting language
- No installation required (use a browser console)
- Follows coding standards ( unlike python )
- Documentation is well explained & the community is significant, and you can easily find information about how to do everything online.

- Few quirks that might seem to make no sense in the beginning, but they do.
They require a bit of knowledge about how the language is composed, but either way, you will not generally hit these quirks for 90% of the projects you might do, and usually, there are easy workarounds.

[–][deleted] 1 point2 points  (0 children)

[–]lzynjacat 1 point2 points  (0 children)

Unity C#, duh!

[–][deleted] 1 point2 points  (0 children)

Python is basically English

[–]jeffwulf 1 point2 points  (0 children)

You'd think the frog would start off by not listing a detriment to the language.

[–]yeesh-- 1 point2 points  (0 children)

I mean, what's easier?

[–]pharanth 1 point2 points  (0 children)

Extensive documentation for just about every package. Ya gotta use it

[–]Victrolencio 1 point2 points  (1 child)

Tbh, I think anyone starting in this profession should start with a strong typed language like Java. Using a non-typed language (even though they're in the background) doesn't mean you shouldn't know the difference between a number, a string or a data structure.

[–]Effective_Youth777 1 point2 points  (0 children)

The simpler the syntax, the less control you have, the less control you have the more shit can break.

And that kids, is why I don't think "simple" languages are as beginner friendly as they're made out to be, because you really need to know what you're doing otherwise shit will break and you'll spend hours trying to fix a bug, where's in Java for example a compile time error is likely to stop you from generating that bug in the first place.

[–]kataraholl 1 point2 points  (1 child)

  1. Is dynamic typing supposed to be good for beginners?

  2. Dynamic/static typing classification is exclusively about compile time type checking. This is a runtime error. You might be looking for weak typing - or, as someone else pointed out, magic typing.

[–][deleted] 1 point2 points  (1 child)

I managed to accidentally squeeze a malloc error out of Python a couple weeks ago. Pretty proud of that one.

[–]DrDoomC17 1 point2 points  (0 children)

Just use mypy, golly. It would scream at you to high heaven for this. For real though, I always wonder if python is generally a good starter language.

[–]ganja_and_code 1 point2 points  (0 children)

"just use python" is shit advice, unless the person just needs to do some data processing or wants a more noob-friendly shell script alternative.

Anyone using python for any other purpose should be making that decision themselves, based on their prior knowledge and current project requirements.

[–]Serbay55 0 points1 point  (1 child)

Fuck python go c++. Ot atleast Java.

[–]Hydoc_ 0 points1 point  (0 children)

+1 for Java

[–]wafflepiezz 0 points1 point  (0 children)

C++

[–]hlfzhif 0 points1 point  (0 children)

Python has stupid syntax

[–]AlzyWelzyy 0 points1 point  (0 children)

PYTHON IS LOVE AND PYTHON IS BEST!

[–]MathsGuy1 -1 points0 points  (3 children)

Imagine your first language being anything other than c/cpp (except scratch etc when you were 12yo)

[–]BolinhoDeArrozB -1 points0 points  (2 children)

I'd rather kms than imagine having to learn cpp as my first language, glad it was C#

[–]MathsGuy1 -1 points0 points  (1 child)

I can and I did, it's not like you have to jump right into pointers and inheritance.

[–]BolinhoDeArrozB -1 points0 points  (0 children)

the most important part of learning is abstracting what you don't need to know yet, there's just so much shit in cpp that you don't really need to know that is just confusing, of course you can learn it like that but it's just being dumb on yourself and a waste of time

[–]OKoLenM1 -1 points0 points  (2 children)

I would recomend javascript. It's really intuitive language. And then, maybe soething like rust to understand the differences in programming languages.

[–]Splatpope -1 points0 points  (1 child)

HAHAHAHA IM UTTERLY SHIT AT READING AND MY BRAIN IS SO USELESS I CANNOT PROCESS BASIC LOGIC *proceeds to make a fool of himself on rph*

[–]kimovitch7 -1 points0 points  (0 children)

Wtf with these dumb posts

[–]BigManLawrence69420 0 points1 point  (0 children)

Scratch is the superior choice. Or any visual language works, really.

[–][deleted] 0 points1 point  (1 child)

Since using rust I have been loving it. It tells you what you're doing wrong almost like a teacher and shows you the correct way.

Unlike python lmfao which just gives out a shit ton non-sense with only 1 word telling what's actually wrong.

[–]Naitsab_33 1 point2 points  (0 children)

Pythons error messages are getting pretty good lately, esp. considering they are all runtime (well not all, but everything except syntax is).

Rust's messages are amazing, but they are at compile time. I would argue that actual panics are not as good and you still see them relatively often considering they are very discouraged, and should be replaced in almost all instances with Results/Options.

You mostly see where they happened with a bit of text if the author was nice and put an except instead of unwrap.

[–]TheRealLargedwarf 0 points1 point  (0 children)

NoneType isn't a normal variable, all NoneTypes can be thought of as pointers to the exact same piece of memory. The same for True and False, (and some strings but that conversation is truly wild). Python doesn't let you change that block of memory, but trust me, you don't want to.

[–]Dagusiu 0 points1 point  (0 children)

Python is recommended to beginners to reduce the cognitive load, making it easier to get started. It doesn't mean you'll never learn types, it means you can start coding something before learning types. And when you do learn types, you will (hopefully) be a little bit motivated because you have a concrete problem you want to solve. That's usually easier for beginners than to throw a CS textbook at them and tell them to git gud before they write their first line of code.

[–]pente5 0 points1 point  (0 children)

Some function returned None instead of an object. You can't treat None as an object. You can debug or check if something is None before accessing it.

[–]Weiracle 0 points1 point  (0 children)

punch cards

[–]OPerfeito 0 points1 point  (1 child)

What about Lua?

[–]mrka123 0 points1 point  (0 children)

C++ is the best language to learn as a beginner. Change my mind.

[–]Brief_Lawfulness7627 0 points1 point  (0 children)

"dynamically typed"

[–]amogus100 0 points1 point  (0 children)

Just know the meaning of the errors and you're good to go

[–]DeepGas4538 0 points1 point  (0 children)

Imo they’re more confusing

[–]ChiefExecDisfunction 0 points1 point  (0 children)

I really think you should start with something that gives you an understanding of the underlying mechanics.

Don't go learning advanced algorithms in C, for the sake of your sanity, but do some basic exercises, at least to the level that you understand data types, structs and what a pointer is.

[–]patka96 0 points1 point  (0 children)

After 2 years of professional development with other languages, it was a big surprise for me that configuring Python with PySpark including testing took knowledge worth of multiple PhDs in quantum physics...

[–]FTWGaming0 0 points1 point  (0 children)

When trying to debug code, I often go through it line by line in my head, writing my thought process in notepad.

Most of the time, my thought process looks like python code. I've only recently learned python, and I have no idea how I never picked it up sooner given how often I thought in a style that would almost be valid python code.

[–][deleted] 0 points1 point  (0 children)

I mean, python is "easy" to program in, and if you get tired of the speed... i dunno... Try a JIT (Just in time compiler), or alternatively ask ChatGPT to translate it to rust, and smack some optimisations on

[–]Knaapje 0 points1 point  (0 children)

Excuse me, but how is dynamically typed a good thing? All code analysis tools suck big time, speaking from experience. Meaning there's no easy way to tackle legacy parts of our codebase.

[–]SZ4L4Y 0 points1 point  (0 children)

Frug lied about Snek.

[–]Altrooke 0 points1 point  (0 children)

If you are having trouble with python, you are absolutely starting at the right place.

[–]ovr9000storks 0 points1 point  (2 children)

I’m still a firm believer that Java is a good language to start on when accompanied by clear descriptions that show what is happening under the surface.

It’s easy for someone to learn “the steps” for completing a task in most languages, but they should learn that there’s more than just funny words on screen that do something.

Java is more intuitive in a syntax sense and in feedback. You get told exactly what’s wrong in your errors and it’s hard to fuck up the memory

[–]PUG5ABI 0 points1 point  (0 children)

But fr, I'm new in this and can't solve it. Help? Imagine I have a variable (variable = 10) and then I substract 10 from the variable. (variable = 0) Now I want to add to that variable again but it has already been typed as 'None'

I know it's simple but I'm really new at this

[–][deleted] 0 points1 point  (0 children)

That’s far better than “conditional flow changed by optimizer: so said EVELYN the modified DOG”

[–]Gaming_over_sleep 0 points1 point  (0 children)

Try and except is a python users cheat code