Programmers should try working together using only libraries, each programmer assigned to study different libraries.
Example: One would learn to use sd_Pixel Projectiles, another learning “someone's” Attack Datums (while implementing an element wheel), and the other two learning to use Forum_Account's HUD lib and Forum_Account's AI (I know AI's not a library, but it's still very simple to learn from and write yourself a decent AI code.) The Core Coder/s code the base of the world, but would have enough coding know how to integrate the “library programmers” codes into the game.
It'd also be nice to see programmers add in their “classified ad” libraries they're proficient with. So for instance, in my space game I'd like to have ships which have an outside (64x64 pixel icon) and an inside (20x20 tiles). I would look for assistance from someone who's fluent with Forum_Account's Map Instancing or LummoxJR's Swap Maps, then I can have ships created and saved at runtime for each player who buys a ship, rather than pre-mapping a hundred ships on a z level (Ships can also be destroyed, which would make the pre-mapped ships more complex code-wise.)
ID:399041
Feb 28 2012, 1:38 pm
|
|
Feb 28 2012, 1:46 pm
|
|
Ideally, a library is made such that with a little research and reading-over of the library, you can just use it; you don't need to "specialise" in a library or set of libraries, for example.
|
That's true, but certain libraries can require a fair amount of study to use and bend them specifically in the way you want them to work in your game. (That can be true with some of the older libraries, but those made by Forum Account can be used without much trouble)
|
Ideally the libraries will help you enough that you don't need a team of people. You don't need to have a programmer on your team focus on making the spaceship map system *because* you have libraries to take care of it for you.
|
No no no no no. You do not study libraries. You take the API provided by the library and only use the methods based upon what the API tells you. The reason for this is that the implementation can and will change while the API should remain somewhat constant (with the exception of additions). So if you base your code around something that a method does internally that is not specified in the API and the library then changes the implementation the code you wrote is now broken because you didn't follow the API.
|
In response to BrickSquadron
|
|
BrickSquadron wrote:
No no no no no. You do not study libraries. You take the API provided by the library and only use the methods based upon what the API tells you. The reason for this is that the implementation can and will change while the API should remain somewhat constant (with the exception of additions). So if you base your code around something that a method does internally that is not specified in the API and the library then changes the implementation the code you wrote is now broken because you didn't follow the API. While you're correct, nobody was talking about that. The OP was talking about learning to use libraries, not learning how their internals work. |
In response to Forum_account
|
|
I myself find libraries to be more useful learning tools rather than development tools as they were originally intended. That's just me however. I'm the type of person who can't stand blindly implementing functions into a project without understanding exactly how it works, and even then I'll just end up writing my own version. This helps me learn something new along with solving a problem I guess it's the fear of being dependent on something that could fail and leave me dead in the water. As unlikely as that is, I still prefer to be an independent programmer.
|
In response to Solomn Architect
|
|
Solomn Architect wrote:
I myself find libraries to be more useful learning tools rather than development tools as they were originally intended. That's just me however. I'm the type of person who can't stand blindly implementing functions into a project without understanding exactly how it works, and even then I'll just end up writing my own version. As BrickSquadron said, you only need to know the library's API. This isn't just true of libraries, this is true of your own code. You need to remember what your procs are and what they do (what their name is, what parameters they take, what they return), but you shouldn't need to be aware of how every proc works. If you do need to be aware of these details, eventually there will be too much to remember. It's good to be able to look at code and figure out how it works, but you should never have to be aware of how everything works (whether it's code you wrote or code in a library). This helps me learn something new along with solving a problem I guess it's the fear of being dependent on something that could fail and leave me dead in the water. As unlikely as that is, I still prefer to be an independent programmer. BYOND depends on Windows and DirectX, anything written in DM depends on BYOND. Not using a DM library doesn't mean you're free of dependencies. A DM library isn't a bad dependency to have since you can easily edit the library - it can't leave you dead in the water. If it's a matter of trust, then if you can't trust a library, you can't trust your own code. There are certainly some bad DM libraries and they should be avoided, but to categorically avoid all libraries is a mistake. Avoiding libraries is often a sign of lacking ability. If you can write something yourself then you can understand it in a library. If you can't make sense of a library (to use it) then you can't write it yourself. People often avoid using libraries so they don't have to admit that they can't understand it. If you try to write something yourself there's usually enough gray area that you can call anything a success - things can "kind of" work. Using a library is more black and white - it can't "kind of" work. If you try to use one and can't figure it out, you can't spin that as a success. |
In response to Forum_account
|
|
Forum_account wrote:
BYOND depends on Windows and DirectX, anything written in DM depends on BYOND. Not using a DM library doesn't mean you're free of dependencies. No, however it does free up the unnecessary dependencies. When DM runs on Windows and DirectX, that's unavoidable as it's part of the core itself. Libraries are indeed avoidable. A DM library isn't a bad dependency to have since you can easily edit the library - it can't leave you dead in the water. If it's a matter of trust, then if you can't trust a library, you can't trust your own code. Not true. I know my code and I know how it works. I DON'T know a library's code and I DON'T always know how it works. It's not so much a trust issue, I trust that a library that preforms X function will do it consistently, it's an independence issue. I feel as though I'm using a crutch when using a library (Whether you feel similarly is irrelevant) and it's just not in my personality to do so. There are certainly some bad DM libraries and they should be avoided, but to categorically avoid all libraries is a mistake. How so? What do I lose by not using your libraries? If I can do it myself, then there's no purpose in using a library. I would feel lazy and incompetent by using any library to do what I can myself. When you get into C++ and higher level languages, however, libraries become a must, becase C++ actually has "Standard" libraries, unlike DM. We have "Convenient" libraries. Avoiding libraries is often a sign of lacking ability. If you can write something yourself then you can understand it in a library. That's a bold statement with very little reinforcement. Rarely do programmers code in the same fashion, this becomes a game of learning someone else' coding style before you can fluently read their source. Just because I prefer not to crutch myself on something doesn't make me lack anything. In fact, the action of using a library without total knowledge of its process of function is, in itself, a sign of lacking ability. A sign of defeat that says, "I'm too lazy to figure this out on my own, therefore I'll get a library to do it for me, even though I have no idea what it's doing or how it works." If you can't make sense of a library then you can't write it yourself. If I don't know how to do something right off the bat, that's where Trial and Error come into play. The same method that the developer of the library used to program it. People often avoid using libraries so they don't have to admit that they can't understand it. I can understand any piece of code and what it does, however the matter at hand refers back to the difference in coding style. Although each individual line can be read to figure out its function, it still requires you to specifically read each and every line, function by function, word for word. Something that, if you had written yourself, you wouldn't have to do. You know your code and you should have a ping of memory about when you wrote it, therefore things are much clearer to you faster. If you try to write something yourself there's usually enough gray area that you can call anything a success - things can "kind of" work. Using a library is more black and white - it can't "kind of" work. If you try to use one and can't figure it out, you can't spin that as a success. A library can indeed "kind of" work. When it does part of a function you need, but not the whole of it, that's what I consider, "kind of" working. Judging someone's coding prowess based on whether of not they use libraries is a poor gauge of actual talent. The two subjects aren't remotely related to one another. I'm not saying that everyone who uses a library is lazy, that's certainly not the case. Reinventing the wheel, so to speak, can often be time consuming and wasteful, however that still does not excuse that fact than an individual person has every right to use or to not use a library at any given time, without risk of ridicule. I just feel like a lazy leech when I use someone else' library. As I said before, I use them as learning tools, which, if anything, is a much better use for them than the plug-and-play style you're requiring from everyone. |
In response to Solomn Architect
|
|
Solomn Architect wrote:
I DON'T know a library's code and I DON'T always know how it works You don't need to know how it works, you just need to know how to use it. It's like using DM's built-in procs. You don't need to know exactly how oview() is implemented to use it, you just need to know what parameters it takes and what it returns. In fact, the action of using a library without total knowledge of its process of function is, in itself, a sign of lacking ability. A sign of defeat that says, "I'm too lazy to figure this out on my own, therefore I'll get a library to do it for me, even though I have no idea what it's doing or how it works." That's not a sign of defeat, that's the sign of a good programmer. Being able to use something without being aware of how it works is what programming is all about. It means you understand abstraction*. You can write C code, compile it, and run a program without needing to know every detail of how your CPU executes each instruction. BYOND can use DirectX to create the graphical output without having to know and implement an interface to graphics hardware. * This is why we can judge someone's programming ability. Someone who needs to be aware of every detail probably doesn't understand abstraction. |
In response to Solomn Architect
|
|
Solomn Architect wrote:
How so? What do I lose by not using your libraries? If I can do it myself, then there's no purpose in using a library. I would feel lazy and incompetent by using any library to do what I can myself. When you get into C++ and heigher level languages, however, libraries become a must, becase C++ actually has "Standard" libraries, unlike DM. We have "Convenient" libraries. This whole entire post was filled with dumb, but I just wanna call out on this in-particular: All libraries are "convenient" libraries. That is what a library is. It is something that someone else wrote that you use because it's much, much, much quicker to use the pre-existing code. If you weren't aware, all of the C++ standard libraries are written in C++. It's entirely possible to re-implement them yourself, sometimes very easily (such as many of their data structure libraries). You obviously don't know the definition of "standard", or are at least construing it to be something completely different from what it is. [Edit] Also, lol @ calling C++ a "heigher" level programming language. |
In response to Popisfizzy
|
|
Excuse my spelling error. God forbid it to happen to anyone! Oh the inhumanity! What manner of ill contempt that is to come about through an extra "e"!... Anyways, I'm unsure how you decide to randomly jump into discussion and begin flaming off the bat. (However not out of character for you to be a belligerent ass without provocation, I digress.) I'm well aware what programming language C++ libraries are written in, however C++ utilizes libraries on a standard level. When anyone needs a quick time functions, they reference "#include <ctime>" without a second thought. These libraries are used by a vast majority of users, because people need these functions, however don't want to program them from scratch. The use of these C++ libraries is universally accepted, which is why they come packaged with most compilers.
There is no single library on BYOND that can be utilized by everyone, let alone any majority. No, DM Libraries are utilized by a handful of people at a time. Why? Because every game is different. Every game has different needs and requirements. DM syntax is simple and easy enough to make any number of additions without the use of an overweight library. No library is, nor do I ever think there will be one, so universally accepted by the community as to be dubbed "Standard." Now onto F_A's comment. You seem so hell bent on turning me to your way of thinking and doing that it has almost become offensive. I've told you plainly that I do not implement anything into my source that I do not understand its process and functionality fully. Abstraction is not a sign of a good programmer, it's the sign of a blissful one. One who doesn't care a thing in the world if his project is screwed up by incorrectly implementing a library. One who doesn't care that they aren't experienced enough to understand what's going on. You're way of thinking is atrocious, to say the least. You're telling me that "Plug and Play is okay!" while also saying, "Originality and effort are pointless!" I admit that you never expressed such words directly, however your counter-arguments and radical ideals can only lead one to assume that you do indeed hold both of those statements to be true. No, I do not need to understand how my CPU compiles C++ syntax into machine-readable code. But then we're back onto the "Standard" issue. C++ Compilers are standard. oview() usage is standard. Things that are universally accepted by people, do not need explanations to use. 100 Million Americans own cars and drive everyday. Cars being so standard, very few care how they engine block functions, they just care about depressing the accelerator pedal and moving forward. Why question something so standard and accepted? It works for a majority of others, so why should you care? DM libraries, being non-standard in every form, one can't help but question, "How exactly does this work?" Whether said person indulges that curiosity or not is irrelevant, the point is that questioning the process of non-standard items is much more frequent than that of the standard sort. Let's end this debate here without any more conflict. I'd rather not have Popisfizzy make a fool of himself here, and I'd certainly not want to be on the other end of that banter. I accept that you have your Opinions and that I have my own Opinions. Neither of which are right or wrong. This arguing is leading to zero progression of the topic at hand and is honestly becoming a hassle to keep up with. I shall continue to learn from libraries and grow as a programmer as I have always done. You may continue on your way with whatever it is that you do in your spare time. (Make more libraries? I'm not certain) |
In response to Solomn Architect
|
|
Solomn Architect wrote:
Excuse my spelling error. God forbid it to happen to anyone! Oh the inhumanity! What manner of ill contempt that is to come about through an extra "e"! You missed the point. The smallest mocking part of that statement was that you misspelled "higher". The bigger mocking point was that you don't understand what a high level language is versus a low level language. |
I'm proficient with all libraries that are designed well, as is Forum Account, Popisfizzy, and well ... you, I hope. =/
I'm ... I'm not entirely sure what's going on in this topic, really. Using libraries isn't a big deal, and doesn't take a lot of effort really. Certainly less time and effort than writing it yourself. I, like Forum Account, Popisfizzy, and many others, could implement all of the functionality, from scratch, seen in all of the DM libraries posted on BYOND's hub today, and probably way off into the future also. I can't speak for the others, but I probably won't implement something myself if a library is available, I know the author is generally good for it, and a quick 2 minute glance of the API makes me go "me gusta". I'm sure I could implement it myself if I need to, but if there's a library that does it *shrug* The motivation for this is pretty simple of course, I get home at 6:30 PM, I cook and eat dinner, and sit down at my PC, chatting to folks and vaguely working, from 8:00 PM, and go to bed at 11 PM (ho ho, not really). No sense particularly in me implementing perfectly good libraries again if I only spend a few hours a day on something. I'd like to release my junk sometime before I retire from my professional career and get put into a care-home. I'm afraid though, OP, I'm not sure what to say on your topic, aside from "I agree with Deathguard and Forum Account!". It's kind of open and shut. |
Libraries are beautiful exactly in that I can look at one, work out how to implement it and not have to worry about what magic it is performing; as long as I know what it is going to do to input and thus what output I will get, I can just feed it my own code and presume it will work.
I'm not sure where this distrust of other programmers come from; I mean, I'd understand if BYOND was full of libraries that just broke every couple of iterations and spammed you with errors ... but I don't think I've ever seen one break. [ Unlike my own code. ] oview() is only 'standard' because it was implemented by the same person who wrote the compiler you're using; it's still essentially a library, is it not? You understand what inputs and outputs it handles, and then you let someone else's code deal with the intricacies of the processing you want done. I don't think anyone was ever saying "Everyone should use every library," - obviously it depends on your project. No point including an irrelevant library - we were saying "Everyone who programs in DM can use DM libraries, and should." If a library fails you, it's because the person who's responsible for updating it made a mistake that he missed before uploading the new version; you're probably going to have problems with your own code far more often than the library. |
In response to Solomn Architect
|
|
Solomn Architect wrote:
Abstraction is not a sign of a good programmer, it's the sign of a blissful one. Not caring about every detail of how something works doesn't mean you're completely reckless about it. As I'm writing this post, I'm not thinking about how my keyboard works, how it sends signals to my computer, how my operating system traps these signals and sends input to the web browser's process, how the web browser handles the input and displays letters on the screen. I'm just thinking about the words I'm writing. I'm completely ignorant of the details of how the words get on my screen, but that doesn't mean my word choice and sentence structure are totally haphazard. Computers are complex, and if you try to be aware of all details you'll limit what you accomplish. If you need to understand how all procs work and keep these details memorized, there's only so much you can remember. As projects get larger it becomes more likely that you won't be able to remember every detail. This is why write good, clean code and comment it - you can easily look up how something works when you need to. If you do this, using a library isn't any different than using your own code. One who doesn't care a thing in the world if his project is screwed up by incorrectly implementing a library. I'm not sure what this means. If your project is screwed up because you used a library incorrectly, that's your fault. Don't do that. If your project is screwed up because you used a bad library, that's your fault. Don't do that. If we're talking about using libraries, we're obviously talking about using good libraries correctly. If you use a library and end up being unsatisfied with how it works, you're not stuck using the library. You're only stuck using its API*. Suppose you use a library that provides a path_find() proc, which takes two atoms and returns a list of turfs connecting the first atom to the second. After using it for a while, you find that there are many cases where it doesn't find a path when one clearly exists. You can: 1. Notify the person who created the library and get them to fix it. 2. Open the library and try to fix the problem yourself. 3. Remove the library and implement the path_find() proc yourself. The last reason is why you're not really stuck. As long as the path_find() proc takes the same parameters and returns the same value, it doesn't matter how it works. You can swap in your own implementation and you don't need to make any other changes to your code. Because you're keeping to the library's API, everything else will work. * You're not really stuck, you can always make any changes. Being "stuck" here means that making other changes would take too long. [Edit: Being stuck using the library's API isn't a bad thing. You should only use libraries that have good APIs.] |
In response to Forum_account
|
|
The thing is, I don't really condemn the use of libraries. The point of my original post was that I simply don't use them as intended. I use them as learning tools, and not actual tools. The saying, "Give a man a fish, feed him for a day. Teach a man to fish, feed him forever." certainly applies with me in this context. To each their own, and just because I don't use libraries, I find it unfair to be called a bad programmer.
|