16 Jan, 2012, Trask wrote in the 1st comment:
Votes: 0
Hi all,

I'm a long time lurker around here. I occassionaly dabble with trying to teach myself coding, normally with less than stellar results as I find another passion and discard the old. I always seem to be brought back to the mud community for some reason though.

Once more, I've committed myself to learning C/C++ and coding in general. I'll be doing this with help from friends I (hopefully) pick up along the way, and through self learning over the internet. My question is as implied in the title.

After reading a lot of posts here, I know that many believe that interpreted languages such as Ruby are a much better means of coding a mud/mush/moo, as computing power is no longer such a factor in the implementation of what is essentially 30 year old software.

I still get a sense though, that if you can code in C, you've 'earned your chops' and can from there derive pretty much any other means of coding, much as the musician who learns piano, and then applies that to every other instrument he learns.

I'd like to know what people think about this, as I start to play with various codebases.

Thanks for taking the time to read this, and for any replies you might make.
16 Jan, 2012, KaVir wrote in the 2nd comment:
Votes: 0
You'll find that most mud developers have a preferred language, and some of them will try to shove their preferences down other peoples throats. But the more competent developers understand that programming languages are just tools, and that each language has its own pros and cons.
16 Jan, 2012, plamzi wrote in the 3rd comment:
Votes: 0
Trask said:
I still get a sense though, that if you can code in C, you've 'earned your chops' and can from there derive pretty much any other means of coding, much as the musician who learns piano, and then applies that to every other instrument he learns.


I think this is largely a myth propagated by those who've poured a lot of sweat into learning C and think everyone else should bow to them for it. Pretty much any language (or even script) can teach you the principles of coding. Where C is concerned, you can say that it provides a glimpse into the world of lower-level languages, but it won't automatically make you better at acquiring other languages or even reading other languages. (The musical instrument analogy is probably largely a myth, too, since other than reading notation, or switching from viola to violin, a lot can vary.)

Unless you're writing drivers or something that needs to squeeze every bit of performance out of the hardware, writing in a more modern language usually frees you to worry about more important stuff than, say, where to free something from memory. If you have a specific project in mind (I would get one), then you can weigh the pros and cons of a given language. A lot of the time in the MUD coding community C/C++ wins out just because most of the major/popular codebases use one or the other. If your goal is to learn by building up on something existing, just go with whatever excites you most, and you'll get furthest. But don't choose C/C++ just because someone said you should. In today's world, C/C++ should be the last languages you would pick to code a MUD, since even basic string processing turns into an arcane chore. C++ is a lot better than C, it seems, but still a generation removed from something like Ruby.

If you really don't have a specific project in mind, I would think about which language is a good move career-wise. Coding for a game is a great way to pick up a marketable skill while having fun.
16 Jan, 2012, Rarva.Riendf wrote in the 4th comment:
Votes: 0
Quote
writing in a more modern language usually frees you to worry about more important stuff than, say, where to free something from memory.

That itself is a myth. It does not help you a bit about where (or when) to free memory, hence all the bloated software around. It only helps (tremendously, but still only) by managing how it is done. Not where,not when. the fact that learning C helps you in another langage, is since one day in your life you were forced to understand memory management, you actually understand that leaving a global array will not have its memory released even if you do not use it anymore.
16 Jan, 2012, KaVir wrote in the 5th comment:
Votes: 0
plamzi said:
I think this is largely a myth propagated by those who've poured a lot of sweat into learning C and think everyone else should bow to them for it.

You could make the exact same statement about other programming languages as well. As I said in my previous post, "most mud developers have a preferred language, and some of them will try to shove their preferences down other peoples throats".

I'd also recommend checking out this vaguely related (but rather interes... in which people discuss their views about scripting languages.
16 Jan, 2012, plamzi wrote in the 6th comment:
Votes: 0
Rarva.Riendf said:
Quote
writing in a more modern language usually frees you to worry about more important stuff than, say, where to free something from memory.

That itself is a myth. It does not help you a bit about where (or when) to free memory, hence all the bloated software around. It only helps (tremendously, but still only) by managing how it is done. Not where,not when. the fact that learning C helps you in another langage, is since one day in your life you were forced to understand memory management, you actually understand that leaving a global array will not have its memory released even if you do not use it anymore.


Any language requires some level of memory management, and from it you can learn the basic concept. But when I compare the time I've spent in C dealing with the implications of stuff like "'strdup' allocates, 'strcpy' doesn't" vs. the time I've spent in Objective-C, it's not looking good for C. Some languages make some things easier. Memory management and string processing are not easy in C–that was my point. If you believe that anyone who can write in C is less likely to write bloatware in any language, as I read your post, then I'd say that's highly speculative and debatable.
16 Jan, 2012, Runter wrote in the 7th comment:
Votes: 0
C doesn't imprint upon the mind something indelible about best practices or low level operation of a computer necessarily useful in other languages. Instead, it's likely to build fallacy and confusion when dealing with something different. Perhaps knowing any programming languages helps you learn another, but it's not exclusive to C. So let's not propagate a myth that C has some inherent synergy with other languages that will further your education. It's a tool like any other. If it's not the right tool for what you want to do as a developer then don't learn it. Muds aren't good candidates for the C programming language.
16 Jan, 2012, Rarva.Riendf wrote in the 8th comment:
Votes: 0
Runter said:
Muds aren't good candidates for the C programming language.

I agree you on that. Definitely.
16 Jan, 2012, quixadhal wrote in the 9th comment:
Votes: 0
C or C++ have plenty of relevance today, however IMHO, both are poor choices for coding a MUD.

Both languages give you a great deal of control over how things are done, and relatively low-level access to your operating system's resources. Neither of those things are very useful for coding a MUD.

A MUD is a giant state machine which spends 99% of its time parsing and manipulating text strings. It collects user input, parses it, pushes states around, and produces output. The interesting part of a MUD happens in that part where the states get pushed around, and a little bit in producing the output.

Newer, higher level, languages take care of many of the annoying details like memory management, having strings as a base type which can be directly manipulated and compared, even matched against regular expressions or against a grammar, without need to fiddle around with how they're stored in memory. Data structures take care of their own references, and persist until nothing points to them anymore.

Basically, you can focus more on the algorithms of how you want things to work, rather than making the compiler happy, or making sure you're freeing every drop of memory when it's not needed.

Do they make your code sloppy or bloated? Not by themselves. You do still have to think about things like "If I make an array with 500,000 elements – how long does it need to hang around?" But instead of fiddling with malloc/free or new/dispose, you just place it in the right scope and if you pass a reference somewhere, make sure it gets cleared (often automaticaly, by going out of scope).

If you want to code a MUD, decide what part you want to code. If you want to build a game, pick an existing toolset – LPC, NakedMUD, CoralMUD, TeensyMUD – whichever one is in a language that looks like you'd enjoy using it. If you want to build a toolset and play with sockets and parsing and stuff, choose a language itself – Ruby, Python, Perl, whatever.
16 Jan, 2012, Tyche wrote in the 10th comment:
Votes: 0
Trask said:
I still get a sense though, that if you can code in C, you've 'earned your chops' and can from there derive pretty much any other means of coding, much as the musician who learns piano, and then applies that to every other instrument he learns.

Perhaps, but you haven't 'earned your balls' until you code in assembler. And you get 'brass balls' for entering machine op codes straight into debug. ;-)
17 Jan, 2012, Trask wrote in the 11th comment:
Votes: 0
Thanks very much all for your replies.

Took me quite a while to read KaVir's recommended thread.. which was quite interesting, so thanks man, although a lot of the time it turned into cheap sniping which, while humorous was a bit embarrassing also.

plamzi said:
(The musical instrument analogy is probably largely a myth, too, since other than reading notation, or switching from viola to violin, a lot can vary.)


My housemate when I was going through university did exactly this. His knowledge of piano had him picking up guitar, bass, piano accordian, even harmonica, and being quite adept within days. I never understood the mojo behind it, but it was very impressive to watch. I know what you're saying though, it just came to mind while I was typing.

What seems to be the take away message, which I guess I should have foreseen, is that there is no best language in terms of teaching yourself coding.

quixadhal said:
C or C++ have plenty of relevance today, however IMHO, both are poor choices for coding a MUD.
If you want to code a MUD, decide what part you want to code. If you want to build a game, pick an existing toolset – LPC, NakedMUD, CoralMUD, TeensyMUD – whichever one is in a language that looks like you'd enjoy using it. If you want to build a toolset and play with sockets and parsing and stuff, choose a language itself – Ruby, Python, Perl, whatever.


After reading this thread, pondering it for quite a few hours, and looking at codebases further, I think I've decided to go with Nick Gammon's Tiny Mud Server. It's coded in C++, which is the language I've always wanted to learn, but never got around to, and is small enough for me to get to know the existing code quite well before trying to add to it.

I'm not out to add another half-arsed mud to the community, run by staff who only marginally know what they're doing, that's pretty well covered. I just want to muck around and see the results of my actions. And I think taking an existing codebase that's been heavily developed will be counter productive to my needs.

Thanks again all for giving me a lot to think about.
17 Jan, 2012, Hades_Kane wrote in the 12th comment:
Votes: 0
Piano and Guitar are actually quite similar string instruments, and going from one to the other of those would be a lot easier than, say, going from Piano to drums or the saxophone ;)
17 Jan, 2012, Ssolvarain wrote in the 13th comment:
Votes: 0
You'd think the guitar and violin would be similar, but you'd be awfully surprised.
17 Jan, 2012, Hades_Kane wrote in the 14th comment:
Votes: 0
I'm not a "musician" (I am a vocalist in a band, though, and most of my family and many friends are) but I have dabbled with both the violin and the guitar, and they are a lot more different than one might assume :p
17 Jan, 2012, plamzi wrote in the 15th comment:
Votes: 0
Since we're all veering off, I'd like to share that when I switch from violin to pipe organ to Indian sitar, I suck at all of them equally.

I think the moral of the story about Trask's housemate is that some people have it, and make it all look deceptively easy. It's called talent, and you can't have it in everything you try.
17 Jan, 2012, Cratylus wrote in the 16th comment:
Votes: 0
If you care about this stuff beyond just being a hobby, you should keep in mind that
USA Americans (and presumably our rich Western friends) face pretty stiff competition
from offshore people. If a guy in Mumbai can code as well as you can, but asks
for $9/hr, you'll need to have skills beyond knowing which algorithm to use where
and why. This is because even if you are an awesome coder, Mumbai guy offers 3
key advantages you may not:

1) He's cheaper
2) He costs less
3) $$$

My suggestion is that folks shouldn't just focus on the "I'm a coder" part of their career.
Knowing all about hammers and saws and nails and joists and joints and etc is fine
and worth knowing. But you should also consider making yourself valuable by being
a bigger picture guy…with an understanding of the systems that go into designing and
building a house…rather than just planning on being a highly paid tradesman carpenter
forever.

-Crat
http://lpmuds.net
17 Jan, 2012, Trask wrote in the 17th comment:
Votes: 0
plamzi said:
I think the moral of the story about Trask's housemate is that some people have it, and make it all look deceptively easy. It's called talent, and you can't have it in everything you try.


Very true Plamzi, I didn't mean to create such as discussion on the principles of learning musical instruments, I just thought it was a useful analogy with respect to the learning of coding. There is no doubt that my old housemate was talented, but I know he always used the piano as his baseline for teaching himself new instruments (in general). I simply wondered if that could be converted across to the learning of coding.

Perhaps it was not a case of piano being a superior instrument, or C/C++ being a superior language, as I was originally postulating, but like a first vocal language, it was his way of thinking, and he therefore adapted that in the learning of everything else. I think this might actually be the case now that I consider it. As I can attest to, once one learns the mechanics behind his native language (say English), it is much easier to learn other languages. Which is directly fitting with what KaVir said reference coders having their favourites. Thanks very much all, that makes things a lot easier.

Cratylus said:
If you care about this stuff beyond just being a hobby…


I know this comment is directed at everyone bothering to read Crat, but as far as I'm concerned it is simply for a hobby. You raise some very interesting points though, that make me glad I don't have to compete in my line of work, with offshore agencies undercutting the market. Globalisation is a wonderful thing… for those of us not caught in it's grinders.
18 Jan, 2012, Ssolvarain wrote in the 18th comment:
Votes: 0
Trask said:
I just thought it was a useful analogy


Mudbytes is powered by analogies.
18 Jan, 2012, Idealiad wrote in the 19th comment:
Votes: 0
MudBytes is like a finely tuned piano played by a C++ psychocoder from Mumbai?
19 Jan, 2012, David Haley wrote in the 20th comment:
Votes: 0
Quote
I know this comment is directed at everyone bothering to read Crat

Eh… that's a funny way of putting it.
0.0/24