#pedagogy
1 messages · Page 1 of 1 (latest)
!eval await message.channel.send("hi")
@north agate :x: Your 3.11 eval job has completed with return code 1.
001 | File "<string>", line 1
002 | SyntaxError: 'await' outside function
?
Are you looking for #bot-commands or #discord-bots ?
iam just doing nothing here 😄
Btw, you cannot run the bot through the eval
oh ok
I know, but this is not the channel for that
sorry
and i need help, is this server helpfull for me? Because i need help only in discord.py 😄
Check out #discord-bots
okay thanks 🙂
@weak mortar your question was off-topic, so I had to remove it. Take a look at the resources page on our website.
Thoughts on what's happening with the Python documentation and https://diataxis.fr/ ?
The Diátaxis framework solves the problem of structure in technical documentation, making it easier to create, maintain and use.
Elaborate?
You can read about a workshop being held, here: https://mail.python.org/archives/list/python-dev@python.org/thread/UVRJS5PD3YRY6CH3L73NQ25LMSFU5C56/
Python's documentation is considering switching to that, Tl;Dr.
do you have thoughts on it?
I think this is a nice step in the right direction. The docs currently feel very scattered and there's holes of knowledge making the official docs hard to navigate and unrewarding.
The standard library section and data model page are the only two parts of the documentation I reliably use.
This, compared to other languages, where I can usually Google something and get the official docs answering my question as a first result.
I am hoping this helps put into words how and where things should be written
The docs definitely need an improvement in both SEO and content density
Although on the insignificant and petty side of things, I really hope they keep the design of the site if they switch over - I much prefer the old peps.python.org design to the current one
I'm not a fan of peps.python.org design (feels too horizontally smushed) but i do like that diataxis.fr
Hello everybody, how are u all doing?
I'm doing a project about Python, and I would like to know about you, the community, what do you think about the language today?
-
Is it good for beginners? And for advanced programmers?
-
What about the community? Is it still active and helpful?
-
What you think about Python, personally?
Thank you 😁
this channel is for discussion about how to teach computer science, but you could ask your question in #python-discussion
Oh, ok thank you, sorry about that 😀
-
some people say "python is easy", but this overlooks an interesting consideration: Python is actually a lot more complicated than C, which is a "difficult" language. So it's more specific to say that Python has a gradual leaning curve.
-
You're in the largest and most active discord community for a specific programming language. Do with that what you will.
-
I like it.
Sorry 
For those of you self-taught learners who **hate videos 😠 , found this cool new website that has some text-based tutorials that are in VS Code. It's called ** SideGuide. They have a python course coming out soon, so just wanted let those of you know who might have trouble learning from YouTube or Udemy!
Do you have a stake in the success of that platform?
hi, any good ressouces on "teaching to programm to absolute noobs"?
!resources
The Resources page on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.
One of my friends asked me to teach him python, but I completely forgot about the basics and started by the "complex", without teaching variables, primitive types and things like so. I need some help on helping too \😂
Hello everybody ! I am seeking help here because I'm trying to run a script only if the contents of a certain file changed but I can't figure it out. Would you mind helping me ? 🥺
I don't want to check the update of a file, it's more a question of comparing the content before and after.
I can't use my pip, can someone help me, it just says that I don't have it, but I have all the files, and that's why I can't use the labs
this channel is about teaching others to program, for pip issues #❓|how-to-get-help
this channel is about teaching others to program, for issues #❓|how-to-get-help
For discussion about teaching, rather than for teaching itself, that is
hey
i just started doing python yesterday
and the only thing i can do is print stuff, any tips ?
Learn more? What kind of tips are you looking for in an unrelated channel like this one
!resources
hey this is a channel for people that want to teach programming, not for being taught programming. But here are some useful resources.
The Resources page on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.
in my opinion, the advantage that Java has over Python pedagogically is static typing, because I think it's better to become type-aware sooner than later.
Beyond that, I think Java is an absolutely terrible first language. If you write a beginner hello world program, almost none of the code on the screen makes any sense to a beginner (public static void main string args? system out?), and even if we take for granted that there are benefits to Java's approach to OOP, none of them are obvious or relevant to beginners.
Continue the discussion.
i agree, i think the lack of static typing is probably the one thing i don't like about python for beginners. being forced to think about the type of variable you're using makes it very hard to run into certain issues, for example
x = input("put a number")
if x < 3:
...
``` is a common problem that you see on the server, which is pretty much impossible in java (or other statically typed languages)
`String input = scanner.nextLine();`
since there's no misconception about what type something is
I agree, but I'm going to push back to make the discussion more interesting.
!e
x = 'hi'
print(x < 3)
@misty dirge :x: Your 3.11 eval job has completed with return code 1.
001 | Traceback (most recent call last):
002 | File "<string>", line 2, in <module>
003 | TypeError: '<' not supported between instances of 'str' and 'int'
The error message makes it pretty clear what the problem is, so when beginners see this and throw their hands up, I think the problem is that they feel intimidated by the new skill that they're trying to learn.
also in a statically typed lang
let inp = System.Console.ReadLine()
inp > 3
inp > 3
------^
stdin(3,5): error FS0001: This expression was expected to have type
'string'
but here has type
'int'
what language is this?
F#
why is that a--nevermind
my point definitely only applies to languages where the type is declared as you declare/define the variable. in languages where type inference is the norm, this probably isn't true
I wouldnt want to teach a newbie about types the way they do in other languages tbh just seems like it gets in the way of more important things
same way borrow checker gets in the way, same way other things get in the way
it feels like advanced enough topic that they could learn it on their own once they get comfy enough
i think in this case, the problem is worse, since in a statically typed language, if you did
int x = input() (pseudocode), you'd get an error right on that line, whereas in python with this error, you have to do a little more thinking, "ok, this is a string, why is it a string, etc"
maybe if teachers wanted to teach python while keeping their students aware of the existence of types they could force them to use type hints (?)
the good thing would be that at first those type hints could be omitted and then introduced once students have a better grasp of stuff
I see what you mean, but there'd be nothing to stop the students from writing incorrect type hints.
I can also imagine students writing num: int = input('input a number: ') and being confused
true, but you could grade correct use of type hints the same way you would grad other parts of programming.
Although the students would not have an immediate feedback of whether or not their type hint is correct the same way they would with an error crashing their program
or something that prints the incorrect result, in that case most people would probably realise there's something wrong with their program
Is this really something you or others teach beginners? from other courses i've seen, both python specific and not, types are not really taught to beginners this early
they usually get away with >Think of this as X for now, but in reality its something kinda different
I'd opt for not introducing type hints early on
why
in my introductory course, types were pretty much the first thing we learned. not on a deep level, just enough to get to int x = 10;
one reason is that they aren't enforced, which rules out the benefits of a statically typed language (that being errors or warnings which would prevent the earlier examples of the input).
but thats because theyre a requirement for the language to even compile, if you could skip past that and get to other topics first why wouldnt you?
I personally think there's more value for iteration, flow control, etc before all this
because it leads to issues with people not knowing what types are or what type their variable is
you must have some knowledge of types to program
you handwave them away for more important concepts when you start off, you don't teach kids addition by first proving calculus
it's not like they'll get away with not learning about them
obviously we agree they're important, just deciding when to teach?
type hints would probably be more beneficial to bring in once you have a better understanding of the basics, and are comfortable with the usage of additional tools (like mypy).
Yea I think there's more impactful concepts to go over when you're first starting
With python, how would you teach types before going over what classes are and how to make them
that's my problem with python ig ¯_(ツ)_/¯
Well how would you solve it, pick a different language?
Every language suffers from "forget about this for now, we'll touch on it later" syndrome, some are just more severe
im +++1 on teaching types early and +0 on teaching type hints early
(btw im kinda serious, how would you solve this, asking for a friend)
that's what we were originally talking about, using java or python to teach
So you'd pick java? what about other boilerplate that you have to handwave away
no, i just said i like that java forces you to think about what type your variable is
I feel like you could restructure the curriculum in a way that would explain types properly early on. For example starting in an interactive shell and not with hello world
showing that, like, 10 is an int?
as someone whose first language was java, i didnt really pay any attention to the public classes and the static void mains at all
i just had a "oh so that's what that means" moment later but that's it
start off with just using it as a calculator, then introduce more types gradually
yea i like that
I bet you started off making everything static tho
I think using the repl is a good idea. It allow beginners to see intermediate results, not just the types but the values too
+1, this is also how people learned to use computers that had BASIC shells. First just as a more advanced calculator / interactive line-by-line.
Even starting with structure can be overwhelming, like how in many languages you have to write a function to do anything (e.g. the well known Java public static void main(String[] args) that a beginner needs to chant and ignore until way later).
(Python does not have that issue, but interactive mode makes it even better IMO)
even in java you could probably start with jshell, but I don't think anyone actually tried that yet
I am having problems in doing a project for beginners in python without looking at the answer
Does it mean I need to start learning the syntax again?
it doesn't go without saying that the gaps in your knowledge are specifically with syntax, but if you can't think of how to code solutions to simple problems, you might want to start over with a resource that teaches python from the beginning.
I can do a calculator,create .txt archives,that type of thing
I was having difficulty with binary search três algorithm and the random guess number
then your problem isn't with syntax. it's probably about understanding the problem itself.
@sick pewter this is the channel for talking about how to teach programming. you can only talk about matlab in our off-topic channels.
@misty dirge Hi! Thanks for the reply! I wanted to ask how's the best way of learning/teaching python to someone used to matlab.
I was wondering if there is someone here who made the transition from Matlab to python. I'm looking for some tips/hints/shortcuts
you might try asking in #data-science-and-ml.
@misty dirge Will do. Thanks!
What is the hardest tool to use and learn in software engineering ?
Are backends more skilled than the frontends?
this channel is for discussion about how to teach computer science, but you can open your own help channel from #❓|how-to-get-help
Can someone please rephrase this sentence for me please - having a brain fart:
‘’identifying the objects which will be presented as resources.’’
My ex: looking from x position on a map looking at Sydney Bay Bridge during the evening
is this question on-topic? if not, please go to one of the three off-topic channels.
Arigato!
What are epic ways to learn python? Or atleast fun projects to help develop skills.
When I was learning python I would challenge myself to make simple card or paper games to play against the computer
Thx
I've made blackjack, tic tac toe, rock paper scissors, a maze generator, and some imperfect dice games
If you are interested in any of those I can show you my code
Hey what’s the idea for this channel?
Its about discussion on how to best teach programming, computer science and related concepts and python
I'd definitely be interested in taking a look. I'm writing curriculum now for a middle school Python programming class and am looking for some good projects I can challenge the students with
!e illustrative python sharp corner to teach: ```py
x = [1]
y = [1]
x_id, y_id = id(x), id(y)
x += [2,3]
y = y + [2,3]
print(id(x) == x_id)
print(id(y) == y_id)
@slender cloak :white_check_mark: Your 3.11 eval job has completed with return code 0.
001 | True
002 | False
i think there's a pin in this channel for this
yep
@slender cloak video link that skips to part that discusses about that python sharp corner: https://www.youtube.com/watch?v=_AEJHKGk9ns&t=631s
"Speaker: Ned Batchelder
The behavior of names and values in Python can be confusing. Like many parts of Python, it has an underlying simplicity that can be hard to discern, especially if you are used to other programming languages. Here I'll explain how it all works, and present some facts and myths along the way. Call-by-reference? Call-by-v...
i was on topic im not asking for help
I'm not seeing the connection... how is "Are backends more skilled than the frontends?" related to this channel's topic, the methods and practices of teaching?
Difficulty in the tool and learning , I dont have time for nonsense
Its on topic
frankly your question sounded more like bait for a flamewar, or the title of a spammy youtube video, than for constructive conversation 🤷♂️
to answer the question: no, absolutely not. frontend developers need to learn different tool sets and have different constraints on their problem space, but "skill" is not a factor. regarding difficulty of learning the tools and ecosystem, my personal opinion is that frontend is a lot more complicated and there is more to know in order to achieve basic industry-standard productivity. maybe if you include "databases" in the core backend skillset, it levels the playing field a bit.
regarding the teaching of these skills thereof, you could probably spend one full university course each on "frontend dev" and "backend dev", assuming sufficient pre-requisite knowledge of python, javascript, the basics of html+css, and the basics of databases
It may help if you give more context in your question and its purpose.
You don't have time for what?
If you plan to use the difficulty to make your career choice, then that would be the wrong optimization metric
not sure if the title is referring to teaching others, but is there any standard resources or advice someone could point me too on 'how' to learn new technologies and languages? I don't mean 'read documentation and do projects', though I'm sure that's helpful. I'm looking for something more thorough that I could refer to over time, or maybe just a bit of assigned reading
what is the best way to learn python quickly and efffectively
@mossy scarab there's no absolute way to quantify how quickly you're learning something. you can probably master the basics of Python in a few weeks, but becoming an excellent programmer is something you'd do over a whole career. So don't think about how long things are taking. Focus on maintaining a positive attitude about learning.
Teach others as you get taught. Someone once said the best way to learn is to 1. Learn the content 2. Teach it to a 12 year old 3. Refine and revise 4. Rinse and repeat (probably not exactly the saying but that’s how I remembered it and use it to learn)
How do you reconcile "try it out and see" and "dont run code you dont understand"
Sounds like conflicting advice, how do you explain this to beginners learning not only python but programming in general
Especially online where they might come across innocent looking code that might end up forkbombing their shit to kingdom come
there's two different kinds of "try it and see" questions: "what does this code do?" and "can you do X?" like
"can you use slicing syntax on strings?"
"what happens if you pass too many arguments to a function?"
the latter of course aren't dangerous
i guess it does take some experience too tell the difference between what is safe to try and what is not
I think one of the main differences is that with asking what code you don't understand does, you've already got a piece of code, whereas with the other one, you would need to create the code yourself first. so the two things aren't actually that overlapping
Depends on if security is an issue in your context. If it is, don't run anything you downloaded from anywhere without some analysis and on a isolated machine or at least a virtual machine. If security is not an issue, then you kind of just do what everyone does, and download and run all sorts of code without knowing what it does (e.g. pip install ... (do you know exactly how OpenSSL works or OpenCV / what it's actually doing?)).
The just download and run anything will probably become less of a thing as more and more supply chain attacks happen (e.g. the recent attempt on Github).
IMO, the correct thing to teach here is to play it safe and make sure you understand what code you are relying on. The best way to is make sure is that your dependencies are few and small.
This is how I see it as well. "Try it and see" is useful when someone says "can I do X" - the advice is "try it and see what happens, it won't break your computer and you'll learn something."
"Don't run code you don't understand" is useful when someone wants to run code supplied by someone else, which very well might break your computer.
It's not easy to accidentally break your computer, but it is easy for someone who knows what they're doing. The first piece of advice is "don't be afraid to experiment, you won't accidentally break things". The second is "don't trust other people, they might be trying to break things."
I asked the question after suggesting someone try a line of code to get an error with unpacking strings
But the issue was that people post all kinds of shit here, someone might take this try-and-see advice and it might back fire for a command like rm -rf
Yeah that is a classic Linux problem. The copy pasted shell commands that beginners don't understand but need to run because distros often end up in broken states. The real fix is to make Linux user space more stable so they don't need to run any such commands.
You probably won't see people doing the same for Windows or Mac nearly as often.
For now, to use Linux you need to know much more about what is going on with your computer because it will break at some point.
please delete your messages here, because you already asked the question in the right place (#help-cookie)
how to explain dynamic typing in a simple way, i want to make some random python tutorial, but i dont want to go too deep because it gets boring
like if i explain it i might need to also explain what are types or other concepts such as strong/weak and static types.
and it's like the first video, i expect people to know nothing beforehand
or should i simply throw that away for a while
If it's the first video in the tutorial, you don't really need to get into explaining dynamic typing at all
it's an interesting question. but complete beginners to programming don't know what typing is, what static and dynamic typing are, or why it matters.
can anyone think of a beginner example of two classes that have methods with the same name, which "do the same thing", where the two classes do not have overlapping MROs (except object)?
list.pop and dict.pop kind of
arguably int += and str +=
not "kind of", that's a great example 
I was going to say that this is polymorphism more than duck typing. but now I can't think of a distinction.
duck typing is a kind of polymorphism
the kind at runtime
you can have runtime polymorphism without duck typing, a la vtables
this channel is for discussion about how to teach computer science, but you can open your own help channel from #❓|how-to-get-help
@safe dirge Your question was off-topic for this channel, which is about how to teach computer science and programming.
I guess I'll introduce a topic.
For those who have taken formal programming courses, what attention was given to notions of code quality? things like DRY (don't repeat yourself), effective problem decomposition, and intuitive variable naming. In your answer, please say what kind of programming education you're referring to (ie, I'll be talking about courses/modules for a computer science degree, as opposed to a software engineering degree or a bootcamp).
almost all the attention to this in my courses was about code quality in the context of Java-style OOP, and I don't think this was very helpful.
Like, we had to memorize all the OOP design patterns in that one book, and learn the formula for class cohesion. And in all the code I've ever been paid to write, I don't think I've ever defined a class that wasn't subclassing a class from a library to work within their framework. (in which case the OOP design patterns and class cohesion don't really apply, because you're using an API rather than applying OOP esotericism.)
My experience has been similar, besides the memorising of design patterns which i dont actually remember if we had to do, pretty much the only "tip", "advice" we got for clean maintainable code (for our python course) was to obey DRY by identifying repeated code and stuffing it into functions
I ended up helping half the class pass that module, no talk of conventions, no standards, no applying the principles we were supposed to learn in the java classes, etc
my teacher yesterday told the class: "You should never break a for loop. If you want to leave a loop prematurely use a while". Thoughts?
bad advice
for thing in stuff:
if condition(thing):
break
```vs
```py
idx = 0
while idx < range(len(stuff)):
if condition(stuff[idx]):
break
there's just no reason to force yourself to use the latter
notably i made a mistake and forgot to increment the idx
can't do that with a for-loop
and the latter requires stuff to be a sequence, not just iterable
the latter only works for sequences, too. The former works for all iterables.
i havent had my coffee yet, is this different than what i just said?
nope, it's exactly what you said, I just somehow missed your last sentence
carry on 😅
I have also not had my coffee yet, hehe
one thing to note is that we use java in this class sadly
and the teacher is really obsessed with making sure we don't use the word "list"
@pure heron @stone juniper do I need to start sending you coffee each morning
If it's a Java class, that's fine. If I were teaching a python class, I would penalize the students for using list and array interchangeably
(which might seem pedantic, but I would probably be teaching a python class for data scientists, and using list and array interchangeably would occasionally result in catastrophic communication failure)
try:
while cond(x := next(iterator)):
...
except StopIteration:
pass
basically at that point you're just emulating a for loop lol
sure, every for loop can be rewritten as a while loop, and vice versa
but it's unwise to not follow the idiomatic usage of each of those types of loops
yeah, definitely. I also heard the "leave loop early = while" from my java teacher. I wonder where that comes from
sounds like they're a shitty programmer, and they're confusing arbitrary constraints for code quality.
(was one of my messages deleted or did I just forget to send it?
)
Some people say that something like C++ is better for starters. What do you think?
@weak mortar the only thing that I think would make Python a better beginner language for prospective career programmers is if it had static typing. (I like that Python is dynamically typed, but I think it makes it harder for beginners to grasp certain concepts.) And C++ has this.
That aside, C++ requires you to manage memory manually, and the human brain is not fully capable of this. Understanding how memory works is very important if you want to be a career developer. Whether or not you need to learn it in the context of a language that doesn't do it for you, I'm not sure. (I've heard it asserted that you have to start learning programming via a language that has manual memory management, or you "won't understand fundamentals", and I think this is an extreme take.)
off-topic messages (and messages that refer to off-topic messages) are sometimes deleted without notice.
yes but I think it was on this channel and I was answering to static void... I probably just forgot to send it tbh
But dont arraylists implement List, are they talking about plain ol' arrays?
Is the array-list confusion really that important in python?
the pure ideological argument is that a for loop should be used when you know how many times you want to loop, and if you need a break, well, you clearly dont
it is not a very good argument
It might make sense in languages where a for loop is typically just a counter, but it makes no sense in languages where a for loop is "for each"
in certain contexts, e.g. anything with numpy, yes
Yes, that. And in other contexts, not really.
They are two different things in Python, so if you were to say to someone which data structure to use, you would want to make sure they understood.
But the reason list-array confusion is so treacherous in the context of numpy (and scientific computing more generally) is that depending on what is being discussed, if two people are using incongruent definitions of "list" and "array", they may have been talking past each other for quite a while before one or the other says something that doesn't make any sense to the other.
But for a beginner not really. They just need to be aware of it, and know that when they are working with someone else, they want to be specific.
Lists and arrays are also often two different things in pseudocode, because in math they are two different things, and Python wanted to copy that.
(Python does a lot of math-correct things, like how its modulus operator works (vs e.g. C which is actually the remainder operator, not modulus))
can some one help me here?
this is why in general i never use "list" to refer to the data structure, i always call it a "linked list"
a "list" is generally a type of sequence, not a physical data structure of 1s and 0s. a "linked list" is a data structure
i suppose you could also do something similar for "array" vs. "contiguous array", i'd have to think more about that. maybe you're stuck with the overloaded term in that case. but at least usually the best way to represent a mathematical "array" is with a data-structure "array". whereas a "list" could easily be a "contiguous array" (like in python) or a "linked list".
and "vector" is the most abused piece of terminology in all of computer science imo
Yeah the context here matters. In Python a list and an array are not the same thing and are specific data structures each.
It's kind of like how Java has HashTable and HashMap. In Java there is a difference. The context is which programming language / standard library or library in general.
"vector" is abused mostly by C++ and that abuse has spread to newer languages like Rust (it's actually a dynamic array).
the only difference there is that one is synchronized right?
HashMap can also have a null key I think.
ah right, and hashtable doesn't allow null keys,values. but that's not really a different data structure
there are languages that use "vector" to refer to the "default" immutable-size sequence, right? do we know why they decided to call them this instead of "array".
not necessarily. rust's vector is implemented with a length and the items, which roughly follows the dependent typing definition of a vector. not sure where that originated, though, and if that's purely incidental.
lisp abuses it too, idk if c++ or lisp abuse came first but i suspect the latter
Well it's not a vector from math unless it implements the two operators. Which is does not by default, it has a length, data pointer, and capacity.
in the case of c++ i wouldn't be surprised if they just needed another name because "array" was taken. meanwhile in dependently-typed languages like idris, a Vect is a fixed-size version of a linked list !!
Well in LISP everything is a list.
Which matches the math terminology of list.
not true in common lisp! syntactically all function calls are representable as lists of atoms, but you can have arrays that are not lists, and vectors are a specific variety of arrays
wouldn't having a fixed-size linked list be worse than a contiguous-block array in every way?
common lisp lists are true linked lists ("cons cells") and arrays are true contiguous arrays
I know that many LISPS and the originals use linked lists, but they don't have to so in the case of LISPs your statement about it being an array or linked list is correct.
(about lists)
well it's easy to write proofs about it, because lists and natural numbers are isomorphic in that they form a monoid with 0 and []/Nil being the identity element and 1+ and Cons/:: being the addition operator. so you can do stuff like recursively cons something onto a vect and also be able to prove that the size of the vect increased by 1. i'm probably not explaining that quite right but hopefully it makes some amount of sense.
Point is it depends on context. C++ thinks dynamic arrays are vectors, and everyone else has some sane naming.
i think the compiler optimizes this too
yeah theoretically it can, or in the case of idris it compiles to chez scheme which i would hope does some kind of optimizations like that
http://www.lispworks.com/documentation/HyperSpec/Body/t_vector.htm ok i had to check. a vector is a 1-d array in lisp, so yeah that does kind of match mathematical usage (at least in engineering disciplines), even if it still conflates the "mathematical structure" with the "data structure" in a way that's likely to be confusing
Depends what the elements are and if they are big. If they are really big you may want to have a page of memory for each which you can page in and out. But i'm assuming their vector just contains a single number in each node.
(linked list of arrays / big records)
the Python list/array confusion isn't about the data structure at all, though. It's about the list type vs the array.array or numpy.ndarray types, and none of those are linked lists
fwiw, when I'm needing to maintain the distinction between lists and arrays, it never has anything to do with array.array.
I never really see people talk about array.array except in the context of "people say array when they mean list". and I've never actually seen someone write code with it.
sure, it's not commonly used.
what does anyone use it for?
this seems like a case of "if you need a data structure that's more optimal than list, but you're not doing data science, you're using the wrong language"
I've used it for packing binary structures
i'll always remember optimizing python in 2008 with array.array https://www.python.org/doc/essays/list2str/
(i learned about this many years after it came out)
from array import array
from collections.abc import Sequence
from random import Random
def ints_to_string_join(data: Sequence[int]) -> str:
return "".join(map(chr, data))
def ints_to_string_array(data: Sequence[int]) -> str:
return array('B', data).tobytes().decode('ascii')
def ints_to_string_bytearray(data: Sequence[int]) -> str:
return bytearray(data).decode('ascii')
r = Random('arrays are fun')
data = [r.randrange(ord('0'), ord('z')) for _ in range(100)]
%timeit ints_to_string_join(data)
%timeit ints_to_string_array(data)
%timeit ints_to_string_bytearray(data)
interestingly the array.array version is still faster than str.join, but the bytearray version is by far the fastest
## -- End pasted text --
2.1 µs ± 10.3 ns per loop (mean ± std. dev. of 7 runs, 100,000 loops each)
1.51 µs ± 2.02 ns per loop (mean ± std. dev. of 7 runs, 1,000,000 loops each)
548 ns ± 4.22 ns per loop (mean ± std. dev. of 7 runs, 1,000,000 loops each)
i'm gonna write the C extension function for this
i mildly doubt you'll be able to beat the bytearray version! but we are off topic now 🙂
kk i'll post results in #ot0-psvm’s-eternal-disapproval
Hey any php developer here?
this channel is for discussion about how to teach computer science, and this server is about python, but you could ask in an off-topic channel
What do you guys think of stuff like https://github.com/fredoverflow/karel to teach someone coding who never coded before? Basically teaching them the very basic concepts/way of thinking without all the clutter.
In sophisticated languages like Java
Lmao
there are so many details that learning these details often becomes the focus of the course.
They're not wrong.
Is there something about this technique that you think is better than python for learning?
It depends on the target audience.
Although from the screenshot, it sounds like it's either too little details or too much, especially the ASM-like on the right.
For similar purpose, I would probably look into https://processing.org/ (which is also still java \0/)
heey I wanted to install version 3.9 but the link send me to 3.10. is 3.10 safe to use?
Yes
okay, thank you for the quick respond!
@weak mortar @royal palm @winter spear this channel is for discussion about methods for teaching programming and python, so please make sure all your comments are on-topic.
okay my bad!
This is a good intro to regex: https://www.regular-expressions.info/quickstart.html. I recommend experimenting along on https://regex101.com/ as it provides nice and clear explanation of what's going on. After you get yourself familiar with the basics, you can learn about more advanced stuff at, again, https://regex101.com/, though features outside of the ones discussed in quickstart are used very rarely. Other than that, I don't think regular expressions require a special online course to master them.
Good job! Let me point out a few things:
Make sure your code style is consistent, either insert spaces between function names and parenthesis on the last four lines, or remove them from everywhere entirely. I recommend the second option, because it's a more conventional approach.
Also, make sure the names of your variables logically represent their type. In your example, quantity is a string, which is being converted to int only when necessary, but it may cause confusion if you use it the second time, because you may forget to convert it to int again. I would rather do quantity = int(input("How many...")).
I would also recommend looking into f-strings, they can simplify your code a lot, but don't rush it if you don't feel you are ready yet.
Finally, make sure to go back to this code when you learn more about python and try to rewrite it using dicts and loops. You will be amazed by how your code will transform. From there, you can try to gently handle all the user mistakes (for example, what if item use requested is not in a menu? Or what if a given quantity is not a number?).
Anyway, good luck with your python journey.
And I have a question. Are there any good resources to teach competitive programming with Python?
I'm mostly looking for a way to hook them. Usually competitive programming comes down to "solve problems, do contests", is there anything more interesting?
I think that in order to become best python programmer, everyon must study thos modules : itertools, collections, operators, re and functools.
How do tou think about this?
Hi i am Levon 👋😊
i am beginner in python
Me and my friend want to do a joint project who wants to join?😊
@thorny onyx @fallen tundra @keen tundra @spring canyon please remember that this channel is for the discussion of the methods and practices of teaching. If your comment is not about teaching, please do not say it in this channel. Please do not respond to off-topic comments, either.
isn't competitive programming mostly about memorizing classical algorithms?
In free . Dm
Ok sorry
I'm not sure whether I can answer this question simply. Often times it goes beyond that. I know a lot of problems where classical algorithms won't help, but ideas behind them are very useful. For example, I've seen a problem where you need to subtract polynomial hashes to look for palindromes. If you don't have a deep understanding of how hashes work, you definitely won't be able to solve it. Does this counts as memorizing algorithms? I don't think so.
I apologize for responding to off-topic comments, btw
interesting. I'm not sure that I have anything to contribute.
The topic is how to teach skills for competitive programming, if anyone is interested in that.
thats pretty awsome for day 3
Please don't respond to off topic messages
I learn3d oython for like longer than that and still cant do no nothing
its time i start taking it seriously
@weak mortar Please don't respond to off-topic messages.
@thorny onyx me bro
@queen heron @gentle tapir @gilded iris @wild crescent what are your thoughts on teaching OOP earlier than normal? i've had good success with my younger students.
how are you teaching it @half wigeon?
youtube tutorial.
actually i'm not a teacher but i think about python pedagogy a lot. i think OOP needs to be taught sooner.
how do you folks do it? i seriously don't know
This is why many of us don't want it to be taught sooner.
@misty dirge what do you mean?
Because it's easy to make OOP sound like esoteric nonsense.
you can teach kindergartners OOP. just don't use any code. say they're gonna do a brainstorming activity about cars/dogs/movies/etc.
Let's assume OOP is easy to learn. Why does it need to be taught "soon"?
when i say OOP i'm talking about classes and instance methods and static methods and inheritance and polymorphism, ok?
Yes. My question still stands.
well why do you think it shouldn't be taught soon?
You said "I think OOP needs to be taught sooner", so it's on you to make a case for why you think that. You can't flip it around and put that on me.
there are a number of programs which just don't need OOP, even in the most broad sense of "using the class keyword". You can make anything up to simple games with just lists, strings, and numbers.
And getting someone to a point where they know enough to do more complex things that actually warrant the use of even a dataclass, much less an "OOP" class structure with inheritance and polymorphism, takes a while.
What would you say a good first project where inheritance helps rather than just being shoehorned in to force someone to use classes would be?
i could cook something up. gimme a sec
Why do you want "python that looks like english"?
python that looks like english is readable
Not necessarily
well there are exceptions but still
If programming in a natural language like English was a good idea we would be doing it instead of using a programming language.
i think we're not really picturing the same thing here.
brb going out for a cigarette
everyone's preferences in the "natural language <-> math symbols" scale are different. I do tend to like more language than symbols, but I know people who disagree.
At a higher level English-like procedures can be nice, but you can't escape the details, only hide them away.
You can encode those details in english as well, the problem is more that at some point you do want symbol to do things.
And for the details, programming languages are nice because they are not vague.
(And straight to the point, a natural language adds lots of fluff to that)
A nice similar example is from mathematics. Before algebraic notation, proofs were written / described in natural language and with images. And it's long and very hard to follow.
what about unix?
For very simple things,not so long and much easier than first having to learn the notation.
But for anything slightly complex, a complete pain.
function Sum (Vec : in Vec_T) return Element_T is
S : Element_T := Zero;
begin
For I in Vec'First .. Vec'Last Loop
S := S + Vec(I);
End Loop;
Return S;
End Sum;
Function Average( Input : In Array_of_Records ) Return float is
Sum : Natural:= Sum( Input );
Begin
Return Sum / Input'Length;
End Average;
``` is clearly too much
{(+⌿⍵)÷≢⍵}
Having a programming language mimic natural language falls into that trap of simple things being nice, but it does not work on more complicated things well at all. Way too verbose and hard to follow (see COBOL).
APL, is the extreme opposite, but its real issue is that lack of a standard.
You can make up whatever in APL and use whatever symbols making it a nightmare for multiple people working on it / maintainability. It's write-only.
Haskell has a similar problem and C++ to some extent too because it allows for too many options.
hey guys here is mr bunny
touch it
now alias remove='rm'
now remove it
touch it. remove it. touch it. remove it.
unix is a terrible example for english-like syntax
no one even remembers the etomology of grep
touch the top of your head and now touch your feet and now you have to touch your toes is a valid unix command. try it.
APL has an ISO standard, though in practice everyone is targetting dyalog APL. But I would argue the problem of codebases creating hard-to-understand custom APIs is not really a language problem and it will happen in just about any language to varying degrees.
anyways, to get back on topic, there is value in english like syntax to a point
and I think python nails that point quite well
I think what you want and are getting at is the dot syntax in Python, which many other programming language share. Such as cat.move().
Technically this is not really part of OOP, but it often comes in languages that have OOP. And by OOP I mean Java/Python OOP, not Erlang OOP.
touch(bunny)
``` Reads well without any OOP, just functions.
https://docs.python.org/3/library/turtle.html is still one of the best tools for teaching programming in this command way. Just a bunch of actions that are high-level / feel like English.
also, arnt arrays = lists?
no
that's a feature of print, not of strings in general
whats the diffrence? if i may ask - i like look at them at google and they use the variable = [' ']
I think the boolean operators would be better as symbols, you see the !or problem much less in languages where that's the case I think
yeah, there I am inclined to agree
@royal palm I had to delete your message, because it was off topic, and people kept replying to it.
afaik, lists can contain heterogeneous data types, while arrays can only hold 1 data type
@dire pasture please don't respond to off topic messages.
wdym - stelercus
The on-topic conversation was about when to teach OOP. Please make sure all your messages are about that, or introducing a new topic that is relevant to the channel description.
This was the most recent on-topic message.
Why is hello world the first program people teach anyway? It seems quite unhelpful, considering that it requires either handwaving a lot of details, or a number of new concepts. I would argue writing 1 + 1 in the repl would be a better starting point.
When I teach Python, I do start by showing how to use it as a calculator in the repl. But that's not really recognizable as a "program", I think
And teaching using the repl is not without its drawbacks. The fact that the repl prints expression results without you calling print likely leads directly to a lot of the confusion that new users have about print vs return
The fact that None doesn't get printed automatically by the REPL probably contributes to that as well, in fact.
yeah, that's fair.
I think "hello, world" is an easy way to show people that you can do things with the code, hence why it's so popular.
it's not a particularly useful thing, but it's something
at least in python, print(...) is almost as intuitive as 1 + 1. maybe in a lang like java it might make sense to start with a repl
I think having IO as fast as possible prevents learners from getting bored (having the program actually do something). The "Hello World" program gives that right away and turtle provides more of that.
REPL also gives that, but implicitly which can lead to the later confusion mentioned by godlygeek.
Some REPLs such as the classic BASIC ones did not automatically print anything, so it depends on the REPL. Automatically printing things is more useful for non-beginners because it's less work than having to always add a print.
use the python shell
the one that comes with 3.9 or above
i'm interested in tutoring python. i'm self taught. lots of youtube videos. got a few tricks up my sleeve
Not sure what you're referring to. The python shell comes with every version of Python I can think of.
I think they mean the ipython shell? v8+ has some nice improvements, like formatting, better syntax highlighting etc
ipython doesn't come with python.org python though?
maybe it comes with anaconda? haven't used it in a while
it comes with "anaconda" but not with miniconda
yall why does:
condition = 50 | 100
print(condition)```
return 118????
I dont understand the purpose of the pipe operator... In some cases it works like "or" and in other cases it is used as a union... and now im even more confused because im getting 118 somehow???
so... how does that work?
50 == 0b0110010
100 == 0b1100100
118 == 0b1110110
on ints, it's bitwise or
| is a pipe
but 3.10
the new union operator was that right?
on some things, it makes a Union, on some, it does set union, on ints, it does bitwise or
I mean it's just overloading what | does
| just calls the __or__ dunder
This channel is for talking about methods for teaching programming and computer science, so please make sure all your messages are about that.
Speaking of which, are there any good open source projects that have use UI emulation similar to instructional courses like https://pluralsight.com course? It'd be nice to handcraft content for demonstration and learning. Also interested in quiz/assessment solutions similar to https://codesignal.com.
@tender mantle please make sure that your messages in this channel are on-topic.
please do not continue off-topic conversations
Okay
How early would you get into projects when learning Python, i am so worried of forgtting everything i am learning?
Hi Everyone
Can someone help me with how to generate Access_Token using Graph_API by Grant_Type = Password with python scripting?
@weak mortar please read #❓|how-to-get-help
as soon as possible imo
even tiny projects like a program that adds 2 numbers are good hands-on experience. it's valuable to just start writing code, spend time building something, and actually finishing. lots of small projects is a great way to reinforce what you know and practice
Thank you @pure fog
Also take a big project timeline/tutorial and slowly learn each step and what goes on in there, play with/change the code if you want to get into webdev for example
thanks @weak mortar where do we find the projects lol?
Online search framework x, y application, to do app, management app, e commerce, a 3d engine possibilities are endless
Learn everything you can. Because in the meantime youll learn how to teach yourself things
Awesome 🙂
Topic: when should you teach the term "polymorphism"? In my education, it was presented towards the end of the introductory course, but only in context of the liskov substitution principle (which made it more difficult to wrap my head around what it is more generally towards the end of the program). I think everyone found it arcane and didn't understand what was so remarkable about it or the utility of having a term for it.
I would only present it in a course that's specifically about programming language theory. In that context, it might be useful to discuss different levels of type rigidity.
I think the issue with Polymorphism is that because it is left till towards the end of the course, people automatically associate it with being rather super complex, but in essence is a somewhat simple concept when introduced well.
I would start introducing the concept itself at high level towards the middle of the course, and add on to that such that when we reach the point to fully talk about it, it is not just a hot brick but rather an application of a concept that has already been approached through the class.
anyone is there who can help me as a mentor
i would do something like "we've already seen examples of polymorphism, but we just didn't call it that" for like, using ints and floats in the same spot, looping over strings, lists, other stuff you would have learned by the time you get to classes
Right, "duck typing" is the typical way to get polymorphism in Python
@naive acorn this is the wrong channel. Kindly remove your message
Concretely, something like a basic function that dispatches on types via isinstance()?
That would make the function polymorphic, I guess. But then it wouldn't be applying polymorphism in it's handling of whatever is being type checked
Because if that part were polymorphic, it wouldn't need to type check the argument. It could just leverage the shared behavior of the set of permissible types.
So is 'polymorphism' specifically referring to the function interface or the underlying behavior - the behavior can't be non unique all the way down to the metal
in this case, it would be the interface.
Isn't teaching programming inherently inefficient? Doesn't a majority of learning come from just reading code?
just reading code? definitely not. but writing and debugging your own code? yes, I think that's where most of the learning happens. but you still need some level of instruction. otherwise, where do you begin?
remember that "teaching" isn't just lecturing in a formal setting. it can be writing a book/tutorial, or answering questions on this server.
Excuse me. Yes. Along with writing, debugging and projects. I guess answering questions is something I didn't consider when writing this. I'm thinking lecturing in a formal setting.
i think this kind of thinking comes from a sort of bias. a beginner doesn't even understand what they're reading, so they won't get anything from reading code. however as someone with more experience, you're familiar enough with basic structures that you can just look up the tiny parts you don't know, e.g. a library function or something. also, a beginner isn't quite as familar with documentation, so they even have that going against them
well, you're right that people don't just passively absorb programming skills from listening to a lecture. but you probably won't find any CS lecturers who purport that their lectures cause that. that's why there's assignments and stuff, to make the students apply the ideas that are introduced in the lectures. and that's where it's intended to actually "click".
I used to think this as well. But if I were to start over again. I would just read exhaustively like I still do. and that would mean rereading documentation. The good and bad resources. You have to at least skim over the complex works to get an idea of what you're headed towards. IMO.
Yeah. What methods are good for teaching then? That would be more effective than what you mentioned?
There's a book called How To Solve it by G. Polya that explains how to guide a student in dealing with tough problems. I think that's probably the best resource I've seen for guiding someone through the discovery process. Basically developing mental operations.
more effective than what? lecturing + assignments? I don't think those two together are bad.
Not saying they're bad. Just saying that I've found that reading exhaustively has clearly been the most impactful for me. Writing auxiliary code from one problem I read weeks ago to solve another has been the most impactful on my journey. There's just too much to learn IMO. You have to read as much as possible. Even in the beginning stages.
I'm glad that that's worked for you. but I don't think that necessarily means that everyone will learn best that way. (And I'm not talking about the "visual learner" vs "auditory learner" thing, which I think is BS.)
Well, how are people learning with all the information out there? Going through engineering blogs and scientific articles. Going through code, documentation and working on projects. How would you direct someone through that?
"The teacher who wishes to develop his students' ability to do problems must instill some interest for problems into their minds and give the plenty of opportunity for imitation and practice." - Polya
I think the reality is that every student needs some amount of reading code, hands-on practice with code, reading theory, hands-on working with theory, and chatting with other students and programmers. The challenge with teaching is constructing an environment in which all of those things are available to some extent, and tuning the ratios among them to match the pace and objectives of the course, as well as the capabilities and motivation/interest level of the student
so I don't think anybody is going to disagree with you in that reading code is useless. But some people might find it more useful than others, students and teachers alike
I definitely agree that there comes a point in learning programming when the best possible thing for the student is to just start reading other people's code. The experience of realizing that they actually have the ability to read other people's code I think is a strong positive reinforcement signal, and it also helps them "get out of their own head" when it comes to writing code and designing programs
with all the "self-taught" programming being the new thing, there seems to be a miss-understanding of the role of a teacher. I do believe, that reading code, working on projects, and talking to other programmers are all good. And because different people learn differently, each person learning will have a subset that works for them. However, it terms of teachers, their roles should be consider more of guidance, rather than a machine (or someone) that regurgitate materials (aka lecturers) having thought data engineering and programming, there is a difference between handing someone a book and they read it, and create something, and guiding someone, whilst they follow along in a book.
for example, when I first started to learn to migrate data from one location to another, I had no knowledge of networking, which lead to a lot of errors. If I had some guidance, I would have still learned that, but it would make a lot more sense as to why certain aspects of my code was not working as I would have expected.
I agree. I believe that books are still the best way to learn something (although in theory interactive books / games could be better, but I don't think it has been executed well (and won't be as long as they focus on passing tests in schools instead of actually making a good game first (primary goal))), but there are too many topics with too many books (especially now in current year). The teacher is there to provide a direction. Without that direction one could have read many (worst case maybe hundreds?) books and still not have right knowledge for the problems they want to solve (consider not having anyone to tell you which books to read ever, no internet to reference for guides either, you might never encounter important topics like algebra). As an example consider learning mathematics, it is possible to rabbit hole on one specific topic for one's entire life, it's a never ending bucket of theorems. For most things one wants to do practically there is some general history that most follow as a guide on what can / should be done (and where to go next). The internet has further amplified the number of things to search through (more hay in the "needle in haystack" problem), although it also came with a bunch of guides (but with high variance in quality).
Hello
I am looking for a good website that teaches and trains Python interactively, solving exercises hands on and the ability to review the detailed answers later.
Also, a list of small projects to do later would be great.
I mostly worked with Bash running scripts in Linux machines or Cisco-like Switches. Now in a new job I need to test and debug a fleet of servers and storage/cloud nodes.
it sounds like you really need/want a course with an instructor and exercises
!resources @terse cradle we have a list of python learning resources on our server website
The Resources page on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.
Thank you @pure fog its a big list 💪
i picked up a book on oop and on the end of the first chapter its teaching me freakin iris classification problem for machine learning like wtf?
its interesting but i feel like ive bitten more than i can chew here
that does seem like a strange thing to introduce in an object oriented programming book. possibly because they think machine learning will be exciting for students because it's trendy
the preface says its for beginners but i have no idea wtf its talking about
The book revisits the iris classification problem several times. It's not a terrible idea. Forcing someone to deal with and break down a new and unfamiliar problem is something that should be in this book. But "let's cover k-nearest neighbor" seems out of place in the middle of chapter 1.
hello @toxic rover, the third edition was not like this at all. the end of everycahpter frm the third edtion was like "you should find projects where you can implement oop.. to help you practice."
this steven lott guy pumped the gas on this book big time lol
seems like a distraction away from the learning goal!
to be fair, the more i read it, the more, it seems like its less about teaching how to solve a specific problem, and more about watching a person use oop to design and analyze a software. i dont know if that's what they are going for.
its like when you apply for a job at the super market they usually have you "shadow" somebody so you can see how its done.
i'm sure that's what they're going for here! but machine learning is such a complicated problem domain with its own set of skills and terminology that is largely removed from "programming". i remember encountering examples like this in math classes, where they were trying to use some kind of complicated physics or engineering model to demonstrate math principles, but all of the physics and engineering obfuscated the math, even though it was nice to see an interesting real world application
classification on the iris data set seems like opening a pretty big can of worms
I am a student
very true
I teach beginning and intermediate Python at two universities in "Silicon Valley" in California. My specialty is in OOP, so I looked around for what I considered a good book on the topic to use for my intermediate course. I could not find one that I felt covered the topic in the way that I wanted to teach it ... so I wrote my own. The book is called "Object-Oriented Python: Master OOP by building games and GUIs". It's available through the publisher, No Starch Press, on Amazon, and at most technical book sellers. https://nostarch.com/object-oriented-python
why did you pick games and GUI to focus on OOP? why not something closer to what you'd encounted in the industry
because it's fun i guess
a lot of people are initially interested in cs because of game development
even though they might realize later in life a lot of things are different about the game dev industry it's possible the book topic was chosen to be as engaging as possible
Because I felt that GUI "widgets" offer a very simple but highly visible way to explain how objects work. And people are always interested in games. So, I explain how the GUI widgets work (supplying a library of widgets like buttons, text input, text output, etc.), then use them to build small games.
It has nothing to do with the games industry. The book uses relatively simple video games to explain OOP concepts.
@wide shell I have an electronic copy of your book. The first thing that stands out to me is that your code examples use lowerCamelCase. Was this a deliberate choice?
I understand the highly visible nature of GUI, its why i usually recommend JS to beginners myself, but games are hard man, I dont think I would personally stick out a game project as a beginner
Yes it was. I have been using the camelCase naming convention since before Python was created. When I got into Python I just felt much more comfortable with it than with snake case. I make a mention of this in the introduction of the book.
I use the pygame extension to introduce the concept of basic event loop programming. However, pygame does not come with a set of GUI widgets. So, in my introductory course, I have written a set of GUI widgets that my students can use (simplest example being a button). In my intermediate course, we go into the implementation of these widgets so they understand how these widgets work. Then they can start to create their own classes and objects and build small games with them.
I regularly tell people on this server that writing code that doesn't follow PEP 8 is a very strong signal that they haven't read enough Python code yet. The convention to use snake case in Python is so strong that choosing not to follow it makes you look amateurish, as though you're either ignorant of the conventions, or so steeped in another language's conventions that you haven't bothered to learn Python's conventions - either way, it's a negative signal. I strongly recommend changing that style for your next edition
I agree. I think it's important that educational programming language material follows the convention of the language that it's about.
I don't want this to feel like a dogpile, but I think this could also be a source of confusion and difficulty for students as they start to work with other people's code and even start asking questions on a forum like this one.
What about this book. Is it good enough for complete deep learning? https://www.amazon.co.uk/gp/product/0262035618/ref=ppx_yo_dt_b_asin_title_o00_s01?ie=UTF8&psc=1
That is considered a top notch book for the subject.
Do you have any suggestions about ml too?
I'm a new student for cs and I wanna start from ml and dl
learning data science is sort of out-of-scope for this channel, since it involves a lot of things that aren't programming (math, data visualization, et alia). you can look in the resources in #data-science-and-ml. in my opinion Probabilistic Machine Learning is the best "new" book, but it requires a background in probability (like what you'd learn in an undergrad university level course)
oh I understand my bad didn't see
Got this a few days ago and I've been enjoying it so far. Cool seeing you on here.
An introduction to Statistical learning published by springer
@winter spear Please move this discussion to #data-science-and-ml
Hey guys have you worked on the selenium grid needed help from you please
@cloud pawn please use a channel from the #❓|how-to-get-help , and do not spam multiple channels with the same question
Sorry for this
hello
Topic: Technical Writing. Programmers are, at least stereotypically, terrible at writing, and hate writing documentation. Should technical writing be considered a core competency of developers, and if so, how should programming education reflect this?
In my education, I don't recall any specific attention to technical writing. If there was any, it was never any larger in scope than writing documentation for individual functions/methods. (Though I took my one software engineering course during the semester that Covid started, so that kind of derailed things.) I think technical writing is extensive enough that it could be a course on its own (even if it's, I don't know, two credits instead of three), but I don't know if I would mandate that it should be a requirement for a CS degree (because CS has enough scope-creep as it is). I might want it to be a requirement for a software engineering degree, or a CS degree with a SwE concentration.
I'm of the opinion that communication, especially written, in general should have more focus in many career paths. A consistent struggle we see in our teams where I work is that technical writing aspect. How the code is designed, how it is intended to be used, and what errors are captured (and what they mean) all go mostly undocumented.
The task of writing up technical writing is a lengthy one, for sure. I don't think I'd expect all devs to be able to provide a polished piece after a feature build. However, I do expect them to at least have the knowledge of what goes into that writing, be able to record it themselves, and know why they should record it.
If you have a CS-or-similar education, was there any attention given to inline documentation (to say nothing of end-user documentation)?
My school does this fairly well in that every project has some documentation as part of it, though we also don't have a technical writing course
I can't speak from an education driven awareness, unfortunately. My limited schooling including genEd composition and nothing more. I am a writer though, by nature, and have decades of learning how to put the complex into repeatable context. (past jobs).
As you mentioned, the stereotype is strong with being poor at writing documentation. I don't find that holds water in the field. Many of my programming peers are very good at writing up a summary of their work. Most just don't ever have the directive, time, or focus to do so. Always pushed to the next feature.
In my work environment, developers are expected to provide quality documentation for code itself (think docstrings and comments), and enough information about more general things like architecture and platform's design. A separate technical writer is responsible for actually documenting the design and preparing e.g. onboarding materials or the redmine wiki, in my team one of the QA engineers happens to double as a technical writer. I think this is a fairly reasonable approach, because [designing and implementing a project] and [writing good documentation around it], albeit going hand-in-hand, are two significantly different skills
Writing documentation is very important, but technically writing is far too much of an academic approach. As long as there is any documentation at all and it's written decently it's fine and I think academia would make this way too formal and make people less willing to do it. The problem is that often there is no documentation at all. And by documentation I do not mean comments in code (although many (most?) projects are missing even that). I mean stand alone documents that go into high detail and importantly also document not just what is currently happening in a project, but also how it got there / the history of it / decisions made (and even link to commits / code).
IMO writing documentation needs to be low friction, not overly formal. And for programmers to be willing to do it they need to experience the joy of great documentation on a new project they have not learned yet (vs not having any).
Hmmm, that's an interesting point and, hopefully, not straying too far from the original topic. Writing external documentation that, at the very least, explains what the program is intended to do, why it was written to do so, and where it is intended to develop further. Some common handholds that would allow the next dev to start on a common ground when looking at the code.
More times than I'd like to admit I have read code, nodded in understanding of what it is doing, and asked "but why"?
From a teaching perspective, it's the chance for the dev-at-the-moment to teach the next-dev.
I would like to add when to that list. As stated I think a project's history is very important in understanding it, especially since projects exist throughout time and morph with requirement changes and change in people working on it.
That's fair too. I'm far too spoiled of having git-blame for my history to answer that piece. It's not a staple and shouldn't be assumed.
Since documents are a separate thing I require them to link to it if version control is used (which it always is now thankfully).
Keeping track of the history also lets one see whether certain ideas actually worked out or did not (e.g. "we started following OOP, it reduced our bug rate by X amount").
(No need to have design debates or language wars when you can point to actual evidence of it working out or not)
comments carried some marks in our assignments at school too but it was pretty dumb since they only counted the number of comments; whether the comments were at all useful didn't matter
so you could just write } // end of main or int[] x = new int[5]; // initialize empty array of capacity 5 and it would fetch you marks
That is quite misleading, such comments actually reduce the readability and negatively impact code quality
Agreed. I think the best statement I ever heard for comments was something like "comments that explain what something is doing are often useless, I can read the code to tell what it's doing, but comments that explain why they're doing what they're doing are often invaluable"
I think the reason that lots of courses for beginner programmers teach you to write "what" comments rather than "why" comments is that they're aimed at people who haven't yet built up the ability to read code and tell what is doing, at least not quickly and accurately
this is a special case of the general principle that any advice about code comments or code style in general needs to take into account who will be reading the code
which makes sense as a corollary of the principle that code is more often read than written. there is no universally good writing style, only the writing style that is good for your audience
that's a very good point.
They're different enough that I would rather compromise with someone writing decent code and decently document it, rather than perfect code with bad documentation
Would you rather work with a project/tool that is...
A: ...coded very well but documented poorly;
B: ...coded decently and has decently written documentation;
C: ...coded poorly but perfectly written documented?
Personally I might just rather work with a terribly written project that is documented to great extent than a good one that is coded nicely.
The documentation would be good enough such that I would never need to read the code.
On the other hand, even if the project is that perfectly coded, it is always harder to read code then documentation.
I need help!!!!
This question might be more related to learning than teaching but I guess one cant exist without the other so deciding to post here.
I'm taking a python bootcamp course, decided to go back and redo some stuff I did 1 week ago that I then had not a lot of issues doing only to find that I now have issues completing the task. Is this a normal phenomenon or is my brain just screwed? Did I move to fast and need more repetition before moving on? What do you guys reckon
You shouldn't feel bad about needing to review earlier material.
Alright , perhaps I should exercise this more often and return to previous materials to ensure I retain the information properly
look into "spaced repetition" - https://www.edapp.com/blog/how-spaced-repetition-works/ for example. The way we retain information is based on being repeatedly exposed to the concept repeatedly over time. It's totally normal for a student to understand material when it's presented, and fail to retain that information over time, unless they're reexposed to it at a later point.
I've always found writing documentation forces me to write better code. If I struggle to explain some detail in writing, it's a good sign I didn't clearly think through my approach before implementing it, and I ought to improve it.
When I get stuck, I write a stack post even if I don't plan to hit submit, the act of writing the explanation helps a lot
Absolutely. It exposes the errors in my thought process.
Thanks everyone! This really helps
i'll add that this is one downside of boot camps compared to a longer program of study: you end up running quickly through a lot of material, whereas in a sequence of a couple semester-long courses you end up naturally engaging in quite a lot of "spaced repetition" as long as they are somewhat well-designed.
and i'll also add that this is one big reason why i strongly advocate for doing as many little projects as you can, especially when starting out. it naturally leads to spaced repetition.
gotcha, thanks!
I have a problem with py charm along with flask in which the code where the render_template code fails to recognize the templates folder even though someone knows how to solve it?even though I already created the folder.
this channel is for discussion about how to teach computer science, but you can open your own help channel from #❓|how-to-get-help
hi, i am passionate about programming,
i have 2+ years experience with python and want to continue furthur as i completed my 12th
what should i learn, full stack web development or android development
and what courses should i opt to master them.
Your question is off-topic for this channel. Kindly remove it and say it in #career-advice.
Hey fellas - I'm new in the server, and this looks like a good place to ask things such as how to be a better teacher. Sometimes I struggle with motivating younger students, and my question is:
- What can I do about a student who is very very keen on giving up at the slightest hurdle ? We talking that when he gets a Database Connection exception, he's very very keen on just saying "fuck it I'll just implement using files instead" , and he's reluctant about asking class members for help.
This is the right place--glad you found it 
I think people sometimes assume that techy things are more difficult than they really are. It might be that the student feels intimidated and thinks that no amount of effort will result in them understanding the new concept. Have you done anything to determine if that's the case?
Is their motivation to get something working as quickly as possible, or is it to avoid learning the new thing?
it's possible that the student has never had the "aha" moment of pushing themselves through an intellectual challenge, and doesn't understand the value in putting in that kind of mental work.
and/or it's possible that they might have some difficulty or lack of self-awareness in anxiety processing and giving up is a kind of self-defense mechanism. there might also be some personal ego attachment to understanding things right away feeding into that anxiety.
note: i am not a professional in this field, but i know a handful of people irl with issues along these lines (myself included).
what kind of learning scenario is this? how much 1:1 time do you get with the students?
Special needs student with heavy heavy Autism, enough defeats from previous universities and social services, basically a guy with all odds stacked against him on a Data Science study.
Just to be sure we're all on the same page, it's not likely that anyone here has any experience with special education.
I appreciate your concern and efforts 🙂
yeah the best i can offer is general advice that's worked for me on myself & people i know who have very mild learning/thinking differences
He did get a few "aah" or "eureka" moments and when he gets those, he gets more motivated
But he's very reluctant on sharing defeats and victories, and believes that noone else has the challenges he face.
As in "I don't think anyone else has issues with programming"
my experience in discord + irl is that often people lack confidence in their own abilities, especially if they have had previous negative experiences and negative feedback. i very often find myself telling people (friends, coworkers, people asking for help in this server) that "it is completely normal and expected that XYZ topic is difficult and confusing, very few people understand this instantly."
I try that all the time, and sometimes I tell him "when I started, working with this topic was difficult as hell. Working with 2 different techs (Databases) the first time, is hard AF )
fwiw this is a real phenomenon in neurotypical people too. the antidote there seems to be a combination of a reminder that they do have the ability to do the thing and a bit of reality check in admitting that some people do understand some things faster than others -- the latter seems important to offset the natural reaction of "you are bullshitting me look at FooBar Jr. over there doing recursion with a database and a discord bot! i suck and they don't!"
what's their reaction to this?
also if this is in a school environment, do you have access to special ed resources? it might be helpful to at least get some advice from a pro in this area.
They shrugged it off and said "okay." We're very limited in resources, and I asked some of our team "what would you do?" because I felt the student was mentally making me morose.
They shrugged it off and said "okay."
unfortunately i think this the point is where the advice of a non-professional starts to make less sense.
A thing I suggested him was "put that difficult task on pause" and "find another part of the program you can fix or understand."
you could see if there's anything on https://understood.org about working with autistic students
Understood.org is the resource that helps the 70 million people with learning and thinking differences anticipate the challenges, barriers, or opportunities in life and confidently reach their potential.
ugh... that homepage design sucks so bad, but the people they hire to write the articles are pretty good
i think it's also oriented mostly for younger kids, idk how many resources there are for teenagers and above
That might be a great help - We could go full circle and imagine that CS students should be educated to develop that site and create a positive cycle
This is a male in his 20's, soon 30
Thank you so much for your 2 cents 🙂
it's hardly worth that much i think 😆 but good luck with this
Inflation hits hard 😉
Nice to feel welcome in the server - I think I'm going to look a little in the channels 🙂

Hey, i am a person with the same "needs" so to speak and have been coding for a month now and i feel i've gotten pretty good at it.
Mind if i send you some tips on how to deal with autism, perfectionism, and fear of failure?
Just speaking from my own experience ofcourse.
Go ahead
Should i send them in this channel? i will get pretty opinionated and speaking largely about how i would want people to encourage me. so maybye we should go to DMs
alright i'll send you a dm tomorrow, turns out i still have a lot of stuff that needs to be done before tomorrow.
again, i'm sorry, but this is important
Sending them in this channel is totally fine. We love seeing this channel get used for its intended purpose
so I have a little group chat that consists of 69+ people most are inactive and I'm known as the helper guy...
But one guy here wants the code to be fed to him, I gave a link that already has the code but isn't giving up on asking he just wants to copy paste the code...
I don't want to give him the code because he will not learn
I just help them by giving pseudocode
the question is:
what do I say to him? without looking like a total bad guy about it
pls pong me for response
another question:
is it good that I'm giving them pseudocode? or is there a better way of teaching them?
are you an instructor, or everyone in the group a student? Is this at the university level, or the high school level? Have the students chosen to participate in this class, or is it forced on them?
I'm a senior highschool student and they are college students
if you worry that you're depriving him of the chance to learn by feeding him answers, why not just stop answering him?
For now I have but I kinda feel bad for leaving him in the air
serious question: why? You're younger and less experienced, and presumably he's enrolled in a program whose purpose is to teach him how to do these things, so why do you feel responsible for educating him?
actually, I shouldn't say "less experienced" - you may well be more experienced. But teaching him isn't your job, it's his professors' jobs.
I don't feel responsible
It's more of pity
feeding them answers might give them benefits in the short term, but it likely costs them in the long term.
Yeh that's what I'm worried about as well
...
8. Do not help with ongoing exams. When helping with homework, help people learn how to do the assignment without doing it for them.
Now that you mention it...
Is my guidance bad?
They ask to do smth but I give them pseudo code and let them take care of the code? If so how should I improve 
our general rule on this server is that we won't do work for people, but we'll guide people towards the right direction, to help them learn. That's a good strategy, I think.
I think that's reasonable, in general.
Nice! I learned that from experience 
From here too
giving pseudocode is a way of decomposing the algorithm, but making them focus on the nitty gritty details of implementing it
if they're not willing to turn pseudocode into code, it's possible that nothing you do or say will make them enjoy writing code, and you should just cut your losses and focus on helping people who actually want to learn.
thank you@
This channel is for discussion of the methods and practices of teaching. Please make sure all your messages are about that.
hell yeah thats how im trying to learn this snake language right now... that said im sure my code looks like a right mess but in the end it's going to work atleast maybe not the most effective but working
youtube for the pcs i need then cobble it all together to something working 😛
well a few other sources also but youtube has alot that i need in easy formats
on topic for this thread: youtube is generally a horrible format for learning programming
i strongly discourage using it except for high-level introductions to topics, or if you find yourself in some situation where you are doing something else with your hands but still want to try to learn (e.g. standing at the sink washing dishes)
yes and no, for someone like me trying to learn basics from scratch without any formal education its a good choice, tho for someone in a formal education i doubt it would be a good choice
learning to learn by reading documentation, long-format guides, and code examples is a skill that takes some practice, especially if you're on the younger side and have had your attention span abused by growing up with too much technology. but it is absolutely an essential skill.
like i said, it's a good way to get an basic idea about a variety of topics. but it is important and essential that you eventually learn how to learn using better methods
it's also a known and well-studied phenomenon that passive listening is generally not a good way to retain information and build understanding, and that students consistently overestimate its effectiveness
yeah absolutely when getting a decent bit into it the skill has to evolve and more precice or "propper" methods needs to be implemented into the basics thats where i see the papperwork comming into it (im only able to judge by my own case tho)
and yeah i have never been able to learn without doing, not even in school when studying to be an industrial electrician.
best thing is to have someone show and tell but being able to work and tweak what they show/say in my own work at the same time
good, then you do understand! a lot of people seem to expect to have genius-level understanding injected into their brains by watching random tech influencers show them how to pip install stuff for the 100th time on youtube
we not-infrequently get messages like "help how do i do <some specific task> i cant find video on yt"
as with the thing im currently doing im trying to make a game in pygames to learn. i look up things like how to create a window, how to make buttons, how do i make entry fields etc.. then i try out different ways to fit those together in my own creation. it's a bit of puxxeling since the various functions i find are often made in wastly different styles. but after watching enough of them i get a feeling of what could work together
again, unless you're somehow constrained to the video or audio format, i suggest looking for blog posts, stackoverflow articles, and documentation snippets before looking for videos on anything other than topics like "what is recursion".
it's the difference between watching a video showing how to do some wiring task versus actually having wires in your hands and following along.
importantly, unlike wires, code is literally text, so text-based formats are actually the best medium to communicate code (whereas learning "handy" stuff from a book is kind of rough, and videos are an amazing resource there)
isn't pip install the FIXALL !!?? 😛
yeah i use a fair bit of stackoverflow too, often people will give quite good explanations with their solutions there
indeed. i always appreciate it when someone will go back and edit/update their post to include new information
the thing im starting to wounder about but i do not really wan't to bother with untill after my current project is if it's good or bad practice to have a heap of document.py with functions or try to limit it down to a bare minimum... atm i have my functions spread allover the place in a complete hackjob to make it easy for me to find and not get overwhelmed but i have a feeling that is not how it is "usually" done 🙂
btw this channel is supposed to be about teaching moreso than individual learning. maybe you could ask that in a help channel or even #software-architecture
yeah got of topic a bit
but it's not clear what document.py is, so you might want to be a little more descriptive or give an example
just meant is as like docu1, docu2 docu3 etc...
it's not really important to the topic of the chan tho, just a random thought
I personally can't stand YouTube for learning, but it's probably workable if you mix it with doing exercises in a code editor alongside the videos, a bit like a classroom experience.
What should I use for JS compiler?
because I wanna start learning JavaScript but I have no idea which compiler to use
@kind zenith your question is off-topic for this channel. Kindly use one of the three off-topic channels.
Oh, I thought this could be for any language, mb
it's for talking about teaching. not resource requests.
Youtube is fantastic for demonstrations. Specifically demonstrations of things that you are mechanically unfamiliar with. This actually works to funnel people into a kind of programming content trap. Start with a video demonstrating how to download and install python and pycharm. Then watch one showing off the basic workflow. So far as good. Then watch the rest of the playlist where all of the language features are not so much taught as demonstrated. It's not useless but it's close. Now I'm wondering if there's an even less effective way to learn programming.
I have found youtube tutorials to be useful when I couldnt find what I was doing wrong in a text tutorial, since a video will generally not skip over steps and/mention them in passing, so you can watch at 0.25 speed and figure out what they actually did to make the thing do what it did.
I feel lost and I need some advice.
I’ve been learning Python for a while now and I feel like I should jump into learning frameworks but something at the back of my mind keeps telling me that I still don’t know enough of Python to start learning frameworks. Even with that I decided to make the push and start learning flask but I still get these conflicting thoughts of going back to learn more about Python.
What should I do?
I don’t like following tutorials because I feel like when I’m following a tutorial I’m not really learning rather just regurgitating what I’m seeing in the tutorial so whenever I start following a tutorial I always find myself not being able to stick with it.
@hearty wyvern this channel isn't for learning advice. Try asking in a help channel.
Ok
hello
anyone help me for this
Image
this channel is for discussion about how to teach computer science, but you can open your own help channel from #❓|how-to-get-help
This looks like a test and has nothing to do with the purpose of this channel: methods and practices of teaching
How about just watching someone program and work ?
who has that kind of opportunity to sit and watch programmers work for any meaningful length of time? do you mean in the context of two coworkers?
Programming streams can be great, but only if the person streaming engages the chat and thinks out loud, otherwise just watching code happen with no context or explanation is unhelpful and boring
Could someone get a lot out of it? Sure. But what is the instructive content of the video and what is the viewer capable of learning from it? If the video models real world problem solving but the viewer doesn't have the maturity to understand what's being done and why and then think about it, that's a waste of time. Are such viewers good at identifying that waste of time? I suspect not.
Hey i was seeking an advice from experienced programmers about my way of learning. I have just started to learn programming for around a month now but I keep getting bored on the same language and I keep switching to different languages and again return to the same language so I was thinking should I try to focus on a single language or should I keep switching and learn the new language according to my mood?
What is your goal? If you think that learning different languages is fun, you can absolutely do that. And it might be a more enriching experience for you if you learn about language theory, so that you can appreciate the different advantages and disadvantages of each. But if there's a particular kind of programming that you want to become good at (web dev, or infrastructure, or what have you), then learning languages as an end unto itself won't help with that.
You will always feel like quitting if it's an option. You should commit to one path and then re-evaluate after some set period of time or after you've reached some predefined goal.
In terms of the jobs and experienced is better to be an expert in only one language, also "jumping" is not a good strategy you need to decided for only one tech o stack. Find a good job is the better way to keep a deep learning in the same language.
Thank you for your suggestions! I also wanted to know should I take notes when I learn to code and should take notes on a physical pen and paper or virtually?
it's up to you, but I think note taking is generally more useful in theory courses than programming ones.
yeah for programming it can still be handy to take 'practical notes' so like keep all your regex programs together for example (+add comments), so that if you forgot about how to use regex you can easily find them and practice again
One thing I’ve started doing is to have a git repo named “learning_python” for example, and make a branch for “classes” where I start from 0 learning classes. With commits along the way as I learn, or documenting where I’m struggling. Another branch for exception handling. Another for whatever.
I don’t ever merge these branches into main. They exist as a place to refer to in the future or to add to as I learn more.
The main gets built up over time with a few things that I think I’ve mastered and are helpful to future branches. I’m really enjoying it.
Also, I make liberal use of jupyter files in those branches. Great way to document my learning
Hi guys, I know this isnt related to Python but I was wondering if there was a similar discord server but for R? I found one but doesnt seem to be very active
-
this probably isn't a good channel to ask such questions (maybe #data-science-and-ml although really it belongs in an off-topic channel)
-
try a statistics or data science community maybe. there is also an R channel on Libera Chat (IRC).
there is, it's called discoRd (no pun)
you can get there with the Explore public servers (compass button)
Hi guys How to use "wait" command in py
import time
time.sleep(seconds)
Ok thanks
if someone is teaching me, I know that is a fast way to learn
since I saw it here that youtube videos aren't a good source for learning
I disagree with people who say that YouTube videos are bad. Definitely will always recommend written documentation and similar, but I don't like how people have went out to say they are outright bad.
I'd compare a YouTube video to a lecture on a class room - it works the same way. People are used to that structure and there is no doubt in my mind that people gravitate towards it.
The most common downside to YouTube videos is that they get outdated, which is fair. At the same time though, I don't think it is hard to find an old guide. Sure guides are easier to edit and maintain, but most don't. The same type of people that keep their guides updated are presumably the same ones who leave comments or edit their videos.
I guess the last thing is that people have it easier to tune out of YouTube videos. This is a fair point as well, however, that is at fault of the user. You can't blame YouTube videos for that. Creating this culture around YouTube videos get people who'd otherwise be able to focus and correctly utilize them (efficiently learn), to now move on to a format that works worse for them
Let's be concrete about this. When I say that Youtube videos are bad, I'm talking about this in particular: https://www.youtube.com/watch?v=rfscVS0vtbw . Number one result on Youtube, 36M views, 4.5 hours long, positive comments. He starts by saying this will teach you everything you need to know to get started programming in python. This only takes him 10 minutes. Nice. What follows that is 250 minutes of separate tutorials that someone glued together (this is part of the Youtube algorithm game). It starts by describing code execution as a sequence of instructions, two hours later covers for loops, and two hours after that covers class inheritance. Judged as a whole, it's laughable. Zero to inheritance in four hours? Who is this for? There's a section on try/except where he covers the syntax but he never talks about the concept of an exception, what to do with a traceback, or anything like that. It's all so superficial. So if you judge the sections individually, it's not great either. I'm not going to watch the whole thing. I'm sure there are nice parts and that someone is getting something out of it but I've seen enough to think this video is bad and even harmful.
Is this the kind of lecture-style video you had in mind? Do you think I'm being too hard on it? Is there something comparable but much better? If so, critique it. Why is it better? Is there anything seriously wrong with it?
I totally agree that this kind of video (super broad, super long, no depth) is really bad. you simply can't get any understanding from 5 minutes of a certain topic, and it doesn't emphasize practicing. that said, there do exist good videos.
Practice is definitely the number one thing missing from Youtube videos. It's fundamentally at odds with how everything is set up.
the best example of videos i can think of is MIT OCW, though these aren't really videos, rather recorded lectures and associated psets. these are really good resources
I agree. Recorded lectures can be a gold mine.
what about stuff like fireship, I find their content pretty informative
Fireship looks slick. A lot of the videos are front end related. Not my area of expertise but there may be something to be said for the value of videos when talking about graphical things and how they change over time.
Did we watch the same video? This is such a great video in my opinion, simple examples and great explanation. It really does go through each topic of Python from installing until inheritance.
If I remember correctly, long videos are the opposite of the YouTube algorithm game. They could publish each video separately in a playlist and get x * n views instead of x views which I am sure might get recommended more because the channel would get more views. I think what happened here was that freecodecamp.org compiled together a course of theirs. I mean the course appears to be tailored to complete beginners who need to get introduced to Python, that's who it is for. You can definitely follow this and feel familiarity to Python and be able to write some code - at the very least enough for a beginner to feel accomplished.
They do talk about exceptions in that chapter, they mention that errors arise when things go wrong and that try/except allow you to run code when that happens. Is that not enough to explain the point of the statement? You don't need to learn about __cause__ or all other attributes of an exception, nor do you need to learn to work with traceback objects. Unfortunately they did not go through how to debug in Python (or at least not give it its own chapter), but that doesn't mean their try/except chapter is bad. They even go through narrowing down exceptions (don't use bare except:) and even fit in as err to print the exception message. A wholy 30 minutes was dedicated to classes and inheritance too, more time was dedicated were it was necessary.
Sure this might be what I had in-mind and I think this is a good example / video. I am confident there are people who benefit from this and I have no issue with this video. This video does a better job than the entirety of Python's own documentation as far as I know. Calling this "laughable" or "harmful" is an insult.
The only thing wrong with this is how people are able to put it on while they're playing a game and have it on in the background without actively "participating", and then vastly overestimate how good they are at Python.
Recorded lectures do not get you to practice, so I am not sure what the difference is.
I would consider the video you posted a recorded lecture, it's just not on a whiteboard in front of an audience.
it's not the lecture itself, rather the associated problem sets
I am not sure I follow, are you saying this YouTube video has bad examples?
It's clear that we have wildly different standards and expectations. That's okay (and interesting!). I'm not going to trying to bridge that divide. On the subject of exceptions in particular, you could have a 5-10 minute discussion on what exceptions and tracebacks are, the basic idea of how and why they're used. I don't mean one threadbare example and I definitely don't mean implementation details. I answered my own question about a better video and searched the captions of another video that does what this video doesn't: https://www.youtube.com/watch?v=_uQrJ0TkZlc#t=23m44s . It's not perfect but it's the kind of slow attention to detail that seems completely absent from the Mike/FCC video. And it's actually a shorter video, not including some projects at the end. I still wouldn't recommend it.
And yes I insulted the video. I don't doubt that the people behind the video are well intentioned but I stand by those insults. I have a low opinion of the video.
Let's get concrete about this too. When I say recorded lectures can be great, I mean this: https://www.youtube.com/watch?v=Ntgt25qBRuo . This is a typical university style lecture. It's visually rough. It starts with a practice problem, believe it or not. Try it! It's a good problem and the whole class is a discussion about it. There's constant back and forth with the students and we take in multiple ideas and viewpoints. He constantly stops and invites us to reason about the problem. A Youtuber can't realistically do all of that, but our man Mike doesn't do any of it. If I was sitting in a class room or seminar or whatever, and someone tried to present technical details like Mike for 45 minutes or God forbid 4.5 hours, I would just leave. Again, different expectations.
at least the top result isn’t teaching terrible practices
unlike 90% of c++ tutorials
even those from ex. freeCampCode
Hey guys, hope everyone is well ,I'm studying python by the book, "Course in Python" by Novatec publisher, but I still have some difficulties & I don't feel safe, I would really like to improve my knowledge in the language, could someone recommend an online Python course pls
this is the wrong channel for that, you can try #python-discussion for this question, and try out the !resources command in #bot-commands
What do you think a core basics to teach?
please somebody help me with webscraping.. im tired of hours of searching, its a small thingy that i cant manage to pass, please somebody who understands this to contact me :C
So, I'm pretty familiar with the basic stuff python and other languages have in common in the beginning. But what kind of small project/documentations would help with getting out of the bare foundation of python and into more practical stuff?
I like that part of this video better too, but they aren't very comparable.
One explains try/except and handling errors, going into when they arise and good practices for doing so.
The other one goes through reading and understanding errors. I think this is something missing in the course, which I won't defend. More tutorials should explain reading errors.
I guess this ties into a more wide-reaching discussion about teaching debugging, which has been held a few times.
Sure, if you're watching a seminar this long in one sitting you'd need this. That said, my experience in some lectures has been that they introduce the subject like Mike does and then we get on with doing something with it.
This channel is for the discussion of teaching. Please make sure all your messages are about that.
im looking to learn how to start making my own games using python i dont know anything about programming so if someone is willing to help me learn please dm me.
this channel is for discussion about how to teach computer science, but you can open your own help channel from #❓|how-to-get-help or #python-discussion
ok
I'm gonna be teaching python to a group, I'm assuming of which will be mostly beginners. What topics should I start off with? I was thinking
the idea of python -> data types & variables -> functions-> oop -> ... not really sure after that
basic control flow would be a good thing to include (if-elif-else, for, while)
what specifically is "the idea of python"
hi :))) i'm looking to solidify my basics and continue to learn more advanced topics by continually imparting all my python knowledge to people newer than me. I've been given an opportunity by a connection to teach for an institute up until OOP concepts. how do you all suggest i stay ahead of my students and be able to answer their questions? and how do you think i should teach in a way that doesn't diminish my authority in the classroom (since i'm far younger than those i'll be teaching) but also doesn't feel self-righteous and condescending?
lists, dictionaries are a BIG one people get confused on, maybe some modules like random, datetime, os module, sys module (mainly like sys.exit()) , file handling, csv module, and json module
i would say those are the biggest
and it's a meh course if it doesn't cover most of the topics in https://automatetheboringstuff.com/ cause it's free content that people could've gotten elsewhere
but they chose to come to you
I was gonna include those sequences in data types, should I separate the sequences from the other stuff?
Sorta like, explain it's paradigms, interpretting stuff like that
100%, will note that down to do
I totally forgot about control flow for a sec lol
i think you can teach them together, it's up to how fast you wanna pace your class
I think I want to get the nitty gritty down moderately fast, so I can spend the rest of my allotted time to setup group projects, etc
The modules part, I'm sure I could incorporate that into the projects as well
i felt that. projects are very important for python
My main goal is to make my students self sufficient so, I'm gonna be making them gradually learn how to debug and read documentation
I feel like that's gonna be the hardest part of the whole course
make sure to assume your students are on the same page as you, cause some people dont like to be proactive learners
they expect the teacher to do all the work
Yea, I will be doing starting and ending challenges
Basically like, given a function with this implementation what is the behaviour when passed x
And I'm making each student answer, so benchmarking isn't gonna be a huge problem I guess
A good way to see what they know before hand as well, since tomorrow will be my first session
thats a bad idea
lemme tell you why
Alright
alright so people are gonna play follow the leader and take the opinion of the strongest voice in the room and just echo it. it would be a very awkward experience and not as involving and engaging as you might expect
Ahhh your totally right yea people would just use the same answer
it could just be individual
Maybe have them write down on a piece of paper with their answer? Then read it outloud as a group?
That means they would stay anonymous as well
well that is an option, but the way i would go about it is having a google classroom setup and having them turn in a python file
for every exercise
That is doable yea
My plan for "challenges" was just to have a code block which would include things we are gonna learn soon
so people could try to see if they knew what it would do without knowing, sorta like a segway
Rather than having them write their own code block
thats very well thought out
Excersizes would still be done though, like the kind you said
can i dm you @ruby minnow
Sure, I turned on my DMs
and where were you planning on having such code block?
just on your screen?
@sweet torrent Sorry for the misinformation you were given, but your message is not on-topic for this channel, either. Please read the channel descriptions before using a channel for the first time. Thanks!
@weak mortar @near agate hello, this channel is for the discussion of teaching. please ask your questions in #python-discussion or a help channel #❓|how-to-get-help
So I've been tasked with helping individuals learn the code base we have at work. Specifically new hires who have little to no knowledge to python and our line of business. Does anyone have material on creating learning resources.
My initial approach to this is giving them bare bone examples that show how to use the code base and the topic of business. It's less about the cs and more about using the code base as a means to an end.
Following that I would like to give them problems to solve which would require them to produce an already known output, that I could programmatically verify if it is correct or not.
I think what I want is something like hacker rank but it specific to the work code base and our domain/line of business.
Wondering what individuals thoughts are.
require them to produce an already known output, that I could programmatically verify if it is correct or not.
Would this essentially be unit testing, or would it be something that reads the code itself and determines if it's written a certain way? because I'm pretty sure that hacker rank is essentially just unit tests.
What is their experience? Programming in some language other than python?
Yes, unit tests
Fresh college grads with little python and/or Matlab experience
For people that know lots of different programming languages and that are experienced with them, do you sometimes mix up words from other languages accidently even if you know it's incorrect? Just like how people who are bilingual mix words up while speaking?
no, you don't really mix up language features, but you might make errors on a larger scale. things like the idiomatic way to do things. it's the same with natural language, really
also, while a good question, idk if it's exactly related to the topic?
of this channel? sorry I couldn't find another channel that fit my question more
I don't see how it relates to teaching, so probably an off topic channel
Thanks for your response though
I think it could be brought on topic, a piece of advice i've seen floating around here to beginners is to take it slow and only take on one language/tech at a time so they avoid this "mixing/confusing of terms, syntax, idioms"
But anyone who's been to uni would have seen that youre expected to learn multiple different languages at the same time
I don't think the two scenarios of "beginners should just focus on a single language, and learn the fundamentals" and "university students should be able to learn/use multiple languages at the same time" are really conflicting with one another. The advice on focusing on a single language/tech is so that you can, for the time being, only have to worry about one set of syntax for your programming, while you learn the fundamentals that carry over between langauges e.g. functions, loops, conditionals, recursion etc.
Whereas university students are expected to be able to learn/use multiple languages at once, since they're pretty much expected to already know the general concepts that you'll find in most languages, and all they have to do is get accustomed with that specific language's syntax / standard library
They do not, 90% of my fellow university students (including me) didnt know the first thing about programming when we started
University assumes no knowledge and teaches you the very fundamentals
Although, one thing I will add is that at the university I go to, they actually do begin by teaching first-years just a single language for the first semester across all the modules
Well, they assume no knowledge at the very beginning, and so usually put their "programming fundamentals" courses and stuff at the very beginning, but then once that's over, they've now taught their students the basics, and so can expect for the remainder of their studies that they now know programming
Most first year courses start off with two or more languages, those are fundamental courses, arent they? I think its ok to teach more than 1 languages at the same time, if dumb 18yos can do it without issue so can anyone else
i'm surprised to hear that, since my course literally did begin with a single language (C), and then only after that was done did they expect us to be able to pickup all the other languages for the second semester courses within like a week or two (java/php/python)
also, something else to consider is that you are talking about 18 year-olds here, who also chose a computing course, and so not only have they just finished mandatory education at its highest level, but they also (most of the time) have a strong interest in computing, and so are going to be very receptive and willing to learn, and also with university-level support and help available
not everyone here is in that same scenario, some people don't have access to such personal tutoring, and have to self-teach themselves; some people are a bit younger, and may not used to learning a single subject in such detail; and some people may not even have as strong of an interest in programming
Discuss: IDEs should be banned in entry level courses
hard disagree, autocomplete is great for discovering functions/methods
I don't think so. They provide a number of features that's really useful for programming:
- Autocomplete: This is a great way to discover new functions and methods that are conducive to learning.
- Debuggers: It can be really hard to understand what your code is doing when just learning. Teaching people to use a debugger is huge.
- The Run Button: Yes, I hate it. But sometimes learning to use the terminal and what have you while also learning your first PL can be difficult.
But like, earlier today I answered a help question where the user was calling a class without the ()
And the user blamed their IDE for not telling them it needed ()
I worry that IDEs are doing too much for beginners
what did the IDE do for them in that scenario
It's that they expected the IDE to do it for them
I.e. has it become such a crutch that if the IDE doesn't do it, then they don't know what to do?
what created such expectation? what did the IDE do for them in other scenarios that they somehow expected this to happen automatically
I'm not sure. They left after I answered them
i wouldnt really blame the IDE for this tbh
that's like saying calculators are a crutch lol
i mean sure, they might be
Well they can be
but like they save so much time
Beginner math doesn't permit calculators
fair enough
I disagree with this completely. I know Zed Shaws book, learn python 3 the hard way, doesn't get a lot of love around here but imo learning to debug with pdb, using help and taking script entry points through sys.argv was super helpful long-term. Especially when I got a job that didn't have IDEs and virtual environments at the ready i.e. all I had was a terminal editor and python and I had to manage my python paths manually
I absolutely agree that they shouldn't be the only thing you know how to use (although a job not giving you access to venvs or editors seems.. concerning). But I think that's a heck of a lot to learn at once, and gradually learning things is important. Dumping everything on people at once is how you get people to quit.
The last sentence is fair. I sometimes forget that my first programming course, was vba for office and I had visual studio. I also had c/c++ course and lots of Matlab experience before learning python and reading Zed Shaws book.
To your point about jobs not offering tools. I will say a lot of hardened air gapped systems for defense companies are like this
For example DoD blocks pycharm bc it has Russian ties
My first job out of electrical computer engineering degree, I had to ssh into said systems and had nedit and vim
ah. i'm not in the job industry, so not really familiar with all that.
Which is why this good discussion. Differing points of view are good for coming to correct conclusions 🙂
I'm not against IDEs, in fact I think they should introduced fairly fast but I also think the barebones of the language are good to learn upfront rather than later
I've certainly pimped out my vim enough for it be IDE like
beginners dont need pdb
in my 4 years of school and 1 year of work i've only had to use pdb recently and thats due to legacy code and badly configured apps/products
let them learn with the help of an IDE, the only place they'll see all this obscure tech would be when they enter the workforce
and by then they should be adept enough to learn on the job by themselves
learn python 3 the hard way
this book is widely disliked
I think that autocomplete and pep8 linters are net positives, but that setting up virtual environments and pointing the IDE to them can be intimidating for beginners.
!otn a pimp my vim
:ok_hand: Added pimp-my-vim to the names list.
As seen by the sheer number of beginner questions about why their code works in their IDE and not outside
or vice versa. "I installed x library, why does pycharm say I don't have it???"
I've joked ||or was I not joking|| before that pycharm should require you to do a quiz about virtual environments and pip before you can use it, and it should delete itself and prevent you from installing it again for like a month if you don't pass.
I'm willing to admit that I may be biased. That's why I asked the question. Back when I was in university we learned c++ using emacs which didn't have any syntax highlighting etc back then
And even at present day I often prefer a nice vim terminal over a busy distracting IDE gui
the only time I was required to not use an IDE was my intro to java class, and by making us type out all the verbose nonsense by hand, I think that only made people realize what a bad language Java is even faster. so I guess I'm grateful for that.
Lol. Coming from a c++ background I remember being a bit mind blown when I learned that Java booleans were stored as more than 1 bit.
I was like... But why?
Depends what you consider to be an IDE. I find a lot of "IDEs" to be very buggy and slow these days, but in theory there would be no downside if done well.
Well, other than the problem of tooling in general, people shape tools, and tools shape people.
the threshold for me (between IDE and editors in general) is that it shows you what options there are when you do the dot operator. I can't imagine something claiming to be an IDE that doesn't do that.
and yes, if someone made a vim extension that does that, I'd be willing to call it a terminal IDE.
Unix is an IDE, always has been. It brought multiple things into one integrated environment.
what if we decide that the E stands for editor.
In the 1960s-1970s, Ken Thompson co-invented the UNIX operating system along with Dennis Ritchie at Bell Labs. He also worked on the language B, the operating system Plan 9, and the language Go. He and Ritchie won the Turing Award. He now works at Google. He’ll be interviewed by Brian Kernighan of “K&R” fame.
This talk took place May 4, 2019. V...
(Editor, assembler, "overlay" (integration))
regarding code completion for beginners: if I were to play devil's advocate, I would say they need to learn how to refer to the docs. thoughts on that?
I feel that autocomplete just quickly pulls up the docs, depending on the type of autocomplete. A very basic autocomplete seems to pull it from nothing with no explanation / comment / docs associated with it.
In theory this is nice, but in practice as described before, it's buggy and annoying to setup / needs to have the docs for everything automatically (packaging system / programming language used can affect this).
Because this does not work out in practice one is still required to manually look up docs (probably via web browser).
Reading docs is a great thing to learn so I'm all for it
In a real world scenario reading docs is often mandatory
*There is also actual "documentation", as in documents that may not even contain any code or API reference, and needs to be read through like a book.
An autocomplete pulling up small parts of it can only assist after having already read it (and maybe the autocomplete could link to the section with a hotkey to open it up (this is very rare for autocomplete out there)).
Python docs are incredibly disorganised to the point that I'm starting to think its intentional
Good luck trying to find methods with a google search
The official python docs are some of the most well organized out there
So idk what you're talking about
you're joking right?
Uh, no
imagine being a beginner trying to look up something as simple as str
never mind the fact that you have to find https://docs.python.org/3/ in the first place, things dont show up on the first page of google results
lol, yeah, w3s and g4g always manage to be first
I urge you to try this search right here
https://www.google.com/search?q=python+string+split
googling "python string" doesn't yield that page
That seems to be a Google problem not a python problem
This is getting offtopic, the point is that you shouldnt have beginners struggle for any reason, learning things the hard way is such a silly way of looking at things
The "problem" is that python is so popular that seo powerhouses write click bait articles that overwhelm Google's algorithms and mask the official python docs which are quite helpful.
that sounds like a python.org problem tbh
fact is, documentation is hard to get to, IDEs put it literally in the editor, why mess with it?
Can someone help me with pyqt? there #help-lemon PLS!!!!
it is
https://docs.python.org/3/ quite literally does not have a <meta name="description" content="..." />
that is how you get shit SEO
why does googling "python string split" provide a result from the 3.3 docs??? i don't even know how it ends up deciding that the 3.3 version is better than the 3/current version
for me, the docs aren't even on the first page
as for other search engines, duckduckgo doesn't show the docs on the first page, rather, it has an infobox on the right-hand side.... displaying the 2.7 docs.
(though on a tangent, for anyone else who uses duckduckgo, searching "!py <whatever>" makes it redirect directly to the python docs search page with your search query, which i find pretty useful)
yeah, all browsers i've used have allowed settings like "prefix your search with x to search only in a certain y"
This isn't really on-topic, but Python docs are never the highest ranked result. It's always w3schools
we can sorta bring it to teaching, kinda. for a beginner googling something, they don't know w3schools is potentially bad
Whenever googling something and I want something directly from https://docs.python.org/ I add 'python documentation'
docs.python String Split works for this example, but yes it's a problem. No real clue how to fix and google doesn't let one do search personalisation as much
the Python standard library documentation is pretty difficult to navigate until you learn where to find things
also, a lot of important information is buried in long sections of "conversational" prose, or organized into "definition lists" but where you can't link to individual items for lack of an HTML anchor
the newer documentation pages are much better in both of these aspects
!otn a w3schools is potentially bad
:ok_hand: Added w3schools-is-potentially-bad to the names list.
the authors of w3schools clearly know a lot about seo. I just wish they knew python.
also the official python "tutorial" is useless for anyone who is not already an experienced programmer in other languages. all that is to say: python documentation is thorough and mostly well written but difficult to navigate if you don't already know what you're looking for, and i definitely would agree that it is an impediment to beginners
same with riptutorial and tutorialspoint and whatever those other sites are. some realpython articles are also quite bad.
in the programming language theory course for my undergrad, the instructor said that the python docs are the very worst thing about python. in the same lecture where they listed other widely-made criticisms of the language.
it's certainly among the worst things, and it's a testament to how good python is because the docs really aren't that bad
also the absolute worst thing by far, incontestably, is the state of packaging and dependency management
it's the best it's ever been, thanks to a lot of hard work by dedicated people thinking carefully about the problems at hand, and it still kinda sucks
and surprise! it's also a major obstacle for beginners
Most sites with good SEO are junk. It doesn't help anyone else, but if you're not filtering your own search results with an extension, you are doing it wrong. And in w3schools' defense, I've found some of their pages to be just the right amount of extremely basic for some people.
Python's docs are very much all over the place. I find that people coming from languages like Java do not like them. A lot of it is written like a tutorial and if you don't lean into the search engine strategy, you're going to have a bad time. Even then though, there are some weird choices, e.g. if you want a list of keywords, it's buried in the language spec.
i should create some free resources tbh
although we have that here when we type !resources
but i want to contribute something to the community
i'm thinking of starting a coding twitch channel with an emphasis on the learning process vs. teaching someone the commands/technical details
because watching someone go through trial and error can be really helpful in your own jouney
i'm not sure though, it might be a little out of budget for me
streaming yourself creating some sort of project can be a good way of teaching your viewers, bringing them along for the ride as you learn yourself, as long as you try to keep your thought process out loud, so that your audience can follow along with how you're dealing with problems or bugs that arise
I think it definitely can be, particularly as motivation for younger students who get discouraged when they run into a problem. However it's also not the best medium for "archiving" any amount of information
yup
yeah i get what you mean
@weak mortar this channel is not for learning advice. Try #python-discussion
We're in second year of engineering, and I feel like some people might find the method used by our teacher at least interesting:
To keep the class engaging, he built a candy-crush like game. But to avoid having the student build the entire app over a 12h class an not have anything working before then, he created a C library that implements all the functions required first.
For instance, the file would contain a function such as
def match3(grid, pos):
return teacherLibrary.match3(grid pos)```meaning the code works right away. At some point in the 6 booklets we have for each session, it will explain to you the logic needed inside that function, and task you with replacing the call with your own code.
What do you think about this? I find it quite interesting, although while it has some instant feedback benefits (good for ADHD students lol), you loose any sense of progress over the 12h. If I were to design the course, I'd probably mix it up with rewrite and original code.
That is really neat. Thanks for sharing.
can you share the code lessons?
I don't believe so
i am taking the python 4 everybody on coursera. Is it just me or the assignments cover something beyond the course? i feel that I am not adequate for them. How can I go on learning the language beyond watching videos from it and memorizing the codes from the solutions?
I think this is a pretty cool idea. I think if I were to implement this, I would have everything implemented like the teacher, but they would be relatively incomplete. i.e. it would work, but the students could easily improve on it. that way you would have the sense of accomplishment without having to build everything yourself
Hm'yeah, I think that would make most sense
in some hackathons I helped run in the past for beginner programmers (primarily a fun, learning thing), we gave a very narrow theme, like "make tic tac toe", and gave starter code. in this code, pretty much everything worked like I described, but it was very "cookie cutter". the competitors had to add their own features.
based on feedback we got (aka, response bias, lol) this worked pretty well for the reasons you mentioned, just skip the boilerplate and get right into the logic
I'm wondering if anyone has suggestions on good github open source projects that I can read through and try to understand
ideally ones that have lots of programming 'good practices' and not something ML/cryptography, because that's basically learning the math and theory in that field and then implementing it by importing a lot of libraries
Has anyone has success with learning this way?
Hey there! Whats a good free resource to learn python for data science / ML ? Something similar to TOP but for python?
for basic regression, train/test and such w3schools is a nice site
@kindred scaffold @slender wraith this channel is not for resource suggestions. Also w3schools gets a -1 from me.
I'm interested in why w3schools gets a -1, it was very useful when i first picked up ML
This conversation belongs in #data-science-and-ml
guys i am confused, for programmer is important know fundamentals of computation, like math and others, or just know the things works in the language?
is relevant study everything that is there in grid of science of computer?
A lot of theoretical computer science isn't relevant to the day-to-day work of a developer. I'd say the most important pure CS course is the algorithms and data structures class, because it gives one the theoretical framework to understand how efficient (or inefficient) their program is, understand what optimizations might be available, and understand what kinds of optimizations will actually have a noticable impact.
That isn't to say that getting a CS degree isn't important. I think it's a bit of a historical accident that CS came to be "the developer degree", but it's still the credential that goes furthest towards making someone employment ready.
thanks for your answer, help me so much, and in relation for developer the know for be programmer what you suggest focus in study?
Also there are so many different types of programmers. A programmer that programs chemical simulations is very different from a programmer that makes web apps. "Programmer" on its own is not descriptive enough.
yes, but when i think about programmer i say in make softwares
I think it's a bit of a historical accident that CS came to be "the developer degree"
it mainly evolved as an extension of a mathematics degree, didn't it? mathematicians were the first programmers, so it only makes sense that CS became the "developer degree" as you call it
There are common parts though. Such as A&DS, architecture, programming style, working in teams, etc.
Algorithms and Data Structures can be seen as a branch of mathematics.
But I think when most people ask if they need math, they mean other branches.
(Probably algebra and calculus)
at least in the us, i think most of the time when people ask "do i need math for x", they're asking if they need calc, since it's the highest level of math they've heard of. mostly this is from high schoolers, i think
(Colleges keep CS as "not math" so it does not also count towards a math degree...)
but in the field of AI, it is relevant to learn some areas of mathematics, such as algebra, probability, statistics, right?
Yes.
(More than "some")
in relation learn about circuits logic, compiladores, port logical is relevant understand the concepts for programmer?
Depends on what the programmer is programming.
It's kind of like asking if a chemist working in Germany needs to know math or just learns German. Learning German is the starting point.
(e.g. learning Python lets one do anything at all)
understood, thanks for answer
because i was study for grid of CS
This is only part of what exists within "CS":
so i was studying fundamentals of math for computation that talk about logical of predicatives.... and others things
"I'd say the most important pure CS course is the algorithms and data structures class" - Stelercus.
If you get past algorithms and data structures, I think you will have a much better idea of what to do next.
The other most important thing is probably just practical practice of making some apps. Simple ones, like a todo list, clock, etc.
So that you are comfortable enough to create anything you want without having to consciously think about the code too much (like having to count on fingers versus just doing it in your head really fast).
understood, so i guess that i will study about algorithms and data structures, and backend
and more for front understand the conceps of theoretical computer science
I would not think so much about backend vs frontend, but the app as a whole.
I would not start with web apps either, they have a lot of complexity that is due to historical accident. Just some simple apps in say, Python.
understand the concepts the build of one software, the requisites , everyall that is necessary like architect of software..?
If you just try to make some apps with Python (TUI, GUI). And read other people's code, you will naturally encounter various styles / architectures, which you can copy in your own projects.
Explaining how apps / architectures are made to someone when they have not tried to make an app before is like trying to explain how to drive a car in theory without having ever tried it. The detailed steps of how to do so can work out, but it's much easier to just watch someone else do it and feel it out yourself.
(The detailed steps help a lot after having tried because they contain some pretty well thought out / precise knowledge (especially for avoiding issues that are not immediately obvious))
(And avoiding non-obvious mistakes is what these design theory classes are all about)
copythat, thanks so much my friend.
TLDR: Just do it ™️ . Make things, read code, read docs.
ok, thanks
This site seems very focused on / biased towards web development.
these roadmaps all seem really weird to me.
people to make algorithms, and develop the python language, as challenges, do you have any sites you recommend to train?
People in #data-science-and-ml often ask what libraries they need to learn to understand AI. But because of the way the AI ecosystem is arranged, that strategy won't actually teach you anything if you don't already understand what you're trying to do. Is there a domain where people can succeed from "learning libraries"?
web dev
GUI programming (frontend web development too)? No math, just design and knowing the ways the widgets/components work, and can be interactively / visually debugged making it much easier than other things. Although, the quality can be questionable without understanding more (e.g. many slow/buggy websites made with big complex framework X without knowing how that framework really works). It's also popular enough to the point where everything about those libraries has an answer online.
Data engineering. Learn best practices with pandas and you'll learn a lot about data engineering
@orchid fox please don't drop random links without saying why they're interesting. it's a discussion channel. if you want to have a discussion about a video, say what you think is interesting about it, so that there's some basis for a discussion. and if it's self-promotion, don't post it.
Yeah sorry bruh I wanted to ask abt something in that class
this isn't a help channel. See #❓|how-to-get-help
Nah I want to share my views
I already said not to do self-promotion.
Is there a word where the program does stuff internally automatically
Ex: if i use print() the program automatically makes new line, but i could change that
this channel is for discussion about how to teach computer science, but you can open your own help channel from #❓|how-to-get-help
i thought that this was a small question so i don't waste a help channel so should I just use it then?
yes
is this where ppl help me w my code
This is the channel about how to teach computer science, but you can open your own help channel from #❓|how-to-get-help
tysm!
can anybody help
A question about teaching programming in "layers".
When teaching Python, you often run into things that are like: "oh don't worry about it yet". In particular, error messages are very confusing for beginners because while they are technically correct, they don't speak about the limited set of concepts the student was taught.
I have quickly gone through "How To Design Programs" and I liked DrRacket's approach of having different languages for different stages of learning. I wonder, are there any attempts to apply this to other languages?
Or well, is there any research I could read/watch about layered tutorials?
I think it's kinda of a no-brainer thing, videogames have been doing that for ages. You only have a limited set of abilities in the beginning, and then you get more and more stuff. And teaching programming in a "real" programming language seems like OpenTTD which is like... here's all the stuff, have fun!
you often run into things that are like: "oh don't worry about it yet"
Just one example: ```lsit = ["a", "b", "c", "d", "e"]
list[3]
list[3]wtf??
I have a theory that the "don't worry about it yet" theme is so commonplace in programming because of public static void main
I can't think of a programming language that bombards beginners with language features that they aren't prepared to understand as immediately as Java.
C++? 🙂
i think it's better demonstrated in certain languages, but is present in pretty much any (usable) language
because programming has a lot to it, and dumping that on a person all at once is Not Fun
like you showed above, Python has it's own stuff
types in general are another good example
well, the example I gave was DrRacket, which has different "stages" where different sets of features are available
basically, my question is:
how do you get rid of accidental complexity when teaching programming?
is "don't worry about it yet" really all that bad
its not just programming that has that, its in every stem subject
probably non stems too
well imagine if you poke number 3 you get integrals that burn down your house
i like "don't worry about it" as long as you follow up with "but if you're curious, take a look at x, y, and z." it gives room for exploration, while not overwhelming the learner immediately.
it's pretty difficult to teach programming without a bit of "don't worry about it for now", especially since in most languages, some things which are seemingly simple at face value are really doing something a little bit more complex underneath (e.g. newcomers being taught for i in range(n) without really being told about how range(n) is actually being used as an iterable object or anything)
I think of a lot of this is due to historical reasons that result in a lot of rituals programmers have to go through to get anything done (Python has much less of this which is why it's much easier to get into and get anything done). And another reason is many (most) compilers/linkers/interpreters/etc have bad error messages (at least print a snippet of where the error happened in the code (includes the surrounding code to make it easier to visually find) and underline the line with a plain English message for the most common errors) (Python still has terrible error messages). Videogames have several properties that make them similar to interactive programming (REPLs are like a really weak version of them) and we should have way better interactive programming tools (Jupyter Notebook is not good IMO). For more on that: https://www.youtube.com/watch?v=8Ab3ArE8W3s
Most new programming languages are accidentally designed to be backwards compatible with punchcards. This talk argues that it would be better to focus on building new live programming environments that can help us solve the problems of the future.
Jack Rusher
Applied Science Studio
@jackrusher
Jack Rusher's long career as a computer scientist ...
C++ not only bombards beginners, but non-beginners too. It never ends, which is why everyone picks some subset of the language and works in only that, maybe adding a few new features every couple of years.
*Also going beyond error messages, how about interactive errors? For example, when someone encounters an error, they have the option to start playing 21 questions with the compiler (debugging the programmer, rather than the code).
I remember hearing about something (maybe it was someone in this server who mentioned it?) about a language which lets you spawn a repl at the point your program crashed
Some debuggers can do this (even in compiled languages), but in video games they already do this all the time. Videogame developers often use interactive programming/scripting and hot-reloading code in addition to being able to save the state of the entire program and the past N frames (so they can even rewind).
A lot of people don't use python interactively and that is insane to me.
%debug in ipython repl
Smalltalk and lisp both do this at the point the error occured (ish), but IME it makes learning it kind of a nuisance until you get used to deciding whether to fix something in the repl or in code, since there are cases where either is applicable.
you guys wanna see my work in progress towards making a high/low card game?
Hi and welcome!
This has nothing to do with #pedagogy . This may be more suited for #python-discussion or an off topic channel
for light programming (I only use python and html) do you recommend atom or vs code?
atom was dropped, so vsc
but also this is off-topic for this channel, see #editors-ides
to make it somewhat on topic, what editors do you think would be the best for a beginner? the two IDEs i see recommended to beginners are Mu and thonny, or occasionally vscode.
i recently started teaching two people python; we started with idle then switched to mu, which has been ok. one issue we seem to keep running into is having two copies of a file. one they are running in the terminal, and one they are editing in Mu / idle. in this sense, the IDE has been pretty annoying. i wonder if we'd have this issue with a different terminal editor like nano or something.
(this is kinda turning into a long ramble, oops)
on a related note, what's the right amount of intellisense for a beginner?
sort of the opposite of that, one editor I'd probably recommend against to someone new to programming is PyCharm. There's a lot of people who come in for help with their installed libraries not working due to pycharm's auto-venv functionality.
as for right amount of intellisense - I think in general the kind of autocomplete you get with VSCode or PyCharm is alright. In my experience, it didn't really hinder anything.
in my case specifically, the auto venv issue wouldn't be a problem. that's only an issue for someone that doesn't know what a venv is or is unaware of that option
right, yeah, but someone new to programming most likely isn't familiar with what a venv is
it's probably not a good recommendation for someone looking to learn by themselves, but in a more structured class setting I think it's fine. my issue is that it was just too heavy for my students' laptops
fair enough
my bad