View Single Post
Old 05-04-2013, 09:18 PM   #9
camlorn
Member
 
Join Date: Aug 2011
Posts: 144
camlorn is on a distinguished road
Re: Learning Programing

let me be more specific. Cpython is slow. Pypy is still slow, but less so. If you want to use it to learn programming, OK, but do be aware of it. You can make up for the slowness if needed by writing more clever code, but you might run up against bottlenecks in the main game loop. Cpython is a purely interpreted environment with dynamic typing, which probably means nothing to you at this point. There's a large quantity of overhead both in terms of memory and CPU.
I'm assuming that this will be the only mud. I don't think that "good enough for the first mud" is a good philosophy. Let's make a mud and then just let it die so we can make a better one?
I was accessing the mud over a network. It had a lot of artificially imposed limits that scream we have performance problems let's add a delay instead of fixing it to me, and everything was sluggish. I accessed it from a completely sufficient network connection, and it was reasonably active--the issue was certainly not my network, as I played for a while and wasn't having any other problems on other muds or on the internet at all.
My point here is twofold. First and foremost, Python will let you write programs, but in a realtime-sensitive environment it will not be as forgiving of suboptimal algorithms and design philosophies--given that you're learning programming, you're not going to know the fastest and most efficient way to do things, and that's OK, but Python might become the limiter. Secondly, if you want to have, for example, room descriptions that call into Python code all the time, i.e. to change depending on time of day, or to change based on the direction you're coming from, or if you want to do a lot of pathfinding all over the place, or any number of other things that demand a lot of resources, you'll run into Python's limits again. Pypy will alleviate this, but I truly don't think it will do so completely. You write an area that has room descs that ask python for the time of day all over the place and change "to the left" to "to the right" if the player comes from the other way, a player leaves brief off and speedwalks through 30 rooms written that way, your custom description parser thing kicks in for each of those interpreting your special codes for that and making the python calls, and the mud is going to hiccup, I can almost guarantee it.
The good news in all this is this: learning one programming language, at least if said programming language is object oriented, is going to teach you most of the other ones in existence. It's not like english--each new language will bring one or two new concepts, and some new syntax, and that's about it. For the most part, anyway. I just don't think that a mud, someone who is trying to learn programming, and python will mix well. I don't think that a mud and python will mix well anyway, at least not for a hack and slash mud, and would require a lot of convincing to change my mind.
camlorn is offline   Reply With Quote