How Do You Store Your Previously-Written Code?
Asmor asks: "I'm a novice programmer who is largely self-taught. It's never been too much trouble for me to reinvent the wheel constantly before, but now as my ambitions get loftier I'm finding that I could really benefit from maintaining some oft-used code that can easily be reused. The problem is, I really don't have any experience with this and I'm not really sure how I should organize things, how the code should be stored, how it should be implemented, etc. I think this is what people mean when they talk about libraries and/or APIs, but not really sure. I'm specifically curious about PHP and JavaScript, but advice for other programming languages is also helpful! How do you store and maintain your most frequently used code?"
Use CVS or some other revisioning system.
Usualy something like ":wq" "^s" "^x^s" "alt-F,a"
It's never been too much trouble for me to reinvent the wheel constantly before, but now as my ambitions get loftier I'm finding that I could really benefit from maintaining some oft-used code that can easily be reused.
Inventing something once is Genius. Inventing something twice is stupidity.
Using OOP, code should be reusable without having to have some external database. I find that the more external processes one has, the less likely one is to use it.
Code should be self-documenting. I'm not saying you don't have external documnenation... just that well written code has good comments. A good practice is to comment function and classes before coding.
Break things down into components. Refactor. Then your code will be very reusable.
See my journal for slashdot ID's by year. Mine created in 2005. http://slashdot.org/journal/289875/slashdot-ids-by-year
Store you code on a disk or a tape. If you store it on a printout, you'll just have to type it in again.
Fascism trolls keeping me up every night. When I starts a preachin', he HITS ME WITH HIS REICH!
Printed out, of course. File cabinets full. :-D
I do PHP and MySQL sites for a living. I have several includes that I basically copy and paste for each project. Stuff like simple DB scripts, user accounts, carts, etc. I just modify them each time for the specific project. It works pretty well for me.
I keep the code in files. Put the files in directories. The directories stay on disk drives, but sometimes I'll write them to tape or even CD-R.
Depends on what kind of mood I'm in I guess.
1) OOP: It will teach will how to abstract logic;
2) Refactoring: It will actually create the libraries.
I run a small web dev firm that does a lot in the way of PHP and JS, like yourself. What we have found works the best for our core library is a copy of Subversion running on our server. This way we all know exactly what the latest version is, and more importantly we can see how it became the latest version (i.e. what changes were made). A lot of tools run with SVN nicely. For instance, Trac talks to a backend copy of SVN and couples it loosely with a wiki and a couple of other things. A lot of hosting providers will also run a copy of SVN for you, like http://networkredux.com/ (We just switched over to them).
Of course, a root level folder on the ftp server can also work.
Whenever I change my main machine, that dir is of course copied to the new one, and included in the backups. Organiwing the libraries by functionality and language would be a nice thing, but I never seem to find the time.
Beware, though: Most employers specify that code written by employees belongs to the company. If you write code as a corporate employee and then leave your employer, you should really think twice before carrying that code with you. If your new boss thinks you are copying code written in a previous job, he would have to throw the book at you.
--
Mad science! Robots! Underwear! Cute girls! Full comic online! http://www.girlgeniusonline.com/
He's new and self-taught. Cut him some slack. I started becoming self-taught on a TRS-80 Model I. The code I wrote was a joke. I picked up lingo along the way. After getting away from computers, I re-entered the computer programming field, only to be faced with a new paradigm -- OOP, n-tier apps, etc. It took a lof of reading, wading through different opinions on design, idiots who have written a lot on the subject and don't know what they are talking about, etc. It was a lot to absorb, but after a few years of trial by fire, think I am on top of these things.
He is at the beginning of the curve. Laughing at him won't help.
See my journal for slashdot ID's by year. Mine created in 2005. http://slashdot.org/journal/289875/slashdot-ids-by-year
Like the label suggests, I store my code in a cool, dry place. Duh.
That's where I store mine: /home/user/code.
Just "gittin-r-done," day after day.
You may notice in the BEGINNING of the first sentence, the poster states that he is NOVICE programmer, largely SELF-TAUGHT.
Not everyone reading slashdot is a seasoned kernel hacker.
In the real world, though, I just copy code from previous projects into the new one as needed. I'm usually careful about keeping things modularized so this hasn't been a problem so far, but I tend to forget what I was doing on my old projects and have to spend time figuring that out.
I'm not sure if there's software for this or not. Did you try searching for 'code' on freshmeat? :)
I don't, it's pretty easy to reverse binaries to assembly code :-)
I have an external HDD for my laptop. It holds a nightly backup of my SVN repository. I also zip up my source trees every so often and upload them to my webserver. I've been burned too many times by losing old code -- so now I hold onto it obsessively.
I also press them to DVD along with other files whenever I am trying to make a "get more free space please" backup.
Is he self taught like Plato was self taught or is he like the rest of us, having a wealth of knowledge at his fingertips to draw upon. I think it's ok to be inexperienced but trying to learn. What I don't think is ok is being ignorant and asking others for advice without doing any basic research yourself. Sheesh.
How we know is more important than what we know.
store it on sf.net
heaps of jnr league programmers just like you have been doing this for years. Sometimes they accidently post something useful there too.
It also depends how much you're working in a field where optimization matters. If you need routines that run very fast you'll have to implement custom routines specific to each project. On the other hand, if you're putting up a bunch of web pages where you just want enough stuff on the pages to keep the pages from looking too plain then reusing code is a good idea.
If you have code you want to maintain, you want it in CVS or SVN (preferably SVN since CVS sucks ass).
With Apache2 or alone, it'll sit on a nice server you can regularly backup, keeping precious meta-data and history information about your code!
To do anything less is foolish.
--
Internet Explorer (n): Another bug -- that is, a feature that can't be turned off -- in Windows.
>What I don't think is ok is being ignorant and asking others for advice without doing any basic research yourself.
I'm all for bashing Ask Slashdot questions that should be Googled and "Do my homework plz" type questions but he really just a kid (look at his homepage).
Kids are suppose to be ignorant and ask advice about really basic stuff.
The surprise isn't how often we make bad choices; the surprise is how seldom they defeat us.
They in turn reside on filesystems.
As an additional bonus, there are FOLDERS available to sort out your historic work.
"Give orange me give eat orange me eat orange give me eat orange give me you." -Nim Chimpsky
In Baudot on punched paper tape. Can't get demagnetized. Besides, I got tired of penciling in all those boxes on the paper cards.
Hey: no smoking. I'm not kidding...
Hey, that was my thought too. Seeing as how you can't actually do much of anything on a modern operating system without running up against these things I'm a little surprised that he's at a point where he's got code to reuse.
Why not?
Paul Grosfield - the quicker picker upper.
Now, now, boys. Be nice to the noob.
Normally, I'd agree with this. I've even been known to flame people for being too harsh in their responses. I think the GP has a point though. I think that Ask Slashdot works best when the topics are of broad interest, have some technical merit, and the poster can evaluate the responses in some context. When I read this question, my first thought was to RTFM. After all, he states that "I think this is what people mean when they talk about libraries and/or APIs, but not really sure", so it's pretty clear that he hasn't done any real research on the topic. If the question was to compare the merits of CVS against Subversion, or some other specific question about how to structure a library, then I think the question would have merit. But this just seems like a grand waste of time since there are numerous references for this kind of information (books, web sites, etc.) I see a huge difference between "what's your experience in this area" and "I'm too lazy to look for readily available information". I don't want to judge this guy too quickly, but virtually the entire question reads as though he's lazy.
For what it's worth, I think this guy should go to college. Seriously. It may be a lot of money, but most quality schools will cover topics like this in CS101. Even lots of community colleges will cover basics like this.
If you don't want crime to pay, let the government run it.
I just use 7zip to archive my nighly builds, and email them to myself on my gmail account. I put the comments on the code in the message body. Gmail gives you over 2.5 gigs of storage space, and you can search you message bodies and headers. I can also retrieve my code and projects from anywhere in the world, and don't have to worry about hard drive crashes.
Havoc Video
"Backups are for wimps.
Real men upload their data to an FTP site and have everyone else mirror it."
Hope that works out for y'alls!
"Speaking the Truth in times of universal deceit is a revolutionary act." -- George Orwell
I think if it would help if he read some background on these types of tools;
http://www.mactech.com/articles/mactech/Vol.14/14
The surprise isn't how often we make bad choices; the surprise is how seldom they defeat us.
If it isn't likely to turn around and be immediately salable, turn around and put it on the web. I've found that doing the extra (minimal) effort of bundling up and organizing the pieces that is necessary for web presentation really does wonders over my previous storage scheme (put it on a cd, then lose the cd).
I've got about a year's worth of random stuff thus rescued now, even as I kick myself over the things I know I wrote but can't find anymore. For what its worth: Here it is
I did, and it wasn't obvious to me that he was young. So I did some digging on his site, and found this picture. I'd agree that he's young, but I think that if you're old enough to have facial hair, you're old enough to use Google. :-)
If you don't want crime to pay, let the government run it.
With the sales tax receipts.
Get a subversion over http (apache) server going and turn on web-dav auto-commit.
)
This way you can have full version control with a client like Tortoise SVN and read access to any file with any web browser.
The web-Dav auto versioning will allow you to write to any of your files with any web-dav client including windows explorer, internet explorer, ms visual studio, macromedia home site, cold fusion studio, many other development environments, microsoft office and lots more.
Subversion info: http://en.wikipedia.org/wiki/Subversion_(software
WebDAV info: http://en.wikipedia.org/wiki/WebDAV
Subversion: http://subversion.tigris.org/
Tortoise SVN: http://tortoisesvn.tigris.org/
I usually print it out and staple it to a squirrel. Then I set the squirrel free, because information wants to be free, and so do squirrels with paper stapled to them.
I often find that adding comments in the PHP/MySQL/Whatever manual under the function you are using is helpful. That way next time you are looking up how to do something (maybe a year later) your snippet is waiting for you. Also writing articles about how to do something and getting it posted on community code sites is good. Otherwise I'm a fan of plain text files or just keeping copies of the projects you work on and poking through them later. I find that I incrementally improve on my foundation code over time. I don't believe that re-writing code is a bad thing.
Me lost me cookie at the disco.
http://www.asmor.com/coppermine/displayimage.php?a lbum=3&pos=32
He turned 7 in 91. He's 22.
Modularization and reuse are sort of like, fundamental concepts to good programming. First you need to at LEAST be familiar with the constructs provided by the languages you are using. That will probably lead directly to your strategy. As far as "storing" the libraries that should be no different than storing any of your other code, reused or not. Subversion is a good choice. Although to be technically correct, one must make a distinction between version control and storage/backup. Don't use one for the other.
It's 10 PM. Do you know if you're un-American?
On stone tablets. And then I give them to bearded men on top of mountains so they can show the world my coding wisdom.
Fighting over religion is like seeing whose imaginary friend is best.
I think what you want to do here is learn how to use the "include" statement in PHP, and keep your commonly used code in a few different files. For example, all your commonly-used sorting-related stuff could be in "sorting.php" and all your commonly-used database-related stuff could be in "databases.php". Then you can just "include sorting.php" to reuse those. Other people in this thread have pointed out things like libraries, classes and object-oriented programming which are more formal ways of doing the same kind of thing in C, C++ and Java. For JavaScript and PHP, though, the "include" statement should be all you really need to get started.
-D
I think this is what people mean when they talk about libraries and/or APIs, but not really sure.
Not quite. What you are talking about sounds like just a repository of random code. A library is a specifically designed set of code to perform a given task or set of tasks. There's a certain amount of order implied in the term just as is implied by that big building where they put books.
API's are designed interfaces to a system to make coding easier to do. You don't have to understand how the underlying guts of the code works, you just program to work with interfaces. So you call the draw() method and a line appears on the screen but you don't need to know how to speak directly to the video card, etc.
AS for the original question, I have two suggestions. The first is to use CVS as a way to version your code. It's like have CTRL+Z for your entire project. It makes it much easier when you are adding new code because you can feel comfortable breaking it completely because you know you can revert it easily.
The second is to use a simple search engine to catalog your code. Google desktop would be up to the task. Just check out your code from CVS and put it in a directory somewhere. Then when you need code for some task you can search for it. If you're good about commenting your code, that should work like a charm.
This sig has been temporarily disconnected or is no longer in service
to retrieve that information
intellectual property law is philosophically incoherent. it is your moral duty to ignore it or sabotage it
Comment removed based on user account deletion
You're supposed to write new code from scratch for every PHP project you do. You obviously must not have browsed freshmeat lately.
I'd say asking the slashdot readership IS doing research. If you've got time to flame him for asking a question clearly you weren't too busy to respond to his question.
The smartest way to get knowledge is to ask the people that know. And by posting on Slashdot it's not like he's barging down your door or sauntering into your cubicle and demanding your attention. It's a very passive non-intrusive inquiry. You read the post, you responded, you have no reason left to complain about this.
Plus, as a largely self-taught programmer myself I know that asking a question from someone who knows can sometimes get an answer 10 times faster (and 10 times more clearly) than reading a bunch of manuals frequently written either for dummies or for experts. That in-between period when you don't need someone explaining how an if-statement works but you don't really quite know the next step is a difficult phase. In my opinion this isn't a question of laziness - it's a question of efficiency. There seem to be plenty of people here who want to help him. Why don't you kindly get out of their way?
-stormin
The Southern Baptist Convention has creationism. On Slashdot, we have porn.
Well, that's easy. I have two folders: "Projects" and "Archive". "Projects" is divided in folders, my current projects. "Archive" is previously written Projects. Archive has folders for language etc. All in all my programming folder is 2 GB. Code others have written I save in a completely different place.
Ok, I really don't code.
I can't believe his age is even being discussed. He could be 33 for all I care. since when is it a crime to ask a question? Again - he's not wasting anybody's time. Anyone who resonds to this thread to complain about him proves they have the time to deal with the issue at least a little bit.
I think it's crazy that some poor guy manages to get his question posted on slashdot - which means he's probably going to get a wealth of information - and he ends up having the legitimacy of his question debated in terms of his age!
It's people like this that give techies such a bad reputation. It's one thing to laugh in fun at the dumb users who try to use the CD-drives as cup holders. It's another thing to get irritated with users who expect us to fix their messes after the screw stuff up. But to smack down someone who's actually trying to learn to do it on their own because you don't like their question? That's just elitist and anti-social.
-stormin
The Southern Baptist Convention has creationism. On Slashdot, we have porn.
One issue is code re-use.
Code re-use is why you write API's and create your own libraries, so that you don't have to keep re-inventing the wheel.
The other issues are version control, code management, etc. Some ppl here are recommending cvs and other such overkill. If your a novice PHP coder, none of that matters; you probably have a handfull of scripts that weren't written with re-usability in mind, and therefore are minimally reusable (written in a language that doesn't encourage re-usability to boot) so theres no "tool" that will magically let you squeeze the juice of re-usability from stone.
At this point, you biggest concern should be storage for sake of making frequent backups. Personally, I encrypt whatever folder I'm working in (using PGP) and email it to my gmail account every day. That way it's accessible no matter where I am, and pretty secure too.
"Is this just useless, or is it expensive as well?"
OK, before the flames, obviously I didn't mean the next step immediately after you figure out what an if-statement is. I meant after you've written several programs and are getting ready for more ambitious projects. Like this guy is.
-stormin
The Southern Baptist Convention has creationism. On Slashdot, we have porn.
Given the background of the poster and the general nature of the query, it would be prudent to ask: "is a basic background in data structures and alorithms is missing?" If not, that would be the first skill to master. Once you know what abstract types are and what problems modularization is supposed to solve, you can move to the next steps:
1. Think through a rational scheme of organizing principles.
2. Then you design.
3. Then you code/test/etc.
4. Repeat from 1.
Admittedly, the poster is asking how #1 is performed. The answer is the it takes many iterations of 1-4, after which #1 becomes honed perfect to your particular situation.
why punch cards of course, what else would you use to store your code?
Snowden and Manning are heroes.
You do what i do, you put everything in one file and call it "misc" and then link it to every program you make. problem solved.
Once in Sourceforge, you get CVS and all the goodies. Better than using GMail for it.
What I have done in the past is if I am developing an application and have a function file that performs a specific task, I save the classes as say, Upload.php and then later in programming if I need to have an upload function, just copy the php file to the core folder and import the function.
Keeps track of some common functions and helps you in the long run esp. if you are doing lots of programming that deals with the same type of functions.
Bryan
If it's not sensitive, and I wouldn't mind people using it, I like to store it on my tagged code snippets site. It helps me find useful bits and pieces again at a later date as I can always remember a word or two which I tagged it with. 1000 other users seem to enjoy it too :) and if you're looking for inspiration you can subscribe via RSS.
[my laptop's touchpad decided that I was clicking "submit" halfway through a sentence.] ... squirrel (something about staples puncturing vital organs), and the dead squirrels didn't do much to help my code be free.
Have you experimented with other animals? Elephants might work well -- they have lots of surface area for attaching code, and staples probably wouldn't hurt them much either.
Tarsnap: Online backups for the truly paranoid
STFU. If you don't have anything worth posting, don't.
Patent Pending
So reading thru the comments, I see my personal favorite of using yellow sticky notes is not a good idea?
I doubt they teach this in skool.
Steve's Computer Service, Hobbs, NM
Want to edit some code? Pull out the old cards and store them in the back of the box with a rubber-band around them, then punch in the new code (using a keypunch, of course) and insert the new cards into your card deck. Voila - code repository! CVS! Subversion!
Need to use the code in multiple places? Run the cards through a card duplicator. Voila - code reuse!
Need to save some space but don't want to lose the old code? Run the cards through a card lister that prints them out on a line printer. Voila - archive!
The most difficult problem with storing code, whether in punched cards or another, more modern format, is this: REMEMBERING WHERE YOU PUT IT!
Im a C, C++, Java, and ASM programming and I do the same thing. Each language has its own directory in my home directory in there I have many different programs ranging from a Java class that has functions doing every in/out you could ever need(for console) to a graphics engine I work on and off. Each sub directory has a name that you know what the code does just by looking at the directory. Keep a backup of all that code on another computer CD or something like that and remember to keep all that code well comented ;)
Use Ultraedit's Find in Files. It will search for a string in all file types specified within a directory and all subdirectories within it.
Your one of those people that when someone asks how to do 'x' thing, you go "Damn! Are you stupid or what?" Then you pound out something on the keyboard and say "There! That wasn't so freakin hard was it?"
When you get out of school, enter the real world, and have to work with customers and coworkers, your attitude will change or you'll have to learn the skill of saying "Do you want fries with that?"
I suggest you practice.
Steve's Computer Service, Hobbs, NM
If you keep reusing the same code it will never get any better, nor will you.
http://www.berlios.de/ - free for open source projects
http://wush.net/ - for commercial projects
Is learning how to break up your programs into multiple files. In C, learning to do this is tricky... from there it's not far from calling an external function from some library you've linked in.
In javascript or PHP, there is syntax for loading external files. Play with it, do dumb little experiments. Make up a file.js that just runs and alert(), and then call it from another, and see how it pops up a message box just as if you had called alert() directly.
From there, it's only a matter of thinking up functions that (with a little tweaking) could be used over and over, by different programs. You'll start to discover that naming things properly is important, that you can't name something so that it only makes sense in the context of where it is now, that cantThinkOfAGoodNameForThis() might work well when you're hacking out little one-off scripts, but that when you want to reuse it, it really confuses things. You'll discover that "blah" is not a good variable name.
Naming conventions is a science unto itself, so don't feel intimidated if it's not obvious right away. Apparently those who've written the compsci textbooks for 40 years still argue over all of it, so it's nothing you or I will ever "master".
The best way to save it is "rm -rf". Honestly, if you are happy with a piece of code today, two or three years from now you'll put a brown paper bag over your head if you look at it again.
This is something called "learning".
That's "Mr. Soulless Automaton" to you, Bub.
I've been in your shoes for fifteen years now. I originally learned programming to play on the Commodore 64, but really took it up when I was a SysOp of a BBS (WWIV 4.2 at the time, tons of mods out there, some of them quite good). I started writing my own utilities and tweaking mods to suit my own liking. Believe it or not, but I still have most of the code from back then. It has shuffled through a dozen various machines and hard drive upgrades. I've learned a few semi-obvious things about keeping track of things over that time. Some code/projects will be lost. This is just the way things go. If you don't take really good care of your data, it will disappear into the ether. But honestly, that's the way it should be. My first program used printf() and hard-coded ANSI sequences. It is completely useless anymore and deserves to be lost in time. However, to keep track of the stuff you do think may be useful as more than a learning experience, I would recommend a few things. Keep Backups. This isn't just like using a Version Control System (VCS), this is more basic. You will become bored with projects and many of them will end up shelved somewhere on your hard drive. If you do want to keep them, make at least two backups. Your projects won't be very big, so you can probably fit several hundred on a single CD. Make two, in case one flakes on you. I also keep my projects on a couple of machines (Again, they're usually tiny, so there isn't a hard drive space hit). Also, having your original source code rather than an odd archive makes importing into a new VCS really easy. Remember that it takes work to replace code that's lost. You can't just re-download it from somewhere. Learn good coding practices. Believe me, they are worth your weight in gold. There is nothing worse than getting lost in your own code weeks/months/years after the fact because you couldn't indent properly, or wrote overly complex run-on functions. Also, good coding practices will really help if you want to adapt some piece of code into a new project. Keep your interfaces clean and document them. Clean, documented interfaces make for better code re-use and unless you go nuts with the documentation, it won't add more than 5% to your coding time. Your coding methodologies will change as your skills improve, but learning to write decent code early will usually mean more of your code will work in the future. Use a VCS. People have recommended CVS and SVN, but I would actually recommend Monotone. I discovered it when Linus was kicked off BitKeaper, and for small projects I really think it's ideal (It may even work well for large projects, but I haven't asked the OpenEmbedded guys how it's working out for them). It doesn't have the same problems I've seen with CVS and SVN (Namely files being locked and different concurrent versions of files breaking the code check-in). It doesn't require a server to be setup (Though it has a server function if you feel so inclined); it keeps everything in a single-file-database where ever you decide to put the file (You may want to keep all your databases in one location for easy backup, or have each database be in the directory tree of the project; whatever you want). It runs on Windows, Mac, and Linux, and they can all talk together if you do decide to setup a central server. One down side is that it's still relatively fluid, meaning that they change things that aren't backward-compatible. That being said, I've had some databases from Monotone 0.18 and now that I'm using 0.25 (Three non-compatible changes later), they still work. Regardless of which one you choose, learn to use it. And for the love of all that's holy add comments when you check-in code! Even short notes about what you were working on can spark your memory if/when you revisit a project, especially if you're in deep geek mode and your brain is moving at escape velocity.
... And so it comes to this.
There's surely no shortage of elitism and anti-social behavior in the Slashdot crowd. But, most of them are kids themselves, most likely in college, or working a job where their co-workers can take up their slack.
Steve's Computer Service, Hobbs, NM
That's just elitist and anti-social.
What? Is this a BSD thread?
My problem? I was perfectly gruntled, until some numbnuts came by and dissed me.
I have a "Projects" directory, inside which are directories for all the other things I'm working on, and usually a directory called "OLD" or "OLD PROJECTS" or somesuch. Many of the project directories are actually Eclipse workspaces, and I habitually name those with a "_ws" suffix.
..or..or.
From time to time I move all the abandoned ones into the "OLD" directory. When I upgrade computers or something, I copy all this stuff into a "From Foo" directory where 'Foo' was the old computer's name. I sometimes use a local CVS repo for projects I'm working on (especially if they are Eclipse-based since it has good CVS support). I tried Subversion but I thought it was too slow and I couldn't interface it to Eclipse, so I stuck with CVS. About once a year I burn everything onto a CD (most of my projects are small, or at least small after some compression). For occasional large projects that would take too much of the CD, I back them up elsewhere (onto my laptop and onto my iPod).
It sounds chaotic but I can usually find anything I've worked on in the last few years within a few seconds.
Now the part of my system that doesn't work so well:
Unfortunately, I don't have a good convention for naming and locating the text files in which I jot down design notes, ideas, etc. for each project.
Many of my projects get abandoned in an incomplete state, only to come back to them 6 months or a year later with renewed interest. So I try and document my ideas, design decisions, etc. in text files in each project. Even if I never got around to implementing the decisions, I might want to re-read them next year to get back on track. But my textfiles are scattered all over the place. Some end up on my desktop, some end up in C:\. I try and keep them in the Project tree but if I'm brainstorming with my laptop and the project is only on my desktop and I don't have access, well, its going on the desktop so that I will notice it and move it later. (Except that I rarely remember to do so). Usually, but not always, I have a file called "ideas.txt" in the main project directory (or in the top level of the main Project if its an Eclipse workspace). Sometimes I name them "optimization_ideas.txt" if the ideas are mostly about optimization, and so on. Sometimes I put them in a doc directory. Or an ideas directory, or a Planning subproject, or
I guess that part is not worth standardizing on--too much process is as harmful as too little. Just find something that works for you, and stick with it.
/bin/rm -f -r $HOME/code
Real men don't make backups... the put their code on a public FTP site and let the world make copies - linus
-- Given enough time and money, Microsoft will eventualy invent UNIX.
a simple way would be to store resuable functions in files under one (library) directory.
For example, store I/O (input/output) operations in a file called library/io.php, math operations in library/math.php then require('library/io.php'); to reuse the functions.
Since this is 2006, there is no point in starting with CVS.
Use SVN if you will be the only person committing stuff in to the repository. If you plan to share the code in an Open Source project with many people, and each will have their own distributed repository, then look into something like bzr from Canonical.
2bits.com, Inc: Drupal, WordPress, and LAMP performance tuning.
Well said.
It is better to aska question and be thought ignorant than to not ask and remain ignorant
(sorry can't attribute it)
1) Use comments -- good ones! -- liberally. Check out a programming style guide. There's nothing worse than coming back to your code a year later and asking, "What the *&$#^& was I thinking here?"
2) Learn how to make your code general enough to be reusable. Limit your imbedded constants to a minimum. Write functions to solve the general case. Your code might run slower, but unless you are doing serious number-crunching or searching, it won't matter.
Human being (n.): A genetically human, genetically distinct, functioning organism.
I too am a self-taught coder. When you are constantly studying and learning as you go along, it's important to keep code and notes. I have a direcory called /home/myuser/notes, and I wrote a bash script that creates a file with a datestamp and opens it in vim when I type ./notes (or it opens an existing one if the file for the current day's date exists). I now have > 2 years of notes saved on all kinds of stuff: my common mysqldump syntax usage, cpio usage, saslpasswd2 usage, notes on pam configuration...
/ruby, /perl, /c, /java, /python, /cs, ... and in these I wrote a bunch of hello-world type programs that have regex usage, object creation, interface syntax, various iteration constructs... in all these languages.
/notes directory on my main home webserver in a SVN repository, and I can easily and quickly check it out from my laptop or from anywhere else. Other version control systems (monotone, darcs, cvs) are also good but svn has lots of support these days.
In ~/notes I keep subdirs:
I keep my
Then I keep larger programs in ~/code/ruby, ~/code/perl... That's where my classes and "real" code live. When I write some useful utility program that I use from the command line (lots of random scripts mostly), I keep them in ~/bin
So I keep ~/bin, ~/code, and ~/notes in svn. Occasionally I'll svn export them to a clean directory and make a tar.bz2 archive to burn to cd for backup (if I have important project code I'll back up the svn archive to get version history).
Having stuff like this will help you out a LOT! If you have to reinvent a wheel that someone else already invented because you don't know about it, that's bad in a way but at least you learn. If you never take notes or keep code, you'll find that you'll constantly be reinventing a wheel that YOU already invented -- whereas a vague recollection and some quick grepping will often result in little gems of code that you wrote a while back and would like to see for reference.
... to erase it.
I just let it propagate via Microsoft Outlook.
Only wimps use tape backup: real men just upload their important stuff on ftp, and let the rest of the world mirror it." [Linus B. Torvalds]
As for myself, I upload my important stuff on FTP too. I have a local SVN on my laptop that is synchronized as soon as it is connected to the internal network on a SVN server on a RAID5 array (Linux server with 4x80G). Later it tar.gz's the SVN-tree with a timestamp, and sends it over FTP to my website.
Soon I will have an external 250G SATA HD in an enclosure that will mirror my RAID5 array (on a compressed filesystem) and saveguard "backups" of my ogg-files.
Custom electronics and digital signage for your business: www.evcircuits.com
To Chuck Norris. He's got infinite storage space, but recovering the files will almost certainly involve a roundhouse kick.
I suggest you shut your hole.
How we know is more important than what we know.
I put it in a text file and send it to my gmail account. Label it as programming and archive.
I have a recipe which has served me well for years. If you want to know more, read:
o re-my-previously-written-code/
http://rudd-o.com/archives/2006/02/16/how-do-i-st
Rudd-O - http://rudd-o.com/
I do a lot of small scripts (Perl, PHP, etc) and reuse a lot of code. What works for me is to have put each little project in its own directory and make a README file describing each script and whatever else. That helps at least digging around for a chunk of code rather than going through 100 scripts I can go through 20 READMEs.
toddbu:
/.ers would consider appropriate. If they are willing and brave enough to ask, they deserve any help they can get.
Please understand I'm not trying to flame you in particular. This is a general reply to all those who feel the question posed by the original submitter was ill-concieved. I think it *is* obvious that by the way the question was framed, this guy doesn't know much about what he is asking. But most people don't seem to realize how amazingly hard it is to get to the point where that isn't true anymore. I first started writing BASIC routines for APPLE ][e in the mid 80's as an 8 year old. A few years ago, I begin doing embedded programming for the AVR microcontroller. Regardless, I *still* get intimidated walking around the computer/technology isles at Border's bookstore.
Put yourself in this guy's shoes for a minute. So you have questions and you gonna do research: Where the friggin hell do you actually begin? Considering the way the question is stated, I'd be suprised if the guy's written anything with more than a few hundred lines of code. With that kind of background, how do you evaluate rows and rows of shelves with titles such as "The PERL COOKBOOK", "LEARN PHP IN 24 HOURS", "EXTREME PROGRAMMING EXPLAINED"? What the hell do these names mean to someone who has barely any concept of a library? Most of covers are just pretty words with useless information intended to get you to buy the book. It doesn't get any simpler on the web. Sure you have massive amounts of information you can google, but how does any one individual digest all that information when one doesn't know enough to sort out the relevent websites from those that are way over one's head?
When I first started out years ago, it was really bewildering making sense out of the sea of resources. It was only through years of interaction with others of greater experience that I learned about good books and good websites by reputation. This guy asmor is doing the same - simply asking the folks here what's out there, not imploring any of us to write his programs for him.
You suggest he go to college to seriously study up on this. Certainly that would be an ideal way to learn computer programming in a structured fashion. But that is easier said then done for someone who may be just a casual programmer coding for fun in his spare time. It all boils down to the notion that some folks who are very capable may not be able to devote the amount of time and resouces many
Stay sentient. Don't drink bad milk.
Thank you so much. This guy sounds like he is looking for CVS but doesn't know what it is called. When people say "just google it" that only works if you know a concise way to describe what you're looking for. He doesn't.
Good for him for trying to better himself. Its hard enough without having people jump on him. It is very easy to call someone stupid because they don't know the correct terminology, it is much harder to find a diamond in the rough who is bright but just hasn't been exposed to the right influences.
"brxref
I have a recipe which has served me well for years. If you want to know more, read:
o re-my-previously-written-code/
http://rudd-o.com/archives/2006/02/16/how-do-i-st
Rudd-O - http://rudd-o.com/
I have a recipe which has served me well for years. If you want to know more, read:
o re-my-previously-written-code/
http://rudd-o.com/archives/2006/02/16/how-do-i-st
(this post contains the valid link, the others I couldn't edit and I don't know why)
Rudd-O - http://rudd-o.com/
I'm a little surprised how quickly people forget what it was like to be in this kid's shoes. To this day, I still find myself lost in a sea of information. I have no understanding of Java as a platform, but people In The Know would probably flame me for asking. This is one of the best Ask Slashdots I've ever seen. Every single person reading has been there at some point. I give the asker a little extra credit; he isn't completely confused and seems to know what questions to ask, or at least moreso than I ever did at that stage.
"look at his homepage"
Which is surviving a slashdotting.
I just email stuff to myself. Now someone else backs up and makes my code available and searchable anywhere in the world. 2+gigs lasts a while.
You write your code snippets on post it notes and stick them all around. When you need to refer some code you will have to go through all the post it's. The pain of doing this will help you memorize the code snippets that you are searching for as well as code snippets that you browse through during the search. Once a code snippet is fully memorized tear off that post it note and proceed till nothing is left. Soon you will have all the code right inside your brain.
this sig violates slashdot rules
Would have loved to read this, but your page breaks bigtime in Safari.
Nothing is inexplicable; only unexplained -Tom Baker, Doctor Who
Looks like you need more practice.
irb(main):001:0>
I know you are but what am I?
How we know is more important than what we know.
May I suggest interns?
Easier to transport than an elephant, so you can have more on hand at any given time.
They're almost as smart as elephants, too; but I hear they don't last as long. It's a tradeoff, I guess.
WhiteWolf666 an exBush supporter. All you new-school,compassionate,save the children Republicans can rot in hell
If you're talking code snippets, use a well organised directory (one directory per set of related code/project, multiple versions under subdirectories). Biggest advantages: Highly portable and very simple. No reliance on other software Biggest disadvantages: Multiple versions are hard to manage.
I have to confess that since I'm not heavily involved in much hobby and open source work I still use a simple directory most of the time at home (and on my personal laptop). I'm sure some will laugh/scoff.
As you progress move to something like CVS. Biggest issue I have with this is portability. CVSNT (CVS on windows) is not the same as CVS. Cygwin's awkward to run. Access to the repository therefore relies on access to the server software (and a server attached to the current repository). You trade all of that hassle for access to multiple revisions and the ability to compare them easily (at least for ascii - CVS isn't great for binary).
At work our team uses CVS day to day.
Ideally the OS should come with a revisioning system of some description. (Hell VMS had a crude revisioning system built into the file system!). Linux kind of has it by default in the guise of CVS, but its not built into the file system (which I believe is a better way of doing things). Windows unfortunately has a poor cousin, and proprietary solutions. C'est la vie.
These posts express my own personal views, not those of my employer
CVS is overkill if it's just your files. Stick them in a directory and make them read-only. I've kept my read-an-arbitrary-number-of-bytes-from-a-socket code for years that way. No fuss. No muss.
We definitely have all been where this guy is. And we've all needed help along the way. My concern isn't that he needs help, but how he's going about asking for it. In some ways, submitting a question like this would be like going to a convention of heart surgeons, standing in front of the group, and saying, "hey, some day I think I might have some heart problems, and rather than going to med school or even buying a couple of books on heart surgery, I'd like you to dedicate your conference to teaching me all about the heart."
My pushback on this particular submission is that Ask Slashdot has seen its fair share of complaints about the questions submitted. I've been close a couple of times to pulling it out of my list, but I always think that there may be an opportunity to both learn and teach. If the submissions are all like this, I don't think that there's much value for either me or the person submitting the question. I think that you'd have to agree that the OP really didn't seem to have any real focus, so any comments submitted are going to be in the context of the person posting the comment rather than in the context of the person seeking the information.
I had to smile when I saw your comment about an Apple ][e. I had a ][c for a while in my youth. (I was 14 at the time). It's surprising that given your history that you'd defend laziness. You remember just how hard it was to get information on anything back in those days, so I don't think asking someone to spend a little time on Google before seeking advice is asking all that much.
Let me give you one more thing to ponder. Even though I've done very little telephony, I'm now working on building out a fairly sophisicated Asterisk server. If you've ever worked with this technology then you'll know that it's less than well documented, but that doesn't mean that I'm not responsible for doing research before asking questions. If I were to put a post on Ask Slashdot saying "I want to build an Asterisk server that connects to a database - tell me how" then the community would be right in flaming me. If I was to submit a question like "is there a better way to interact with a database than the system command?" then I would expect to get some really good answers. (For anyone that's interested, AGI is pretty cool and works well for our application.)
If you don't want crime to pay, let the government run it.
Printed out, of course. File cabinets full.
Don't laugh!
I got my first computer (Texas Instruments TI-99/4A) in the early 1980s, back in the days when Compute! and other similar magazines were *full* of games and other programs which you'd have to type into your computer.
I credit them with my blazing fast typing speed, my good accuracy typing code (which is a lot different from typing text, of course!) and my ability to troubleshoot.
I'd type run, and I'd get
* INCORRECT STATEMENT 440
Then fix that line, and the program would run... but some text would be wrong somewhere.
890 CALL SAY(SEG$(1,B,$OUTWORD)) :: CALL SOUND(10,2500,0)
(Oops, the text segment was supposed to be from 1 to A, not 1 to B.)
Now, it's honestly been 15 years since I last did *any* programming in TI Extended BASIC, but I still remember most of the syntax, including CALL SOUND being (duration, frequency, volume {,frequency2,volume2,frequency3,volume3,noise}).
The repetition from retyping is valuable rote.
The other thing is how well can we trust media? Tape has finite lifespan, disks have finite lifespans, and how do we know the security of data trusted to CD and DVD dyes? They haven't been around long enough to say for sure. So you're gonna have to make a point of recopying your media every year or so in order to ensure any deterioration doesn't cause loss of data. Fine, now you'll have multiple backups, in a few years at least one of those DVDs should be legible.
On the other hand, print the code to the laser printer (or even the old Okidata dot matrix every true computer geek still has kicking around - hell, I still have my trusty first printer, the Xerox Diablo D25 daisywheel; I still sometimes use it to print letters and stuff just for the fun of it).
Once it's on good quality paper, you know you'll be able to OCR it someday. Whether it's tomorrow or 50 years from now, I think we can rest assured there'll still be paper - and therefore scanners.
Oh, and by the way, importing my old TI and Amiga software into my current machine was no fun. I had cassette tapes, 5.25" diskettes in TI format, 3.5" diskettes in Amiga format, and that whole Amiga hard drive image. Transferred to my PC by XMODEM and a Laplink cable. All these tasks were possible only because I still have my old hardware, and it still works - and PCs still, for the most part, have RS-232 ports.
Fire and Meat. Yummy.
In a compiled language, you write a set of source files that import and export various symbols. You then create a set of header files to define the interface for your library. Optionally, you then use the link editor to remove shared "library private" global variables that you do not wish to export. Later, you write a program that includes the header(s) for your library, and you compile the program to a binary object. Next, you run the link editor to grab the necessary components from your library and insert them into your statically linked binary. Finally, you ship the binary to your clients. Technically you have the choice of doing static or dynamic linking. In the dynamic linking option, you just ship the entire binary of each library, and you let the program use only the symbols it needs. This allows you to ship smaller binaries for each of your programs that depend on the dynamic libraries.
Now let's consider a language like JavaScript: There are no standard tools to package libraries and extract a minimal set of dependent code fragments, so the typical response is for the developer to either (1) include the entire library; or (2) practice the evil art of code duplication. Since both of these options have their advantages and drawbacks, I'll discuss them separately.
The first option is "similar" to the dynamic linking option of compiled languages. However, in the interpreted language the user has to "pay for" the entire library on every inclusion (** in PHP, your server is the one that pays this price). This can be a rather large drawback if you include too much code, or if you include "unused code" that has significant initialization. However, the advantages of this method include: (a) It is possible for users to cache copies of these included libraries, so they will not have to download the same code more than once within a session; and (b) If you fix a bug in the included library, every instance that depends on the library will immediately become up to date (*except for users with cached copies that have not expired).
In the second option, end users will get a more streamlined program, but any bug that appears in the 'duplicated' code will probably never get fixed in all of its incarnations. This is such a BAD THING (TM) that it should be considered a showstopper. In other words, do not even consider doing this if you maintain more than one program that uses the same chunks of code.
Based on the above discussions, I recommend using the "include" method to inline your libraries. Where possible, make judicious use of namespaces (or equivalently: standardized prefixes) to reduce the chance of variable re-declarations and/or data stomping. Also, as I hinted at before, try to avoid putting any code that automatically initializes itself into an included library.
In JavaScript, you'll basically write:
In PHP, you'll just put
Perhaps in the future someone will come up with a spiffy dependency tracing tool that will automagically generate new only the required subsets of your libraries (either for inlining or inclusion). Until then, just try to keep your libraries factored into small, independent pieces; then try
That problem is solved now
Rudd-O - http://rudd-o.com/
Hard as it may be for the Slashdot dilettantes to accept, cut and paste is the principal "code reuse" tool, when any code is reused at all. In general, code is rewritten many times in each project; this is because the most-reused code is also usually the simplest. There is very little cost associated with doing this, compared to working out whether or not a piece of code exactly matches a new task, or needs to be 'tweaked'... oh, and by the way, you'll have evolved since the time you wrote it, and you'll want to give it a polish while you're there... and then you'll break the original code that called it.
Leave it alone. Write it again.
Storing your code is just the beginning.
But to start, use SVN. There's not a good reason to use something else, and having the history of your changes will (in some ways) be far more important than having the code itself. If SVN is a bear to put up with, and it's just you, you might consider RCS, but RCS will eventually make you jump through so many hoops that sooner or later you'll be looking at SVN.
After that, you'll need to recode your code to become more useful over time. At first, the solution fits the problem, and the problem fits the website, and that fits the specific task you were trying to perform. After some time, your needs will change. The second time you want to use your code, you'll notice that it doesn't really fit. This is where your challenge starts.
Challenge yourself to NOT write the 2nd and 3rd products that use your code to make compromises for the "way this library needs to be used". Rework parts of the library to make it more useful in more situations, and rework both the old and the new projects to use the new library.
Then try to make a third application that uses the library in a slightly different way. Once again, don't write the application to fit the library, but modify the library to fit the way the application uses it. At the same time, check that the old applications both keep working on the rewritten libarary's code, and keep them up to date with the changes in the library.
After a few trips on this merry-go-round, you'll begin to notice a few things about code maintenance, code reusability, and code maturity. Sure, you could just read about it in a book, but that would rob you of an education. You MUST see it happen in person to understand it. If you're doing things "correctly" you'll notice a few things:
1. Each time you write a new applicaiton, the library needs to change less and less, but it's still easy to use.
2. Good libraries don't force different applications to be written the same way. Bad libraries require the application to be written in ways that make using the library uncomfortable.
3. It's impossible to make code reusable without some understanding of the various ways you might be likely to use it.
The real test is when you find yourself writing documentation for your library so you can hand it off to someone else to use without the need for them to see your source. Sure, you could give them a copy of the source code too, but if they have to read it, you've only made it reusable for you, and that's a small audience to learn from.
Good luck, and don't worry if you fall short. Writing good, flexible, reusable libraries is often much harder than writing the applications that use them. Just remember, it's not a library if only one application uses it. It's not flexible if only one style of application uses it. It's not good if you have to read it's source code or documentation that looks like it could be source code.
Sincerely,
ELB
...leave it in the image, optionally categorized as an addition to the base classes.
Couldn't possibly be any easier: It's right there, viewable in a method browser.
Uh-oh... I probably lost 99% of you on this.
No problem. Back to being productive....
BWilde
Smalltalk is the performance sports car of languages
And it looks great. Nice job -- and good article too. Glad you fixed it.
Nothing is inexplicable; only unexplained -Tom Baker, Doctor Who
This is only good for home/local use:
I have a special subirectory called "code" within which I have folders for each language I've worked in for whenever I've had something I want to save. These will either be the first few tutorial-level programs I've written in that language, or complete programs where I saw some reuse in the future. I can quickly search ("grep") within the files for functions, keywords, and such, either as a memory refresher for writing a different program, or to cut and paste and modify. It works for me because with programming, I tend to go wide but shallow! That is, I have five usable programs each in about 15 languages I've done by now...and I'm still falling behind, I need to learn 20 more!!!
Regardless of age, this guy is ugly as sin
I can usually remember the project I was working on while solving a specific problem. Once I get to that point, it's just a matter of looking through the project enough to either remember exactly where the code is, or doing a 'find' on some random keyword I might remember.
But there's a better way: RDF.
Either RDF or a del.icio.us type of tagging system. Although I haven't seen an application that does so, I'd love to be able to tag code to later search. I'd be able to put kewords/tags *INSIDE* the code, as well as marking files, groups of files, and so on.
For instance if I wrote a really cool recursive function, I could tag it as "javascript, recursive, 'company abc'". Then when I was looking for the code I could search for any or all of the keywords and get a list back. I'd like to be able to search by filename and within files (with regex support of course), please.
I'm sure there are tools out there that have this type of functionality, I just haven't happened across one yet.
TK
And you know, looking back on it all, I would rather have it this way (TRS-80/Commodore/Apple2 BASIC, MS QBasic, MS Visual C++, LINUX gcc, Lisp, Bash, sed/awk, Python, Tcl/tk, GTK/ncurses/SDL, HTML, CSS/XML, Java/Javascript, POVray, rc... who knows, I've probably forgotten five or so!), than to have gone 90 miles deep in just one language and be married to it for life. The way it is, you learn one new language a year or sink into the Turing tar pit!
PS You know what's funny? I *STILL* haven't gotten around to Perl and Ruby! Oh, I'm pitiful!
Id love to swap strategies about it but i have about 14 squirrels to catch before a 9 am metting tomorrow.
It is better to keep your mouth shut and appear stupid than to open it and remove all doubt. -Mark Twain
"Real men don't use backups, they post their stuff on a public ftp server and let the rest of the world make copies." - Linus T
BAIN http://www.devslashzero.com
mv ./random_program ~/Fortran/random_program
What?
I have this thing called a folder, filled with folder for each programming language I know, filled with folders for each program I have made, filled with folders for each version of the program (generally only the latest stable version, the dev version, and any major branches), etc. Back up every important revision and you are good to go.
Last Post!
Who needs Perl or Ruby when you've got Python? ;) It's hard for me to imaging doing much of anything in Perl since I've started writing lots of Python. The funny thing is I was put off by the whitespace significance at first, but that took, oh, 20 minutes to overcome. I love how simple the language is syntactically, which is something you'll never get with Perl--it takes "there's more than one way to do it" a little too far.
This is one of the most complex problems in the realm of computer science, and the answers to this question are less than obvious.
.. I find that a typical Euler-lagrange transformation works a treat, especially when numerising C code.
.. you now have a basis for a firm statistical analysis, and you are now on the road to the enjoying the luscious fruits of code-reuse.
.. and that these structures are also .. you guessed it ... a six sized pyramid with a structural ratio of 2/pi. One more peice of evidence which confirms the widely held (but seldom admitted) secret knowledge that the ancient Sumerians were masters at the art of computer science.
.. ah .. yeah, there you go. You should reduce your code to numbers, store it in a hexa-pyramidical structure, and continue to statistically analyse the usage of these functions until such times as your hexapyramidical representation of those functions reaches an ideal ratio of 2/pi. At that time, you know that you will have reached a higher plane of computing expertise. Take pleasure in this moment and revell in it - but be aware that such knowledge only opens the doors to longer and steeper pathways, beyond which lay more secrets yet to be uncovered.
What you need to do is reduce your code samples to a numerical matrix, assigning weights to various functions co-dependant upon the language that is being used in each case.
These matrices can then be overlayed in an N-dimensional space, and the resulting eigenvalues plotted
For C-like languages (such as PHP), then a modified transform, such as the "saddlepoint" method used by Ridderinkhof and Loder is often more appropriate.
Once these transforms have been completed, computed, stored and plotted
Now you need to apply that numerisation of the coded functions across an (N+1) dimensional space, which is in fact - the source code to which the said functions have recently been applied. Time scale here is critically important - as the most recently used invocation of a function must by the merits of its use, hold a higher weight than one which has not suffered invocation for some considerable period. This is the much-discussed 'Wolverton-Hasselby functional relevance decay factor' which is often the subject of many a debate in computer science circles.
Having thus reduced the chaotic collection of functions to an orderly numeric topology (the graph of who's actual usage forms an ever-revolving surface spread across a time-dependant dimensional plane), we soon find by observation that the collection of functions now forms a pyramid.
Further quantum statistical analysis of this ever growing and ever evolving collection of co-dependant functions will reveal that the structure of this grouping forms not just a pyramid (no surprises there), but a SIX SIZED pyramid !! A pyramid with the base of a perfect hexagon is formed when this numerical matrix is rendered as a 3D image.
The ratio of the height of the pyramid to the size of the base is the value of 2/pi.
There are writings in Babylonian that hint at the architecture of the inner structures concealed within the Ziggurat of Ur
So
Best wishes on your journey
Interesting site you have there, btw. Is that really you? You're so dreamy!
"Our interests are to see if we can't scale it up to something more exciting," he said.
*chuckle* Oh, dear...... If you're going to start out by comparing the general community of /.ers to a convention of heart surgeons, I'm afraid you've just lost a lot credibility as a /.er yourself. Slashdot is hardly as exclusive or serious a place as a professional convention. Gawkers and clueless spectators abound. Even some of the most ernest questions/comments posted to a story on, say modern physics or cosmology, makes me cringe at the sheer absurdity of some posters. But, one replies to these stories of ones own free will. Slashdot serves a truly diverse group. To expect this place to remain the playground of elite coders is rather myopic and narrowminded. We are astronomers, geneticist, sci-fi geeks, and just general knowledge lovers. Let's just accept the fact that some of us will end up looking stupid and ignorant at least once but likely often. And when that comes to pass, it isn't rude or ill-mannered to ask for some help or advice.
I think that you'd have to agree that the OP really didn't seem to have any real focusI would agree with you here. But in his defense, how can you have a focus when you're just starting out? My educational background is electrical engineering. When I was a freshman straight out of high school, it made little sense to worry about specializing in analog or digital when I didn't even know what a transistor did.
so any comments submitted are going to be in the context of the person posting the comment rather than in the context of the person seeking the information.I see nothing wrong with that. Learning by extraction out of context is a great way to learn about more than strictly the answer to a stated question. In my experience, answering the simple fundamental questions (and answering them well) is the true hallmark of really understanding a subject. So even if you get a bad question, you should award yourself brownie points if you still manage to be informative and helpful with an (good) answer.
It's surprising that given your history that you'd defend laziness. You remember just how hard it was to get information on anything back in those days.....Which was why I asked a lot of questions of a lot of people with a lot of experience. Generally, those who bothered to help me were rewarded with my willingness to use my accumulating knowledge to help them when necessary. No money was involved, it was just good manners that helped to build a sense of community.
Let me give you one more thing to ponder. Even though I've done very little telephony, I'm now working on building out a fairly sophisicated Asterisk server. If you've ever worked with this technology then you'll know that it's less than well documented, but that doesn't mean that I'm not responsible for doing research before asking questions. If I were to put a post on Ask Slashdot saying "I want to build an Asterisk server that connects to a database - tell me how" then the community would be right in flaming me. If I was to submit a question like "is there a better way to interact with a database than the system command?" then I would expect to get some really good answers.
I guess you and I have a genuine difference of opinion. Your efforts and achievement in building your Asterisk server is admirable. But I would be more than happy to help you if I had more expertise in this area than you did. In my opinion, if you're expereinced enough to ask sophisticated questions, you ought to be smart/resourceful enough to figure it out yourself. But if you're just starting out, you often don't even know what the right *questions* are let alone the right answers. I tend to think those are the ones who need the most help.
Stay sentient. Don't drink bad milk.
I put them inside a dir; inside that dir, an untared copy of every project, and a tared one. They sit there waiting for me to reuse them, and guess what? I never did (and I think my first public release was in 1997 or something like that...) So its basically a cemetery for things to rot in peace. :)
A big dusty stack of unlabeled 5.25" floppies in the garage. Data on such crude media probably has a half-life of 900 years, which is good because it'll be at least that long before I get around to ever looking at them again.
Lately I've upgraded my technology. Now I have several hard drives with hundreds of GB, whenever I have code I create a new directory for it and then forget where I put it. Occasionally when I accidentally find a stash of old code or something, I copy it to a new directory and forget where that is too. In this way I accumulate dozens of copies of everything on my system, across multiple drives. If one ever fails it won't matter 'cause I haven't a clue what is on it.
Sometimes I back up a random directory on a CD, which I forget to label before tossing onto a stack of hundreds of identical looking CDs. It takes hours of searching, popping CDs in and out of the drive before I finally give up and re-invent the wheel for the sixth time.
(WORN = Write Once, Read Never)
Fortunately nobody really cares what you think is right or wrong.
He asked a question and those that care to help responded.
I use Perforce, which works great for me. You can get a two person license and it comes with a GUI client that works much better for me than any of the Subversion ones. It also has the useful feature of keeping track of all changes I make to the repository without keeping any hidden directories around (and you'll appreciate this the first time you move a subversion directory from one place to another).
Subversion is probably a reasonable second, although Perforce wins out on features and simplicity.
http://www.venge.net/monotone/
I put all my good code in open source projects. I means that I don't need to do as much maintanance, other people optimise it, it gets stored all around the net and [Ed: think of something warm and fuzzy about forming online communities or somesuch tripe].
I think Linus Torvalds once said that he doesn't need backups, as he has 10000 copies scattered around the net of everything worth keeping.
The JSAN project (openjsan.org) project has already defined a really neat way to build your JavaScript code as reusable modules, with unit tests and everything!
I highly recommend you follow their JavaScript package style, even if you don't use the JSAN modules themselves.
Since you mentioned PHP: take a look at the PEAR project, the organization of its library and the structure of its classes. Lots of smart code reuse there.
Good luck,
JP
From my experience: :)
- If you have unit tests, keep them with a copy of the program that runs them.
- If you dont have unit tests keep a running little example of how to use it - and start looking into using test-driven development for these pieces of code you'd like to rely on.
- have a 'code blog' in a plain txt file where you track some of your main decisions and ideas to-do. As time goes by, I have tended to idealize my past code into doing things I had only wished it did
- If the code uses databases, external files, etc. keep those too
- If there are interesting things that need to be done during build, make sure you keep those too
- Choose some SCC mechanism, svn or whatever suits you, plenty of posts...and archive a plain copy of the
- if you plan on archiving for maaany years and writing in some propietary lamguage, keep a version of the editors & compilers safe with your code. I had to rehash a lot of prolog once.
Why on earth would you want to send SIGTSTP to your project? Isn't that kind of counterproductive? And what does using CVS have to do with that?
It sounds like you asking more about how best to organize your code for future use than how to store it physically (as in backups).
;-)
Comment your code extensively using quality remarks explaining how your code works and why you are doing the things that you are.
Keep a design document for your programs. This is a bit different from leaving code comments. It's more of a journal that you can rely on to get a contextual understanding of your code. I've relied on design documents to help me reevaluate assumptions I've made in my programs.
As others have said already, make your code as modular as possible. This doesn't mean you need to write object-oriented code or switch to an object-oriented language by design.
If you've got a lot of code that you frequently use, often at the same time, consider combining them into a single useful library. There's nothing to say that a programming library must contain functions that perform related tasks.
As for physical storage for your code, get it off your computer.
Having myself started as an ambitious self-taught novice, I have a collected a large amount of code covering multiple languages and platforms; and including completed programs, unfinished projects, homework, experimental code fragments, code written for dead systems, and third-party source that I found inspirational. Ergo, I have a beastly collection that doesn't mesh well with source control software. Still, something like SVN or CVS will help you further down the road as your software projects become larger and more complex.
Until then, I recommend maintaining paper copies for your most valuable code in addition to storing your source on dependable, portable, and ubiquitous backup media like CD-ROM in ISO-9660 format, uncompressed if possible, otherwise using a common compression format like GZIP. Sounds a bit anal maybe, but there's always one computer I need to use that chokes while trying to read my DVDRs, and over the years I've stored my code in cool compression formats like ARJ, ZOO, and StuffitX.
Does anyone know if someone is porting git to Windows (not cygwin)?
It doesn't replace the concept of "libraries and APIs", but sometimes I end up with a silly text file full of customized how-to snippets. I'm talking about blocks of code or SQLs that do something useful and I write often enough to warrant a snippet library.
I imagine such a thing could be networked and served to a large audience, much like the searchable online regex library. But I can't think of any type of source control that has the capability to search and find snippets with ease (someone else posted how source control only deals with versioning).
http://rubyforge.org/snippet/ seems like a good place to emulate.
My two sense.
DELETED!
Me, I just commit my code to whatever platforms repo (eg. php) I'm coding on. Soon, my functions are available on every machine that has a recent version of said platform!
If you hadn't funny++ this, I would have been all WTF, but instead I was all LOL.
I like to take often used 'custom classes' in Java and puting them in a reusable package that I can use in many of my apps. My favorite package that I like to use is the Convert class. It basically does all the .valueOf(), parsing, and casting without having to begrudgingly type all that crap out.
My favorite with ASP.NET is a sanitize routine that scrubs input fields for SQL and script injection attacks. It is a perfect canadite for a class that needs to be implemented in all my .NET projects.
We're all hypocrites. We all have hidden parts, it's the contrast between them that make us more a hypocrite than others
Although still not fully stable, a revision system like bazaar-ng saves you to set up a listener/server (which in some occasions needs root privileges).
I like it quite a lot, expecially it's easiness to mirror changes to a remote server, even over ftp, sftp or rsync. Then it's even accessible over normal http.
42.
You'll be surprised how often rewriting something from scratch is preferable to pulling out an old piece of code. First of all, you have to be sure the code does what you want. Then, you have to be sure that it is self-contained, or that you can easily get all of its dependencies. Then, you need to figure out what the API is and how to use it for your particular problem. All this takes time.
In my experience, situations when you can successfully reuse previously written code are very rare. It's usually much faster/cheaper/less troublesome/more reliable to write the thing from scratch. Also, I find that over the years, my programming skills improve, so code that I've written before looks... sub-optimal. Since I'm a perfectionist when it comes to programming, I will be more likely to just rewrite it again.
That said, there are a few very small files that I have reused many times before. Most of them are data structure or algorithms like BigInt, AVL tree, maximum flow, bipartite matching, etc. I store them here: http://shygypsy.com/tools
Hi,
I'm a C# coder and use Ms Visual Studio. I re use code by creating a common project on my hard drive called MyLibrary. Whenever I create a program I reference it, often adding code to it. It works quite well.
P.S. I am also mainly self-taught!
Now, there's a few caveats here. Another thing that happens over time is you learn to stop re-inventing the wheel and to use pre-existing libraries. Right now, you're just unaware of their existence, but you'll learn where to look if you make a little effort. In fact, you'll find that existing libraries tends to heavily influence choice of language to use. So it turns out that most things that are really worth reusing are already available, and you should use those solutions rather than maintaining your own. Sure, write your own for fun or education, but when you get a serious project, you've got no use for it. In some cases, you'll find that there's no library available, so you write something from scratch, but 3 years later, you find that somebody else has made a nice library that's much better than what you hacked together. Several times I have ported code from my own hacked together solution to a more mature library. It's a natural progression, and there are a thousand times more libraries freely available today versus 10 years ago.
Now, having said all that, there are still times where you want to make something that is generically reusable. The point is, though, you should really make an effort to make a library out of your code. I have done just this on a handful of occasions. Then, put it up on SourceForge or something similar dedicated to your language of choice. I have a few libraries up on SourceForge, some only a few hundred lines of code, but some other people have found them useful because I made the effort. Other people have suggested CVS or whatnot, and SourceForge will give you that.
Maybe the real gist of your question, though, was about making your code into a library? While the technical details of making a lib, dll, so, jar, pm, etc vary from language to language (sometimes compiler to compiler), here's a few pointers:
and create your own centralized codebase '/usr/lib/php', thus allowing you to share the same OO code throughout all of your projects/websites on that system.
ie: @require_once 'MyClass.php';
A very efficient approach to managing code and developing web applications is to use a staging (development/QA/production) server environment to thoroughly test your code, and a CVS Repository to efficiently manage your code.
A bit of discipline, patience, and common sense is also required. =)
the only permanence in existence, is the impermanence of existence.
I can't believe his age is even being discussed. He could be 33 for all I care.
So, what? Is 33 now old? Do you have a problem with 33? I've nearly spent an entire year thinking that, as a 33 year-old executive/programmer, I was doing really well. I thought I was young. But, the way you refer to 33 as though it were some magic number describing incredibly old age, I have to wonder - am I really doing so well after all?
Could it be that I'm really just some crufty old fart, reeking in the smell of fatherhood, husbandry, and executiveness? And, I thought I'd achieved quite a bit in the (ahem) 33 years of my life so far.
I can't believe I've just been reduced to " He could be 33 for all I care....
Why 33, particularly? Is 33 so much older than, perhaps, 31?? Why not 43? or 39? What's wrong with 39? Or is 39 just too old for consideration?
Augh! The questions!
I have no problem with your religion until you decide it's reason to deprive others of the truth.
THANKS !
The converse goes something like
It is better to keep quiet and let the world think you're an idiot, than to talk and let them know for sure.
Cant attribute that either.
more power to the curious!
bah!*@%!
I stopped writing any code that might deserve being reused.
I confine myself to writing the special things.
When I need something library-like, I simply google for it, find a decent project on sourceforge and download it. Works surprisingly well in 99% of the cases.
The hard part is to find the right keywords to search for.
Say out loud: I'm an Aspie and I'm somewhat proud, I guess. Uh. Can I write an email in all caps instead? Hm...
I don't have all that many project trees to manage(40 or so), but here's how I do mine.
I have a folder on my hard drive that contains all of MY code, versus OSS code that others have written. I have it arranged into folders by programming language and then again by project name. So let's say that I need to get to the library that I wrote for driving my parallel port VFD in RealBasic, I'd look in c:\Code\$RB\VFD_Driver\stable.
I don't do or need CVS, I manually separate my code into stable and devel versions. When I'm satisfied that the devel version has had enough bugs worked out, I make it the stable and devel a new version.
I won't be the next Linus, but it works for me.
LK
"Hi. This is my friend, Jack Shit, and you don't know him." - Lord Kano
I'm all for bashing Ask Slashdot questions that should be Googled and "Do my homework plz" type questions but he really just a kid (look at his homepage).
Look at him, he may be a youngster, but he's no child.
LK
"Hi. This is my friend, Jack Shit, and you don't know him." - Lord Kano
I have written more than a few reusable PHP and JavaScript functions for doing stuff, including PHP functions which generate JavaScript for form validation. When called, the function echoes the form element to the screen and returns a fragment of JS code which validates the element. If I actually want to validate the form element, then I append the result to a scalar variable which I output later; otherwise, I just call it in void context.
/var/www/html/. Then I can easily refresh my memory as to what each function does, by running the demo and referring to the comments; if I want all the goodies I can include them, if I want just one then I can copy and paste it.
My preferred technique for function re-use is just to save a function or set of functions that belong together, in a heavily-commented "demo" script, which I keep all together in a directory. I also have a corresponding "include file" which contains just the function declarations from the demo script, saved in
Also, I have a few "quick start" scripts with all the
<html>
<head>
.....
</html> stuff and my most-often-used functions and constants. These are all chmoded 444 and chowned root, so I can't accidentally overwrite them.
Je fume. Tu fumes. Nous fûmes!
I store my old code between my ears, in the wetware. When you've been programming as long as I have, you don't write code anymore -- you just remember it and type it in again...
"World Domination - a fun, family activity"
You need a stable environment. Like, define some include directory, a specific way to include your code files, and a specific way how APIs should be designed. If you are using OO programming for database access, write classes that you can use over and over again with minimum effort.
;)
Avoid globals in libraries at all costs.
Now, split up problems to usefull bits, and add those bits to your existing libraries, or create new ones, whichever seems to be logical.
Like this, you can easily re-use source code wherever you need it again. PHP has some pitfalls here (directory mess when including from other directories) that need to be solved early.
For storage, it's up to you. You can use CVS or Subversion, as many other pointed out.
pro's:
1. you have backups of older versions
2. upgrading old projects to new versions get's easier
3. if someone joins the team, you already have a versioning system suitable for teamwork usage
con's:
1. you need to use it. There's no way to go "easy" on some projects because... well whatever
2. if it crashes, you are in big trouble. Restoring a CVS or SVN is more work than simply swapping a disk and putting your tar.gz files back from your backup CD. You need backup CDs anyway, but of course it's not that much of an issue to restore a CVS/Subversion directory.
I always go for CVS, or, these days, for Subversion. Subversion has proper directory handling, while you are stuck with dead directories like in "forever" with CVS. Subversion also seems pretty much stable, and I'd consider me quite a regular user.
have fun coding.
I am, at the present moment, an beginner/intermediate programmer. I have found it rather hard to find people willing to help with pretty elementary stuff. If someone doesn't want these people posting on slashdot, I suggest they make a site or forum of some sort for beginner programmers to find such help and advice from volenteers and more advanced beginners. And if such a site already exists, please point me, and anyone else concerned, to it.
Considering all the praise we read about Subversion, and its compelling features list, we switched a medium size project (80000 loc) from CVS to SVN. All in all we are not impressed with Subversion, and are not going to use it for new projects (for the forseeable future).
The bad things:
svn import: oops, there is a some experiment data in the directory, or an AAP subdirectory. Shit, the repository has grown by another 100 MB. No way to get it out again, unless you convert the whole BDB database to text, find your accidental additions, cut it out, rebuild the database, do svnadmin recover, fix all the permissions.
Really wrong error messages.
" unable to get lock on file blabla". You'll now have to manually do svn rmBig errors:
Having moved our repository to another server, we have had situations where a subdirectory was pointing to the new server, and its parent to the old server. When we did an svn update in the subdirectory, the updates would not happen and no error whatsover was given. Worse, to prevent this kind of problems, we had renamed the repos directory on the server, so that there was no way some dangling old links could accidentally access it.
Adding files to a repository from multiple places around the lab has gotten us often into troubles
The Berkeley DB format keeps changing. You can't just copy one to a server with a slightly different svn version. Worse: it will not tell you that there is a version difference, it will just try, and come up with the most irrelevant error messages.
All in all, we find SVN not ready for prime time. Its promises are great, but at least CVS is just working reliably.
This code is going into the Space Station (Declic), version control is a must for us.
I maintain my code in nuweb. Requires: nuweb, tetex, plus the usual linux utilities. Yes, Literate Programming lives!
DO NOT USE CVS ON NEW PROJECTS! SVN is the replacement for CVS. It fixes all the hyper-annoying deficiencies of CVS. For example, SVN is aware of "directories" so you can keep them under versioning. It is aware of mime types. It is aware of properties, and can do smart things like correctly and automatically handle end-of-lines. The list goes on and on. After you try SVN you'll think that CVS is unusable. Oh and SVN has atomic commits, unlike CVS, so if the commit breaks half-way through you don't end up with half-messed-up repository.
There's no decision to think about at this point; use SVN.
http://draganddropupload.com/
The collective IQ of the universe just dropped a full point as a result of this being modded insightful.
With Subversion, backing up /etc is trivial.
When stuff goes awry, it's nice to have a means of investigating/rolling back the boo-boo.
Yet another reason to eschew operating systems that hide the configuration data in a binary prison.
Get thee glass eyes, and, like a scurvy politician, seem to see things thou dost not.--King Lear
The same problem, albeit at a much larger scale, is faced by the industry. This is an OMG stardard on reusable assets:
http://xml.coverpages.org/ni2004-05-07-a.html
If you think that you'll be using certain functions more than once, pull those functions out and put them into a seperate module. I tend to code in .NET, so if I find myself using certain pieces of code very often, I'll take that a step further and compile the module into a class library (dll). This is good in that if I want to make a change to a function in the module, I can change it once and it'll be updated in any of the apps that use that function.
I didn't start using a source control system until after I started working professionally. When I was an amateur I didn't think it was important enough. WRONG! The ability to roll back changes is VERY important.
Download free e-books, lectures, and tutorials at bookgoldmine.com
This is covered by a regular overturning backup (external HDD on my Mac, hotswap carriers + frame on my PC). I do backups every 3 to 5 weeks and whenever I move my Mac around (12" iBook laptop) incase I drop it and lose my data or something.
I do Python, PHP, ActionScript and some other things and memorize where the good snippets are so I can check them out when I need that particular function again.
Copy and Paste Coding is bad pratice and only will take you that far though. With PHP and JavaScript building libraries is as easy as 1-2-3. You don't have to do anything OOP yet. Just put your PHP functions into logical groups and seperate files (like all the DB stuff in one). This will get you started in OOP. Especially in PHP where there is no thing they call "Namespaces" and you function calls start to look like very fast if you can't bother not putting everything in one class. Truth is, no other PL is better at demonstrating the advantages in 'good practices' (OOP, DRY, etc) than good ol'e verbose and messy PHP. By introducing you to weedy code faster than you can think.
When you are as far as to do solid OOP you'll notice that a lot of stuff has been done allready and move to using finished libs in the OOP community. You'll then start coding your stuff only after looking at 3rd party packages and when your absolutely shure that the stuff you need hasn't been done yet.
It might also be time for you now to check out Version Management. I suggest Subversion, since everybody is using it or switching to it. There's a good free book on it aswell.
We suffer more in our imagination than in reality. - Seneca
Yes indeed.
@ Work - Visual Source Safe (which, in turn, gets backed-up nightly on the job), my dept. share personal folder onto the LAN, & also a 2nd partition on my local HDD on my workstation.
:)
@ Home - First, to a 2nd HDD, which has folders for my code specifically & there is 12 years of it on there (which gets DvD +RW, ZipDrive, & Sandisk Cruzer (256mb one for each language I use which is usually VB6, VB.NET, Delphi, & Access) backed-up) - this has been VERY handy for me especially!
(That is simply because I can reach into it from work (to my home drives remotely via RDP/Terminal Server services) & don't need to know anything more than the categories I personally store code in so I know where to look when I need to find a particular routine (or one to use & vary a little bit) to use on the job as well as @ home)...
*
The most important thing I can tell ANYONE in this field & the "oldsters" will know this already - NEVER THROW AWAY ANY OF YOUR OLD CODE!
APK
P.S.=> It seems to work alright & I have been able to collect up YEARS of code this way that I nearly constantly reuse on the job... & like the INXS tune title "Don't Change", I don't need to - it works! apk
Holy cow - you need some serious medication dude! They were caling him a "kid". I'd say 33 is not "a kid". That's all! I didn't mean to say it's old or something.
You're either joking and I'm too tired to recognize the humor or you're a very sensitive individual. Congrats on all you've achieved in your 33 years by the way.
-stormin
The Southern Baptist Convention has creationism. On Slashdot, we have porn.
I use CVS for reusable components, though I intend to switch to subversion at some point. For storing small algorithms, some simple functions missing from the development frameworks I work with (STL, MFC, JScript libraries), idioms, sample code, known bugs, etc. I have my own wiki server, and thoroughly recommend it. There are many ways to implement a wiki server... I, myself, use Mediawiki, which is the wiki software used to run wikipedia. Advantages of a Wiki server: It provides versioning, everyone at my company can read it or edit it, it allows me to define it's structure as I go, it has it's own search engine, and reusing code is as simple as: 1 - Browse 2 - Copy 3 - Paste 4 - ...
5 - Profit??
As a Slashdot discussion grows longer, the probability of an analogy involving cars approaches one.
CodeProject.com has been really helpful to me. I have frequently gotten answers within hours of posting there.
-stormin
The Southern Baptist Convention has creationism. On Slashdot, we have porn.
Tom Lord's Arch would be a better decentralized CM choice. bzr is a redundantant project, as many Python projects are, it is slow and subject to tumultuous and backward incompatable changes in the Python core.
an ill wind that blows no good
Aren't there editors on slashdot approving stories? This post is pure troll/ridicule bait. There will be very few if any useful responses.
You kinda missing the point,
You should use already available frameworks if they are available for you language, if they aren't and you have to write them, write them good and write a documentation and publish it so other can use it too.
Alot of people has pointedout that storing code in CVS is great, and it is. But if your library/framework/api is great, with good documentation and pretty fast.. Then most people won't care if you carve code into rocks or if you store it on the moon in a bombshelter.
all that gets is a 5?
accurately define good according to a criteria and seek it out.
I zip my code with the date as a version. Keep it simple.
I blew all my mod points modding down those stupid comments in the korean article, but this guy should get modded up. The GP has no reason to even assume that the question is about OOP - what if he is writing in a non object oriented language?
Q: "How do I store my code?"
A: "Comment better!"
???????
I submitted this story last night, and it didn't get posted.
Make sure you are using #include (or #include_once) and function calls
r
Put as much "code" into function calls in files grouped by purpose, database, formatting, drop-down-menus, etc... Keep the function calls in their own files that are included when you need them.
You want to strive for 2 layers of code, one is the page being presented, which can change every time. While the rest of the code is "included", those included files get easier to re-use over time & you figure out how you like em.
My favorite model for breaking down code into modules/libraries is the Model-View-Controller (MVC) http://en.wikipedia.org/wiki/Model_view_controlle
As you start to tweak/modify your librarys/modules storing them in CVS is great way to track how they evolve over the ages
If you are not bound by some legal constraints, {insert any other reasons here}.
Create a project on a service like SourceForge. Not only do you get code management, but you also get feedback, improvements, bug-tracking, a homepage...
This way, a community can help you organize your code, and also help you enrich it. AND, you also don't have to worry about maintaining a CVS/SVN/etc. server, and can focus on organizing your code so you can obtain your goal of re-usability.
-- Good Luck, FJF
http://www.sourceforge.net/
Hello,
One of the problems that you could run in can be Intelectual Property.
If you plan to use the code snipets as part of a project for a company, they might force you either to rewrite the code, or to relinquish your copyright to your code to the company.
also, in most cases, if you are currently employed by a major company, you probably have a clause in your work contract that states that any IP that you generate do indeed bellong to the company and not YOU!
the other way to do it is just to lie to them...
cyrille
...when a chunk of your "previously-written code" is on punched cards, some on 8" floppies and some other on fan-fold listing paper. I think I might even have a roll of paper tape -- unless the cats got to it.
I'm not joking, trolling, whatever.
The only problem is: how to get that code into the computer, besides typing it in? Nonewithstanding (sp?) OCR for the fan-fold listings, 80 col. card readers and 8" floppy drives are far & between. What to do?
p.s.: and this makes me think about our current media, if it will end up as un-readable as my old museum-grade stuff... How soon before we can't even find a 3" floppy drive?
duh!
Yes CVS or Subversion is a good choice.
If you are interested in PHP coding it is the best to get stick with some existing PHP platform or system that already solved this or is going to solve it: Zend collaboration or PEAR
or... any existing CMS like Mamboo or...
I was maintaining my own libraries for years but I found it very difficult and ineffective because of the way I did it.
Every project was slightly different so I ended up reinventing (or breaking and fixing and enhancing) the wheel over and over...
Sure, the low-level functions can be reused easily without any changes but higher
level functions that has more complicated logic are difficult to reuse in different systems which are often based
on different processing logic (and went through different historical evolution)...
I realized that maintaining separated snippets of libraries is very ineffective so I decided to write Elixon Platform
which helps me to organize existing libraries and still keep the same intercommunication and logic and
coding style intact because it is still one Platform.
So my advise is: try to avoid looking at the libraries as at "stand-alone independent snippets" and try to integrate
all libraries under one umbrella while keeping them modular and as much independent as possible.
Well, I've got to get back to work. When I stop rowing, the slave ship just goes in circles.
I might not get mod points again for a year - so what?
Any sufficiently advanced libertarian utopia is indistinguishable from government.
I feel sorry for people whose favorite languages don't have an equivalent for the CPAN. All general-purpose programming languages *SHOULD* have such a resource.
Cut that out, or I will ship you to Norilsk in a box.
Dude, slow down on the mud slinging. I am glad you have ultimate knowledge of filesystems. Actually, I don't even program in an Object Oriented environment (on a daily basis), and could use many of the file storage and retrieval systems that were recommended for myself in my day job environment where copy/paste is our mantra (mostly HTML and server-side scripting). Perhaps this is why I was reading this post. Still, I do know that if you create something in an OO environment, you can re-use it. Its simple and square one for most CS students (right after logic and variables). I still stand by my post. Think about Object Oriented design...possible using UML and the Unified Process (although the process matters little here). You pull your classes or objects out of the Use Case, code them up and move on. They are like little black boxes. Once they do a trick, thy can repetitively do that trick. In fact, they can do that trick in my file library or yours. So, maybe its not organization as much as re-usability concepts this poster is looking for. Which is why I thought OOP practices are a good idea. As with all things, it is a concept and not a product that will solve the problem.... ...I think we are both right, and its a mater of interpretation. Personally I think the original poster would be better off using both concepts because PHP has really object oreiented based in version 5 and Javascript can be organized into libraries...yet basic file storing techniques are necessary for storing your built code. Take either of these without the concept of the other, and it is like building sort functions without the idea of recursion....very labor intensive. You might have them all organized nicely, but you will have many that do a similar function...yet just slightly different. Thinking re-use will get you further than simply good organizational skills.
Anyway from the post: "I'm not really sure how I should organize things, how the code should be stored, how it should be implemented, etc. I think this is what people mean when they talk about libraries and/or APIs, but not really sure. I'm specifically curious about PHP and JavaScript, but advice for other programming languages is also helpful! How do you store and maintain your most frequently used code?"
i tend to store my most important code libraries on engraved stone tablets. however, i also find clay cuneiform tablets are useful in a pinch. seriously, svn yada yada, what everyone else said earlier. can't go wrong with svn.
Any Language
C/C++ Language
I'll just stop with C/C++, because that's what I know best. I have various script repositories, but the main point there is to keep them someplace that is easy to search.
Hope these are helpful. Flamers save your breath, I know your favorite language is 31337.
Learn a real language, then come back and ask this question
Yes, a version control system is always a good idea. There are plenty of them out there, and different people prefer different ones. Find one you like and can use -- for a single-user setup, anything simple and reliable will work. Meostro made a good point about choosing a style and sticking to it -- you'd be surprised how much difference a consistent layout makes in being able to read your own code quickly.
I've also got a couple of suggestions for your code. Feel free to take any, all, or none of them, as it suits you.
First, I strongly recommend getting the book, "The Unix Philosophy." It isn't a technical book, and you don't have to know Unix. It is a book about one particular programming philosophy, which can probably be summed up as, "Make one small thing that does one thing very well. If you need something complicated, make it out of several small, well-made things." It is an excellent book, especially for a programmer trying to decide what his/her own programming style will be.
Second, heavily comment your code. I think anyone who has been programming long can tell you about the code that they thought they wouldn't need to comment because they'd remember what it did... and then had to look at it again six months later and wondered what on earth they'd been thinking.
Also under the heading of commenting your code, get in the habit of putting a standard header at the top of your code files, which shows the name of the module, what it does, what its input parameters are, and what output it generates. This may seem cumbersome and arbitrary at the time, but it helps immeasurably in being able to glance at a module and know what it does, and in being able to find the particular module that you're wanting to re-use.
Third, keep hard-coding of values to an absolute minimum -- they limit the versatility of your module. Parameterize them instead.
Fourth, avoid "magic numbers" -- if you have a numeric value that is being used, strongly consider assigning it a variable name instead. Otherwise, you'll find yourself looking at code that has something like this:
coopsNeeded = totalChickens / 24;
wireRolls = coopFootage / 24;
and you've decided that you need to change the '24' in the first formula... but do you need to change it in the second one, too? Do those two numbers need to stay the same, or did they just happen to be the same in this case?
This, on the other hand:
coopsNeeded = totalChickens / chicksPerCoop;
wireRolls = coopFootage / foxBlockers;
avoids that sort of confusion.
I hope this helps, and good luck!
You must be PRESENT to win!
The key is finding code ...
...
Indexing it and generally geting good information.
the answers I use are often variations on
cscope
grep -lir thingy .
grep -E can be handy too
find . -foo | perl -ne '...'
perl is nice for complex things like.
Generally perl has a module to parse it.
Between REs, Parse::RecDescent, expat, and many custom parser.
it is execellent for building source code maps, diagrams,
dependency lists quickly and as needed.
Garick
First, always use version control. It's saved me more than once. I personally love mis-using version control (see putting your home directory in SVN). I know you have claimed Novice status but perhaps you should look into setting up your own PEAR instance anyway. I set up my own PEAR repository on my server and use it to store my code "modules". PEAR has a lot of best practices (which are called that for a reason) but if you are lazy you certainly don't have to follow them just to get you code into your own personal repository. It makes it really easy to roll out changes although packaging can be a little tedious sometimes. You could probably use any package management system you want depending on your platform/language of choice.
Could chocolate be quiet and let me finish?
Major props to you for doing this. You're going to learn a lot about reuse from having your old code sitting around. I second putting it in Subversion.
This paragraph is about C++. Unfortunately, I don't know how to write it for your languages! Combine your code into libraries, and keep each library in a separate directory with its own Makefile. That way, you end up doing less Makefile hacking. To add one of your libraries, just copy the directory into your project, change the project's include path, and add the library file to the project's link step. It's much easier to do that for each library than to cut and paste code or cut or try to add one source file at a time. To learn all of these things, find a basic-to-intermediate tutorial for your compiler.
Rough translation for non-C++ languages: Store your code in such a way that it can be reused with a minimum of effort. Try to package your code at an appropriate granularity for reuse. If you reuse your code by cutting and pasting or by massive scripting, you've picked the wrong granularity.
Store documentation with each library. Ideally, you should be able to use the library without looking at the source code. If you can routinely reuse your own code by looking at the documentation instead of the source, you will be a pleasure for other programmers to work with.
Also consider keeping the third-party libraries you use in a similar repository. For a C++ programmer, that means Boost, XML libraries, etc. If the library is updated more often than you use it, store a small text file that says, "Foo library, good for bar, obtain from baz.org." You'll tend to use the same libraries over and over, which will make it easier to combine the modules you write into programs.
Practice all these things, then add a little theoretical CS and some management skills, and you'll be a better software developer than I was when I landed my first development job.
All in all good advice; I have some additional tips for PHP.
I think the number one issue for code re-use is avoiding name collisions. PHP doesn't support namespaces, so my approach has evolved to building classes, even for very procedural functionality. I have one library named after my (very unique) username that contains all the functionality that I find useful for my own projects. I usually repackage any functions I use from there in the case of outside projects that other people will be working on.
I also have to talk a little bit about PEAR. There are some really fantastic libraries there, but considering that it's supposed to be a peer-reviewed repository, it has a lot of crap too. Mostly in the form of stuff that's never made it out of beta, but also there are some libraries with untested functionality. Often this comes in the form of poorly conceived generalization of a problem. One of the things that makes an excellent programmer is the ability to decide how general a solution is ideal for a given situation. Always take third-party code with a grain of salt.
Finally, if you are serious about programming, take some time to learn the advanced features of other languages. PHP is an extremely utilitarian language, lots of built-in functionality, lots of free code available, but its a bit like a stone hammer--very crude. I would say almost every other language has more to offer in terms of expanding your programming mind: C, C++, Java, Perl, Ruby, Python, OCaml, etc. Understanding these languages will help you write better PHP. Also, don't be fooled by Javascript's seeming simplicity, it's actually a very powerful dynamic language with unique features worth studying.
I store it between two slices of bread with a little mutton and a touch of garlic and lemon...Mmmm... Makes the mouth water...
"Love is like pi - natural, irrational, and very important." (Lisa Hoffman)
I don't know if this method is still being taught but this is how I learned and it has affected every application I have written since. I think this is solid coding practice, any comments on it are greatly appreciated. This is a lot of work, and the pay-off is not only in the finished clarity of the application, but also returning to your code. Also, most of this work is done before you even reach for the keyboard.
Step 1 - Project Target
Write down everything you want your application to do in a short form list. This list is the very basic functions of your application, nothing toodetailed here. For an email client it would be as easy as get mail, send mail, read mail. Then take your list and sort it by listing the features you want the most at the top. Number these items.
Step 2 - Making Modules
Take your list and from the top take each item and make that a heading on a seperate page. Start listing again, but this time we are detailing these basic features. So for "Get Mail" for our email client example we would break that down into each "ingredient" to accomplish the task of getting mail. That would be: get user details, get server details, login to server, check mail, download mail, logout. So now we are getting into more detail. Letter these Items. So we have the basic features as numbers and the feature specifics as letters (maybe for an outline of features?). Note, if you are using an IDE like VS or Delphi you might also want to think about spliting your list up even more into the forms as well.
Step 3 - Algorithm/Psuedo-Code/Charting
This one is kinda optional for small classes, structs, etc. Anything large and I'd really consider it. Take each of your number.letter items and start a new page for each. Write out the algorithm or Psuedo-Code in basic words that are very easy to read. Another useful tool is the flowchart. Learn to make a flow chart because they can be invaluable in large projects.
Step 4 - Hand Written Code
Now take those basic descriptions of how to do the task and try to write them out in full language code. Don't use a computer, use a pencil. We now have some serious goal focus on our application, let's move to the dev tools.
Step 5 - Cohesion
This is where the time coding becomes a big player. Those of us who have been coding for a LONG time can pretty much whip up a GUI in no time at all. I often already know what my application will look like before I've even loaded my IDE.
Now it is just a matter of taking the hand-code you've already written and typing it in to the IDE, and Comment everything that you can. Also, range and error check where it is needed. I could write a whole spiel just on that but basically you should trap everything you can, even it "seems" redundant, trap it! You'll need to hack at the hand-code after entering it but eventually you'll learn how to recognize the needs of the dev tools and be able to minimize that impact in the first steps. Normally there is quite a bit of code editing once we move to the IDE but that is to be expected. The main thing is that with all the planning we have done we have total focus so the work of hacking code becomes easier.
This is a lot of work, and worth every second on large projects. Anything that takes more then a day or two to write could benefit from this method. I can't stress enough how easy it is to update a strongly organized code base. This method helps in that regard. This method comes from a time when most languages were not very "readable" so this made it easy.
Step 6 - Refactoring
Once you have your code running and working (as far as you can tell) it is time to look through and try to identify areas that could benefit from refactoring, or modularizing even further. If you find, like we all do, that you are performing the same task many times and you are using similar code to do each one then maybe create one function or procedure and then make
There are only 10 kinds of people in the world. Those that understand binary and those that don't.
...in compiled format.
-- Mesmer is the Dairy King Remove your panties to email me.
Yes and no. What you say is happening, but the converse has also happened to me: first I used specific functions from various libraries and then I re-implemented them
There's no general rule, as there are different modes of programming: rapid prototyping has different rules from production coding.
I have been programming since 1984, but the amount of reuse was limited by changing platforms (from 985 kHz to 1.7 GHz, from 2k RAM to 4 GB RAM, from virtually no OS support over Win32 (yuck) to POSIX/XOPEN APIs), languages (Assembler, Pascal, Modula-2, C, Scheme, VB, C++, Java, Perl/Python/PHP, ...), employers, and paradigms (imperative/OO/functional/...).
Even within a single language (like LISP or C++) you can develop in multiple styles, and these styles can be barriers to re-use. Aspects like error handling (return-code style vs. exception) or logging are also often barriers to re-use and lead to copy-paste-adapt in situations where re-use would have been possible in principle.
As a result, you have to make a fundamental choice: either you sacrifice your flexibility and maximize re-use. Then you pick one general-purpose language (e.g. Java or C++) and do everything there. Over a few decades you will have assembled richt libraries for nearly everything. But you will not have the optimal productivity, because you still need to write "public static void blabla..." where a Python 1-liner could get you there. The alternative is you learn as many languages as you need, and use the most appropriate language for each task. This way, you sacrifice some re-use (since you don't have all code in all languages), but you can maximize your productivity in a different way.
In practice, most developers use a mix of the two alternatives, since it is worth knowning a few languages really well (including libraries, debuggers, documentation tools etc.), and have a working knowledge of some others, with a readiness to pick up additional API or language knowledge on the fly.
I keep all my PHP functions in a single file called functions.php that I include in all my PHP pages that need something from it. I keep all my PHP classes in a file called classes.php that I can include in pages that need those. I _could_ create a single Utility class that would hold all the functions to keep all the stuff I need in the one classes.php file, but I am lazy.
I keep all my Javascript functions in a file called functions.js that I on all the pages that need those.
--- Nothing is secure.
Uhm, I think the best way is to use a thumbdrive or external hard drive to copy the code. Then you can carry the code with you all the time.
I personally have copy of all the stuff I work on, which I organize into a tree structure so I can always refer to it. If I need to, I either burn a DVD of all my code, or take my usb external hard disk.
Great. Now I'm older than "old people"...
Reprobates!
- Avron
I think the key to this discussion is a lesson in modularity and reduction. I think a good goal to establish reusability in code is to try to reduce your code down to the building blocks. This requires layers of complexity. The lowest layer provides functionality that can be used repeatedly and often by higher layers. You can take it a step further and separate this layer into a class, or a file, or even a library.
So if you find that you are duplicating code, try to pull it out into one place. Eventually you might be able to create a library and it will be easier to reuse for other project. Just my elementary two cents.
You can always bring it. Attitude adjustments are my specialty.
Steve's Computer Service, Hobbs, NM
Yes, there's only one place to put code, and that's under version control. Every useful bit of data needs backup and archiving, so that's irrelevant to a specific code topic. One more thing though... there's no better way to safeguard code than to make it open source and available to everyone who cares.
Actually, I like to go into the local library and rearrange books so that the little codes on the spine of each book represent my data...
I, personally use folders. I find that they help a lot.
I'm a signature virus. Please copy me to your signature so I can replicate.
Anytime I write code that does something even slightly tricky, I clean it up and throw it on a Wiki page on my server. That lets me access it from anywhere without having to dig through a bunch of cruft. It is amazing how much you forget, and how much more you can do when you have a ready example to get you over the hump.
Does it hurt to hear them lying? Was this the only world you had?
Port all your apps to VMS! Then every file save will have a version number. e.g. edit filename.txt file saved as filename.txt;1 edit filename.txt file saved as filename.txt;2 These revisions contain the whole file - not some undecipherable unix "diff" increment.
I'm looking over the wall; and the're looking at me!
Co-worker: Hey, remember that app you built for ____ a few months back? Can you add [certain funcationality] to it?
Me: Oh yeah, I have the source for that app on that machine over there.
Me: *points*
Co-worker: You mean that box that won't boot because the hard drive is dead?
Me: *Looks*, *realizes the doom of my situation*
Me: Oh crap...
(true story)
it's because it's a scene out of context. a scene that won't even be used (the lighting sucks)
it will be refilmed with effects and actors, rather than friends
it was just playing aorund with the camera, so i put it up as an illustration of an idea of what we were doing
intellectual property law is philosophically incoherent. it is your moral duty to ignore it or sabotage it
Me too, and I've never even thought of keeping my code for re-use, and I've never noticed it missing. That is, I've never thought to myself "don't I have some code somewhere which does that?". 90% of the code I've written has been application specific. When I need general purpose code, I get it from somewhere else, or, very rarely, just write it from scratch. As you say, because our skills keep improving, and also because programming languages keep changing, if I've written the code previously, then I'll still prefer to write it again. However, these days, the framework which comes with Java, C#, Visual C++, etc, is so vast that one should (almost) never have to write a general purpose class. As others have said, there's also the web for any concievable general purpose class.
The question puzzled me, because in 20 years of programming I've never considered the issue!
I'm a software visionary. I don't code.
With PHP and ASP, I usually use classes to encapsulate related functions.
For example, many sites have an administration section - an area where the site owner/maintainer can go and change some options or add some content or whatever. Instead of writing a new authorization mechanism every time I need it, I have a class that I wrote a couple years ago and tweak every so often that can literally be dropped into the existing site code and used with minimal customization. In the site's code, all I need to do is create a new instance of the class and call the Login() function within it when I need the user to log in or to verify the user is logged in. The class file itself uses a "lite" version of a database class I wrote for myself so that it is not dependent on the back-end database to operate - currently, it can work with MySQL, SQL Server, and XML or plaintext files containing name/password information.
So there's my secret. Code chunks that might be useful later are made to be independent (totally self-contained - no reliance on any outside variables or functions), with documented requirements (in my above example, *some* kind of name/password list has to be available), and placed into files based on their function or relation with each other. I keep these files small, to avoid putting extra strain on the server.
In the case of Javascript, the same rules apply. Remember, though, that Javascript is downloaded to the client machine, so it is very important to keep your ".js" files as small as possible. I keep a few task-specific collections of functions in ".js" files, but when I need a function for a site, I usually just copy/paste the function into a new ".js" file specifically for that site.
Dammit, I meant to post that anonymously!
Agreed. But that doesn't mean that there aren't a lot of really good coders and ops folks who post comments. I'd like to think (though I could be wrong) that the other topics make it on the site because of the coders, not in spite of them. Although I'm a professional developer, all the things you list fall into my interest areas.
Which was why I asked a lot of questions of a lot of people with a lot of experience.
So I'm curious - when you bothered these people, did you have a project you were working on, or did you just to it for your own personal edification? My feeling is that if you're doing it just for fun then you should go pay for your information. I value other people's time because I value my own, so if I feel like I'll eventually be able to use that information to contribute something back then I don't mind asking someone for their time.
if you're expereinced enough to ask sophisticated questions, you ought to be smart/resourceful enough to figure it out yourself.
Well, I'd disagree. There are lots of times when you just need more information no matter how smart you are. For what it's worth, when I find a jewel in a post then I'll send the author a comment thanking them for their efforts. It's often just a single piece of missing information that can make or break a project.
Learning by extraction out of context is a great way to learn about more than strictly the answer to a stated question. In my experience, answering the simple fundamental questions (and answering them well) is the true hallmark of really understanding a subject. So even if you get a bad question, you should award yourself brownie points if you still manage to be informative and helpful with an (good) answer.
Hmm, not sure how I feel about this comment. So are you saying that any answer, as long as it's accurate, is useful? If that's the case then I'd strongly disagree. If I ask about data storage and you give me a long diatribe about databases, it's useless if I had really been interested in the best/fastest/cheapest disk drives.
If you don't want crime to pay, let the government run it.
We have our code etched in marble slabs by a bunch of low-paid college interns. We feel that this is the best method as it requres no power, is very robust, and allows for cheap restorations. (We have the same interns type it back in.)
It's good to use your head, but not as a battering ram.
When I first started programming, I did find myself reinventing the wheel a whole lot. Using pre-written libraries wasn't my style, either, since I wanted to actually learn something. So, what I end up doing often when I learn a new language is writing a little library that contains functions or classes or code snippets that I find myself re-writing again and again. When I learned Python, I wrote an extensive framework for doing the kinds of things that I do in Python. When I learned Ocaml, I did the same. SVN and CVS are great for keeping track of individual projects and they can be great for keeping track of your API as you write it, too, but for most programmers I know they are ill-suited for stashing code snippets away.
What you really need is to be organized in a way that works for you, and either have little mini-APIs, or have collections of code snippets that you use often, and rock it. The advantage of APIs is that you can have a set of headers (in C) or interface files or the equivalent in whatever language, and you can import them from programs you're writing. With a directory full of code snippets the pressure to stay organized amid the dozens--and then hundreds--of little tiny files becomes greater and greater. For example, you might want to keep one file with only list-related functions in it, and another that has some helpful array-related functions in it. For little things like this, sometimes it's not worth it to actually go through the whole procedure of writing a high-quality API. Sometimes all you need is a little something that you can copy and paste in where you need it. Of course, you could work some combination of the two.
The bottom line is that code isn't like produce; you don't have to store it in a cool, dry place. You just have to make sure you can find what you're looking for later on.
Yup. Humor. I'm a very happy 33 YO! http://www.myspace.com/benfun
Best of luck,
I have no problem with your religion until you decide it's reason to deprive others of the truth.
...to store code snippets, example code, and documentation.
fsfs is now the default repository format. It is considered to be ready for prime time. You can safely switch.
"Avoid employing unlucky people - throw half of the pile of CVs in the bin without reading them." -- David Brent
As of version 1.2 it's the default, and bsd-db is deprecated.
So to keep the programmers and computer folks happy, we should set the bar higher for the quality of discussion on those topics and everything else ought to be chump change? Thankfully, "news for nerds, stuff that matters" means something more cosmopolitan to the general crop of slashdot editors. I'm not always pleased with some submissions which don't hold my interest, but I'm grateful that the broad lattitude displayed by Taco and the gang gives me a chance to broaden my horizons. In a large community like slashdot, I think it is rather arrogant to expect every experience to be tailored to any individual's fancy. Also, you're really missing my point by claiming interest rather than expertise in broad areas I mentioned. If you will recall, the context of this discussion is some clueless guy curious about very basic issues. Would you feel the same way if the guy in question was asking about protein synthesis or DNA sequencing? How much bio-technology training have you had? A RTFM wouldn't be out of order, as such topics are easily found in any modern textbook of general biology. But biotechnology is a dynamic field with widely deployed and very influential technologies that are not well understood by a general public which uses them. Does that mean the general public is better served by not being curious or asking questions? And if one is interested, you would expect one to matriculate at the local community college and take a few semsters to cover the materials one didn't get in high school biology? Ultimately, I think the important thing is to foster an environment where not only access, but interest in casual knowledge is encouraged. And you're not going to get that if newbie inquiries are always snubbed.
So I'm curious - when you bothered these people, did you have a project you were working on, or did you just to it for your own personal edification? My feeling is that if you're doing it just for fun then you should go pay for your information. I value other people's time because I value my own, so if I feel like I'll eventually be able to use that information to contribute something back then I don't mind asking someone for their time.
I never got the impression that I was bothering anyone. Most of my mentors through the years have been very enthusiastic about sharing things they are themselves very excited about. To be fair, I've encountered a few who feel the same way you do. Those tend to be very serious about their work and treat their professional expertise primarily as a critical source of livelihood rather than a cherished career. To bring the discussion back to the subject at hand, is anyone paying you to take time and effort to participate on slashdot? What compels you to reply to these posts besides your own free will? Why do you feel obligated to police the level of discussion here? I still don't understand why it is so hard to just ignore the stuff that doesn't interest you.
Well, I'd disagree. There are lots of times when you just need more information no matter how smart you are. For what it's worth, when I find a jewel in a post then I'll send the author a comment thanking them for their efforts. It's often just a single piece of missing information that can make or break a project.
Now imagine if instead of helpful comments, some wise guru replied to you with the sentiment that you simply haven't done *enough* brain-racking and you're wasting their time with your pleas for help. (Hmm, I wonder who would be so rude?!) It's not so comfy when *you're* the one needing "just a single piece of missing information that can make or break a project", is it? :-)
So are you saying that any an
Stay sentient. Don't drink bad milk.
Does that mean the general public is better served by not being curious or asking questions?
Nope
And if one is interested, you would expect one to matriculate at the local community college and take a few semsters to cover the materials one didn't get in high school biology?
Possibly. If you're really interested in a subject and you're not willing to seek out the answers on your own then you should train with someone who will spend the time to teach you properly. For all we know, this guy's going to get a bunch of crap answers by posting on Slashdot, so wouldn't he be better served by leaving the teaching to professionals?
So to keep the programmers and computer folks happy, we should set the bar higher for the quality of discussion on those topics and everything else ought to be chump change?
Yes. This might seem like a snap response, but Slashdot wouldn't be what it is without the developer community. If there isn't enough to keep them interested, they'll all just leave. And then what do you have? (Ok, I'll admit, some people might like it better this way. :-)
Would you feel the same way if the guy in question was asking about protein synthesis or DNA sequencing? How much bio-technology training have you had?
Do you really think that this is a topic that would best be answered on Slashdot?
To bring the discussion back to the subject at hand, is anyone paying you to take time and effort to participate on slashdot? What compels you to reply to these posts besides your own free will? Why do you feel obligated to police the level of discussion here? I still don't understand why it is so hard to just ignore the stuff that doesn't interest you.
I've already said that Ask Slashdot could offer so much more, but I really feel like people have given up on it. Look at the number of posts on any average Ask Slashdot and compare that to other categories. The responses are often pretty pathetic. Personally, my hope is that the editors read the comments and take action to get better questions. I know that after they got flamed for dupes that they started referencing previous articles where possible. It hasn't fixed the problem completely, but dupes are down.
Now imagine if instead of helpful comments, some wise guru replied to you with the sentiment that you simply haven't done *enough* brain-racking and you're wasting their time with your pleas for help. (Hmm, I wonder who would be so rude?!) It's not so comfy when *you're* the one needing "just a single piece of missing information that can make or break a project", is it? :-)
So let's just say that this happened with my Asterisk server. I'd just brush the guy off as a jerk and read the good responses. If 80% of the comments where of the RTFM flavor then I'd go back to find better sources because obviously I'd have missed something.
Ultimately, I think the important thing is to foster an environment where not only access, but interest in casual knowledge is encouraged. And you're not going to get that if newbie inquiries are always snubbed.
I don't think casual knowledge is discouraged. I've learned lots about all kinds of topics by reading other's posts.
If you don't want crime to pay, let the government run it.
While it was originally designed as a way to import wxWidgets code into your project I have found that the wxCRP project can be very useful for storing snippets of code for reuse. It is language independant and easy to use. It also has the nice feature of avoiding most copy/paste problems by having variables that get auto filled in by scripts that respond to questions. This may be more what you were looking for in your original question than a repository although all code should be stored and revisioned with history.
http://www.xs4all.nl/~jorgb/wxcrp/
I find it amusing that you actually bothered to answer my rhetorical questions. What I find most ironic is that you take this thing all so seriously. Slashdot has never been and never will be a place where hardcore IT professionals come to do serious "work" and I do mean work in the non-lesure sense. For that you go to sourceforge.net or even freshmeat.net. Honestly, how focused can you get at the place where "Beowolf cluster", "BSD is dead", and "Natalie Portman - naked & petrified - covered in hot grit" jokes got started? When you read these comments, for example, how many include professional contact information as their signeature instead of jokes and puns of varying quality? Yes, the guy who wanted to know about reusing code will get a great deal of off-topic useless crap answers (of which your's is one of, unfortunately ^_^), but I don't think anyone in their right mind would be naive enough to take EVERYTHING they read on slashdot seriously. I can't speak for Asmor the original submitter of this ask slashdot post, but he stricks me as a casual coder, a hobbyist. And hobbies are not the sort of thing done in a classroom where you pay someone to teach you stuff against a clock with the promise of exams at the end. Considering he is at the beginning of the game, he probably isn't looking for a complicated answer from a professional anyway. I think he came to slashdot because he *wants* casual answers to his casual question.
I'd like to try again and defend the appropriateness of Slashdot taking a more general inclusive attitude rather than going in a direction that caters to more seasoned professionals.
No one in the developer community was born a master coder. There is no reason why slashdot should not be a place where novices/hobbyists come to get a clue and seek advice. Even if you're going to alienate the beginner/hobbyists to cater only to experienced professionals with more technical stuff, slashdot will die a swift and spactacular death as it becomes unbarably BORING to the majority of current readers. The landscape of IT is vast and varied. Most people can claim only a very small domain within this realm. I may have a little background in embedded programing, but I'd be completely lost with a topic in, say, database design, or GUI implementation. Likewise, I'll bet there are plenty of topics which would be proper and technical, but wouldn't hold one bit of your interest. How would anyone (let alone the /. editors) decide which crowd get the attention here? (Don't answer that!) People would leave because the technical discussion fall outside of their own specialty. This place will no longer be the fun place where folks just casually hang out. As it currently operates, there is a streak of playfulness and cultural enthusiasm blended into ocasionally profound discussions of copyright restriction and software user's rights with a mish-mash of pure science and other current events thrown in. It's LIVELY and fun as well as enlightning and thought provoking. It reminds us that there is more to geekhood than code, that we are a part of the world. The bottom line is that slashdot does *not* exist as a developer community.
In that vein, I think it is absolutely proper for questions about DNA sequencing and protein synthesis to be asked here on slashdot. A great deal of IT professionals seem to forget that the computer and software which runs on them are tools - tools which are means to an end. Modern biology is one of the biggest benificiaries of the information revolution. Modeling/visualization software has provided powerful ways to actually DO molecular biology. You'd be suprised how even first year biology students are making use of a wide variety of programs in their classes. Ever wondered what the protein's you've heard about your entire l
Stay sentient. Don't drink bad milk.
You say the responses are often pretty pathetic - have you ever made any effort to raise the level of the discussion by posting useful reponses yourself?
Absolutely. I do it not only on Ask Slashdot but elsewhere on the site. I've gotten my karma through many +5 insightful/informative posts. As I mentioned in my orginal post, I often push back on people who I think are too harsh on Ask Slashdotters. It's just in this case the question was a "motherhood and apple pie" kind of question without any real context. Personally, I fault the editors for even posting the question.
I'm surprised that you don't think that people don't get real work done reading Slashdot. I often get useful leads that I follow up on. For example, a few weeks ago I was complaining about how NFS shares would always hang on me. Someone replied with a suggestion on how to mount them so they don't hang. I spent numerous hours scouring the web for this information, so in this case a single Slashdot post was super helpful.
I guess at the end of the day the editors will choose who it is that they want to frequent the site. I totally agree that software is not written as an end unto itself. But I disagree with your notion that that means the developers and operations folks don't want or need a place to hang out. If that wasn't the intention of Slashdot then why are all the ads geared at the computer professional. Book reviews, banner ads, and sidebar ads are all targeted at guys like me. I never see ads for telescopes or chemistry sets or books on DNA sequencing. That's not to say that there shouldn't be, but the day that I think that Slashdot isn't going to meet at least some of my professional needs is the day that I find someplace else to hang out. Sadly, the quality of articles lately (not just this one but many others throughout the site) has been lacking. I haven't yet decided if this is a problem with this site or if the industry is just going through a slow phase.
If you don't want crime to pay, let the government run it.
Then you are one step closer to earning my respect. :-)
Absolutely. I do it not only on Ask Slashdot but elsewhere on the site.
Well, kudos to you. It takes a better man to practice what he preaches. However, you don't get to keep that hard earned respect by then complaining about the folks you *don't* want to help. Again, one participates in a forum like slashdot of ones own free will. No one compells you to pay any attention to the things that don't interest you.
It's just in this case the question was a "motherhood and apple pie" kind of question without any real context. Personally, I fault the editors for even posting the question.
Sometimes it takes that kind of a question to flush out the real meat of the matter. I agree with you that the question may have been ill-concieved. But doesn't it strike you as odd that not only did the editor thought this inquiry worthy of posting, but that a significant fraction of the responses made similar recomendations? Appearantly, both the editor and many posters had no trouble percieving the context of the question and suggested something along the line of CVS, SVN, or Subversion as the most suitable solutions to the problem. Others have chosen to comment on aspects of the question itself. Still more have posted common sense answer that are no less insightful. The fact that over 400 comments were made to this question and a great many of them found some way to be useful speaks volumes about the decision of the editors to post it.
I'm surprised that you don't think that people don't get real work done reading Slashdot.
I apologize if I've expressed myself badly. What I meant was that one does not (should not) treat slashdot as a service with any kind of implied quality control or standards of exellence which would be expected of something similar to a technical consultant. By virtue of the crowd this website attracts, the level of experience is very high. But one should not expect that slashdot has an obligation or responsibility to satisfy one's curiosity, technical needs, or expectations and then complain when it doesn't happen.
I'm sorry if you thought I believed guys like you shouldn't hang out here. I should have said slashdot does not exist *exclusively* as a developer's community. I simply meant there ought to be room enough for others as well, from newbies like Asmar to hardware guys like me. I sincerely hope you don't believe the kinds of people who want to sell you things are a good metric for who you are. We don't necesarily enjoy the attention of the advertisers, but that doesn't mean our vision for slashdot and desire for what it might be ought to play second fiddle to the experienced coders. If you're successful in keeping the other folks out, pretty soon you wont have anything to write programs about.
By the way, I'm genuinely curious where you learned about CVS/Subversion-type tools in school. I've taken my share of programing classes including a 3 semester sequence in C/C++ without any mention of such things. All that was more than 5 years ago, but still, has things changed that much? Thanks in advance.
Stay sentient. Don't drink bad milk.
Ok, but half of those 400 posts are you and me, so what does that say? ;-)
I don't think posts on CVS or Subversion are what this guy was looking for, unless I totally misunderstood his question. The initial question was more along the lines of code structuring. I just re-read the question, and while he briefly mentions code storage, the question is clearly much more about partitioning. The fact that we can't even agree on the question is somewhat troubling to me.
By the way, I'm genuinely curious where you learned about CVS/Subversion-type tools in school.
Back in the mid 80s, there was no such thing as source control, at least not for the masses. In fact, virtually all the tools that we take for granted today were not around. Most of my training came from watching what others were doing and then trying to figure out how that fit into my little world view. So to answer your question directly, I picked up source control in the mid 90s while working at a large Fortune 500 company that is often disrespected by those who frequent this site.
However, you don't get to keep that hard earned respect by then complaining about the folks you *don't* want to help.
A few years back I left my high-paying job to take a one-year teaching position at a local university (at 1/3 of the pay). I did this not only to satisfy my curiosity, but I also wanted to give something back in recognition of all the effort that other people had put in to help me get where I was. I taught computer science. I had lots of electrical engineering students in my classes because their department required them to take an entry level programming class. Funny thing was that somehow many of these folks thought that I should take it easy on them because they weren't really a part of my world. Sadly for them, they had me as their teacher. I road their asses just as hard as I did my CS majors. In the end, I believe that they are much better off for the experience because my courses were designed as much to instill work ethic as they were to teach specific subject matter. I also wouldn't have felt good about taking someone's money and then not giving them a challenge. If people go to college to eventually use that knowledge to get a better job, I'm going to do everything in my power to make sure that they get what they need.
If you're successful in keeping the other folks out, pretty soon you wont have anything to write programs about.
Some level of exclusivity is good. In fact, that's why there's a moderation system. I keeps the level of noise down to a minimum for n00bs. I browse at 0 and sometimes even at -1 because I want a more raw, unfiltered view of the world, even if it means that I see the occasional GNAA post.
We don't necesarily enjoy the attention of the advertisers, but that doesn't mean our vision for slashdot and desire for what it might be ought to play second fiddle to the experienced coders.
"Second fiddle" is a just a state of mind. If you really feel this way then your problem isn't a lack of knowledge, it's a lack of self-respect. If I'm in a room of doctors and they're talking shop, I don't feel any like I'm any less of a person. Sure, they can cut out a bad appendix, but can they find a race condition in a multi-threaded app? Personally, I like being anywhere where there are smart people because I listen to what they're saying and then use what I've learned to expand my knowledge base.
If you don't want crime to pay, let the government run it.
It says to me that half of that half are posts by those whom you would consider jerks.
I don't think posts on CVS or Subversion are what this guy was looking for...
Perhaps you should let Asmor decide from among the (useful) 400 comments what he is looking for. As there are often no single correct answer, there are often no single correct interpertation of a question. A broad multi-faceted question such as this can have several appropriate answers depending on the level of skill a coder has and the complexity of his/her project/assignment. For me, the key idea in his inquiry is the last sentence: "How do you store and maintain your most frequently used code?" smart code structuring, libraries, and CVS can all be appropriate solutions under appropriate circumstances. I think the part that is irritating you is that Asmor doesn't have enough programming experience to recognize the difference among his options much less how to use them wisely. In that respect, I think all these comments, varied as they are, are useful and gives him exposure to some ideas which he never would have encountered had he not bothered to ask his question.
A few years back I left my high-paying job to take a one-year teaching position at a local university (at 1/3 of the pay).
That still doesn't change the fact that you've not only refused to help Asmor, you've gone to great lengths to criticize the manner he is asking for help. It seems to me you're reacting to this poor guy as if he is one of your students. If he was paying tuition and making use of your time, I think it would be a totally apropriate response on your part. But this is slashdot, where people profess and BS for free in equal measure. If you must insist, however, couldn't you maybe (just maybe) pretend that the guy doesn't have the prereqs to take your class just yet? That wouldn't be his fault, would it?
So to answer your question directly, I picked up source control in the mid 90s while working at a large Fortune 500 company.....
Considering you learned it by exposure in the workplace, isn't it a bit hypocritical to suggest that Asmor go to school? Okay, let me apologize for that and back off a moment. Assuming you do teach this topic at your university teaching position, how would this topic be presented? If I was one of your students, how far from the beginning would you present this idea and in what context? Let's say we wish to properly study this topic. Can you recomend textbooks for Asmor (and me)?
Some level of exclusivity is good. In fact, that's why there's a moderation system.
Pitty you didn't have mod points to deal with the likes of Asmor, huh? :-P Hey, maybe there really *should* be mod points for stories as well as comments. That'll really keep the editors on their toes, knowing their efforts are moded as well. Heehee...
"Second fiddle" is a just a state of mind. If you really feel this way then your problem isn't a lack of knowledge, it's a lack of self-respect.
What I said had nothing to do with self-perception or self-respect. It's about public respect and social etiquette. To use your analogy, we're in a room. Even if doctors are the only ones you want to talk to, they are not the only occupants. Those who don't participate in your discussions are not obligated to because the facility is just as much theirs as it is yours. Keeping your own crowd exclusive is fine if you don't want to hang with the others. However, you don't get to be rude by using louder voices or hogging the refreshment stand just because you feel more entitled to the use of the room. So please have some respect for the doctors, too. Kindly explain to them how you found that race condition in their diagnostic imaging software in terms they can understand and I'm sure they'll be grateful enough to answer any health concerns you may have in terms you will understand.
Stay sentient. Don't drink bad milk.
Boy, you really do lack self respect. Never once did I even imply that I thought anyone was a jerk, nor would I make such a statement. All I've said is that I didn't think the post was appropriate.
It's about public respect and social etiquette...
You can't be serious. On Slashdot? :-)
Seriously, we have a problem in our society of people being offended far too easily. Somehow we've gotten to the point where people assume that disagreement means disrespect. You've gotta get over the fact that just because I don't like your idea doesn't mean that I don't like you as a person. For the purpose of this discussion, you seem like an intelligent guy with well reasoned opinions. I just think that you're wrong.
Having said that, I'd like you to point to a single example of any of my posts (either this thread or others) in which I've been disrespectful. I doubt that you'll find any, unless you somehow think that "RTFM" is disrespectful.
For the record, I don't think that I'm being overly sensitive here. You seemed to make the logical progression from being elite to being disrespectful and lacking etiquette. If I am being reactive then just tell me to FOAD. I promise that I won't take it personally. :-)
Those who don't participate in your discussions are not obligated to because the facility is just as much theirs as it is yours.
I've conceeded the point in an earlier post that Slashdot is as much yours as mine, so I have no idea what you're fishing for here. I think that you want me to say that I was wrong in criticizing Asmor's post. I'm just not sure that you've made your case that I was unfair in my comments.
I get the feeling that I've become a proxy for every rude and inconsiderate comment that you've ever seen on Slashdot. I think that you need to learn the distinction between comments that are made for the betterment of the community and those intended to make the poster look better at the expense of another. I've been trying real hard to find any comment that I've made that would fit the second category and have yet to find any.
If you don't want crime to pay, let the government run it.
you didin't ? In response to a hypothetical asterik guru who snubs you - "...I'd just brush the guy off as a jerk and read the good responses."
You can't be serious. On Slashdot? :-) .....
I don't particularly percieve (or care) that you don't like me, nor am I personally offended by anything you've said thus far. Like you, I am simply trying to argue a point; mine being - restricting entry level inquiries of the type submited by guys like asmor is not in the best interest of slashdot and the community spirit which slashdot represents.
I don't think an RTFM response in and of itself is disrespectful, but your assumption that someone ought to do so because they're being lazy *is*. Without knowing someone's motivation for asking a question, you imediately had him pegged as someone who's trying to get others to do his homework. Remember, I responded to your original comment by remarking that for someone who is none the wiser, even rudamentary concepts can be hard to grasp. How can you investigate the answer when you don't even understand enough to formulate the question? And when you can't formulate the first question, where do you begin? These are the kind of problems best solved by mentoring, which is what I believe asmor has a right to be seeking.
For the record, I must confess that I *am* probably being sensitive, but I believe righteously so. At some point in the past, we've all been where asmor is right now. No one should forget how hard it is to first start out on something. RTFM, however blunt, may be a proper response to such a person. However, no one, no matter how experienced or brilliant, should have the right to tell an ernest beginner he/she is wrong to ask questions to begin with.
I've conceeded the point in an earlier post that Slashdot is as much yours as mine....
Yet you complain about the fact that newbie questions like asmor's which do not sufficiently engage experienced IT profesionals (who know better) do not deserve a place on slashdot. Do you think that's fair? I find it very telling you consistantly ignore the option of simply not responding to the likes of asmor. It appears to me this entire conversation is built upon a very active and persistant objection on your part to the participation of asmor as a novice coder in the slashdot community in the interest of making it more worthwhile for the more experienced programmers.
I get the feeling that I've become a proxy for every rude and inconsiderate comment that you've ever seen on Slashdot. I think that you need to learn the distinction between comments that are made for the betterment of the community....
No, not really. Just the condescending ones. :-) Some of the more disparaging remarks here on slashdot are quit funny in the style and manner of the put-down. In regards to your remarks, I'm just a little alarmed at the seriousness of your attitude, that you genuinely believe squelching curiosity and questioning of the more basic variety is actually good for a community which thrives on knowledge and creativity.
hmm... Asmor is a guy just getting to know the ropes. You know this stuff well enough to teach it at the university level. You tell him his questions are ill-formulated and that he himself is lazy. Then you suggest he place himself under the wings of a trained academic, of the type you belong to. Need I say more?
Stay sentient. Don't drink bad milk.
Sorry for not clarifying. I was talking about you or Asmor or Slashdot editors or anyone else who we've directly engaged in the discussion. Sure, I think that people who clearly flame someone for no good reason are jerks. Can we at least agree on that point?
I find it very telling you consistantly ignore the option of simply not responding to the likes of asmor.
Actually, I did. I said that Ask Slashdot has been flooded with these types of questions and that it was driving away experienced folks, thereby making Ask Slashdot less useful for people like me. You might not like the reason that I gave, but I did give a reason. And ignoring Asmor's post just makes matters worse.
Then you suggest he place himself under the wings of a trained academic, of the type you belong to.
I'm definitely not in the category of "trained academic". I couldn't convince myself that spending $100K to get a PhD in a field that I know a lot about to take a job that paid 1/3 of the industry was worth the time, effort, or money. :-) My appointment for was for one year and was subsequently filled by a candidate with all of the qualifications.
I don't particularly percieve (or care) that you don't like me...
This is a curious comment, especially since I just said that you "seem like an intelligent guy with well reasoned opinions". Do I need to end all my posts with XXOO?
I'm just a little alarmed at the seriousness of your attitude, that you genuinely believe squelching curiosity and questioning of the more basic variety is actually good for a community which thrives on knowledge and creativity.
"A community which thrives on knowledge and creativity" is a matter of definition. You see it broad, I see it narrow. Why is it alarming that I should want to be a part of a community that's geared toward more advanced users? Should I expect that every community to which I belong *must* deal with n00bs whether it wants to or not? Should I keep my subscription to Linux Journal if all the articles are on bash scripts and Linux installers?
but your assumption that someone ought to do so because they're being lazy *is*
My exact quote was "I don't want to judge this guy too quickly, but virtually the entire question reads as though he's lazy." Meaning that I read the post in its entirety and came to the conclusion that he wasn't making an effort based on his own words. It's a judgement call, which is far different than an assumption.
No one should forget how hard it is to first start out on something.
When I was a kid, I was really interested in the space program. At that time, information was virtually impossible to find. These days, information abounds, and starting about four years ago I decided to become as well-versed in the topic as I could be. I read book after book, scoured the Internet for tidbits, and bought videos of engineering tests. I've become something of an expert on the topic of the space program through the Apollo years (a friend who works for Boeing on their rocket program was quite impressed with my knowledge and library), and yet not once did I take the time of any expert to satisfy my curiosity, even after spending days researching quindar tones. I guess my point here (somewhat long-winded) is that I find myself being a n00b almost every day, and yet I find virtually everything I need with the resources that are readily available through Google and the public library.
If you don't want crime to pay, let the government run it.
I'm sorry for the confusion. I took you to mean the guy is a jerk for being in a position to help but choosing to taunt you instead. That was my intended illustration anyway.
thereby making Ask Slashdot less useful for people like me.
For what it's worth, I think I understand you enough now to feel *your* frustration. Please understand that it seem initially like you blame asmor for your problems, as in: "The less experienced coders are taking your slashdot away from you. BAD NEWBIES!!" And that just seems selfish and arrogant. I don't know if it is any comfort to you that your "sacrifice" has made things more interesting for those of us who truly do find more basic information useful. If you truly support equal participation for all slashdot users, your patience may eventually see some of us becoming experienced enough to entertain you on your terms.
Do I need to end all my posts with XXOO?
Not at all. Like I said, I don't care if you personally like me or not. I'm more interested in the perceptive insights and interesting ideas you can offer to challange my own world view and further my own enlightenment. I hope the sentiment is mutual.
Why is it alarming that I should want to be a part of a community that's geared toward more advanced users?
Because you expect slashdot to be that community. /*grin*/ slashdot for crying out loud! Okay, on second thought, maybe that isn't so much alarming as...er...funny. For what it's worth, Bruce Perens of Debian fame became disillusioned with slashdot a long time ago. In response to the lousy signal to noise ratio at slashdot, he established http://technocrat.net/ as "a more mature forum than Slashdot". You might be much happier there. I'm guessing it is more likely they don't "deal with n00bs".
It's a judgement call, which is far different than an assumption.
I don't know if it will be of any use to pursue this particular tact. It's splitting hairs. Judgement call, assumption - what *is* the difference? Basically, I thought you called him lazy and I felt it was unjustified.
When I was a kid, I was really interested in the space program....
This is the second time you've involked the idea of of "if it is good enough for me it ought to be good enough for others". Which, I guess, is a reasonable perspective. But read that a certain way and it becomes a variation of "my way is the only good way - for everyone". Just because you happened not to have asked for help in pursuing something doesn't mean it is wrong for others to seek help. It is a matter of choice. You may pass judgement on the choice others make, but how and why would you expect that personal opinion of yours to be of any significance? If you're trying to inspire someone to be more self-sufficient, it would be far more productive to actually suggest some resources. you know? "teach a man how to fish.." and all that. Don't just brag about how good you are and taunt someone else for being a bad fisherman (for whatever reason).
Stay sentient. Don't drink bad milk.
I don't know if it will be of any use to pursue this particular tact. It's splitting hairs. Judgement call, assumption - what *is* the difference? Basically, I thought you called him lazy and I felt it was unjustified.
We all come to the party with preconceived notions. I'm the kind of guy that *assumes* that people are intelligent and hard working because that's the kind of people that I grew up around. In order to get me to think that you're lazy or stupid, you have to prove it. That's when I make a *judgement* call. Interestingly, most people work the other way around. They start out on the assumption that you're lazy and stupid and that you have to prove to them that you're smart. Personally, I think that this is an ego driven mentality, since you're effectively asking people to measure up to your own standards.
Because you expect slashdot to be that community. /*grin*/ slashdot for crying out loud! Okay, on second thought, maybe that isn't so much alarming as...er...funny.
I find it sad that you don't want or expect more from the Slashdot community. I agree that there's a lot of crap here, but let me try giving you an analogy. Right now, there's tons of corruption and stupidity in Washington, DC. Does that mean that you don't want politicians to clean up their act? Do you think that Washington reflects how most Americans feel about their country? What's wrong with wanting a better community?
you know? "teach a man how to fish.." and all that. Don't just brag about how good you are and taunt someone else for being a bad fisherman (for whatever reason).
As I said in my original post, Asmor provided virtually no context in which to have any reasonable discussion. Read his post again. He talks about code reuse, storage, and programming languages. Perhaps you're right that he didn't have enough information in which to frame the discussion, but then I'd say that he shouldn't be throwing around such big terms. Why didn't he say something like "I've got two games written in Perl and I'm reusing some of the code. How do you suggest that I avoid duplicating functions?" Without any such detail, I can only put him into the category of "general knowledge seeker". From our discussions here I'd say that you probably think that this is a good thing in all circumstances, but frankly I don't. If you want general knowledge, buy a book. If you have specific questions then ask them on Slashdot.
BTW: I totally disagree with your characterization of my comments as "taunting", although you're free to have your own opinion. Perhaps you should read them again carefully without introducing any bias. I think that you'll find that my criticism was quite passive. I use words such as "seems like" and "I feel". To me, taunting someone would follow along the lines of "What kind of asshole would post such a stupid question? Perhaps this dipwad should get a life and stop bothering smart people like me with their pissant posts".
I'm more interested in the perceptive insights and interesting ideas you can offer to challange my own world view and further my own enlightenment. I hope the sentiment is mutual.
Absolutely.
If you don't want crime to pay, let the government run it.
Not a problem. I was going to be a bit disappointed that the most interesting conversation I've had since I can remember has come to an end. :-) Before I respond in more detail however, I'd like to juxtapose two of your comments:
We all come to the party with preconceived notions.....
and
Do you sense a certain imbalance of standards here? From just the few sentences asmor wrote, you've made a "judgement" that he is lazy. How in the world did asmor manage to *prove* he is lazy? On the other hand, you're asking me to leave behind any bias I may have from just the few lines *you* wrote. I really don't know how to do that. At the very least I'd have some questions about why you feel justified in saying what you've said. I believe I've already explained the reason I'm defending asmor, but let me state it again: It is daunting to start at the beginning. When you haven't seen much to begin with, you *don't* have a context to place everything. So all the questions you may have, even all the information at your disposal means that much less because you don't have much of a foundation to anchor any of it. In that regard, asmor's inappropriate use of big terms is understandable. The way I see it, asmor is asking for a lifeline in a choppy, noisy sea of information. I believe he has every right to do that, because for him, I really don't see any alternative if he's lost and confused.
Nothing. But a better community for who? We've been here before. Besides, it's rather ineffectual if you offer only criticism without practical solutions. You want Washington to clean up it's act? So do I. But those guys were voted into office - how do you suppose that happened? We can both agree that as is, it's screwed up. But do you (or I) really know enough to fix the system? How would you balance state's rights with federal authority? How do you reign in or punish the fat cats without hurting the masses of regular folks who work for them? Even in our own immediate context, the situation is hardly black and white. So you don't like asmor asking for help. Well, why could't you tell him where else to go if not slashdot? Given the chance to offer him other resources to address his problems, you chose to tell him to go to school. Is that really any more practical or effective than say asking the politicians to wise up and be more honest? Niether measure can definitively solve the immediate problem at hand. I admire you for your high ideals, but don't care much for your lack of practical common sense. In fact, I originally percieve that you intentionally suggested such an involved and high commitment solution to his rather innocuous question just to spite him. As in, "lazy bastard! get off your ass and get busy!" That's why I thought you were taunting him.
I strongly disagree with that conclusion. For the forseeable future at least, book are not going to respond to questions or offer feedback. However, that sort of thing is what communities like slashdot does best. With the enormous numbers of eyeballs and experiences available, general open-ended questions can be addressed from a multitude of perspectives. And the discussion can respond to the nature of the inquiry by going in whatever direction is desired. Even ill-formed questions like asmor's has a chance to be interpreted in multiple ways, one of which (hopefully) would end up being useful to the asker. In contrast, specific questions most often have specific answers which are best looked up in reference volumes. The only good use for a community in such a case is if one of those extra eyeballs happened to be familiar with the
Stay sentient. Don't drink bad milk.
Ok, either I'm really good or you need to get out more. Probably the latter. :-)
Do you sense a certain imbalance of standards here?
Not really. I don't see bring any problem with bringing a positive worldview into the picture, but I do see a problem with bringing a negative one. I guess what I'm saying is that if you can't be positive, at least be neutral.
On the other hand, you're asking me to leave behind any bias I may have from just the few lines *you* wrote. I really don't know how to do that.
This confirms my suspicion that I'm a proxy for others, at least in part.
At the very least I'd have some questions about why you feel justified in saying what you've said.
Did you read my first post? Carefully? I don't think that I could have spelled it out any better. But this is where bias comes into play. Either you didn't take the time to read the post because I pushed a "hot button" for you, or you chose to focus in on the perceived negatives and ignore the rest of the post. I challenge you to reread the post, looking at it from a positive prespective for both the community and the individual. I think that you'll find a lot of great stuff in there.
I admire you for your high ideals, but don't care much for your lack of practical common sense. In fact, I originally percieve that you intentionally suggested such an involved and high commitment solution to his rather innocuous question just to spite him. As in, "lazy bastard! get off your ass and get busy!" That's why I thought you were taunting him.
XXOO :-)
Seriously, I will agree that I was pushing him for something better. If you want to read that as "get off your ass" then so be it. Nothing wrong with that. If he wants to waste community bandwidth, for whatever reason, then he should expect some pushback. From what you're saying, there's never a time when it's legitimate to push somebody to a higher standard. And that's at least part of the reason that we have such problems in DC. These guys make upward of $150K/yr, and somehow we don't expect more out of them. And it's not just limited to Washington either. Sports figures are about the worst, getting paid millions of dollars to play, and then whining about their contracts. Don't even get me started on the baseball strike! :-)
For the forseeable future at least, book are not going to respond to questions or offer feedback... Even ill-formed questions like asmor's has a chance to be interpreted in multiple ways, one of which (hopefully) would end up being useful to the asker.
I totally understand where you're coming from, but I chose to disagree. I think that it's a matter of how you look at life. For example, there are some people who think that it's ok to drive as slow as they want down the road because they want to see the sights. I'm the kind of guy who goes out of his way to make sure that traffic flows smoothly, which means I pay attention to my surroundings and move out of the way of others where I can if it will help them make progress. I'm courteous in heavy traffic, but I also expect others to follow the rules so that we can all do our thing. Nothing pisses me off more than someone who tries to be nice at a 4-way stop by waving me through rather than taking their turn. The system works best when we all follow the rules of the road.
That being said, I think Asmor is a tourist. What's wrong with him parking his car in a lot and taking a side tour rather than driving down the center lane at half speed trying to find his way? From your comments throughout, you seem to think that if he doesn't know what to do next then he's stuck. Ok, let's assume that you're right and that he just doesn't know what to do next. Asking random questions isn't going to
If you don't want crime to pay, let the government run it.
Your own words do not live up to the attitude you profess. I mean, pegging asmor as lazy based on one question for someone you don't know anything about is hardly positive or even neutral.
This confirms my suspicion that I'm a proxy for others, at least in part.
You need not be suspicious of anything. What was the first thing I wrote in starting this thread? "toddbu: Please understand I'm not trying to flame you in particular. This is a general reply to all those who feel the question posed by the original submitter was ill-concieved." Yes, your characteristicly elitist comments earns you the burden of speaking for all those who feels the same as you do. But I gotta say, shifting the essence of my response to direct it onto others rather than yourself does nothing to change the ideas you've expressed. And you're still dodging the issue: What justifies your criticism of asmor's comment but not mine of yours? How is it that your "judgement call" is fair, but I'm being biased when I respond to your comments? Just because I don't agree with you? Despite your initial assertion, you have yet to *prove* me wrong.
Did you read my first post? Carefully? I don't think that I could have spelled it out any better. But this is where bias comes into play. Either you didn't take the time to read the post because I pushed a "hot button" for you, or you chose to focus in on the perceived negatives and ignore the rest of the post. I challenge you to reread the post, looking at it from a positive prespective for both the community and the individual. I think that you'll find a lot of great stuff in there.
Unfortunately, asmor has not made further comments to elucidate his intentions or provide feedback. So I can't tell if I made the right call in giving him the benefit of the doubt. You, however, have made you point repeatedly in subsequent posts. Your very first comment, in essence, complains about asmor's post not being useful or interesting to you, described what *would* interest you, then declares asmor's question trivial and tells him to go to school. Unfortunately, in your subequent comments no where do I see any positiveness directed at either asmor or this community. Your comments do not bring asmor any useful information. Nor does it add to the usefulness or quality of slashdot in any perceptible way. During the course of this discussion, you advocate restricting participation in this forum only to those of high experience at the expense of those less experienced. Through out the discussion, you keep telling me to carefully reread what you wrote. Maybe *I* should spell it out for *you*. Positive to me, means "Asmor, you question is very ambigious and ill-formed. The following books and website discusses ****, ****, and **** in more detail and depth than any comments you're going to get on slashdot ....... Once you've gotten the hang of those concepts, come back and maybe we'll discuss how you can use those ideas in useful and interesting ways. For what it's worth, my background is in the following, ******." It doesn't coddle or insult anyone. It's direct, it's concise, and it doesn't rely on any assumptions or "judgements" of any kind. It seems to me that in the end, you are guilty of the very thing you complain about asmor. You say his question suffers from lack of context and poor research. But your own comments offer not one useful piece of information and pretty much dismisses the whole thing altogether as being trivial because it happened to be uninteresting to you without any regard for the rest of the community.
Seriously, I will agree that I was pushing him for something better. If you want to read that as "get off your ass" then so be it. Nothing wrong with that. If he wants to waste community b
Stay sentient. Don't drink bad milk.
My goal is not to prove you wrong. You placed me in a position of defending my opinion and I am doing just that. At the end of the day, this is a discussion about what type of community we each want. Ultimately, the marketplace will decide what is best. And that's ok with me because I think that truly free markets generally behave in their own best interest.
If you don't want crime to pay, let the government run it.
Your opinion initially happened to be that I *was* wrong. First thing you said to me: "Great comments, even though I think you're wrong. :-)" If the last word is that I'm wrong because the slashdot I percieve as it is and as it should be isn't the same as the one you want, then I suppose you've succeeded. I was rather hoping that we can both eventually agree on what kind of interaction on slashdot is best fore everyone. Well.... time will tell. Perhaps this new experimental tagging thing will solve some of our problems.
Ultimately, the marketplace will decide what is best. And that's ok with me because I think that truly free markets generally behave in their own best interest.
I think you've chosen an interesting analogy this time. A market place operate largely on supply/demand principles, but the influence of cost/benefit constraints and the reality of scarcity is also an integral part of the picture. Although I think a few parallels can be drawn, slashdot does not really fit the profile for a marketplace. For example, on slashdot, what would you consider to be the currency that mediates the exchange of goods? (For that matter, what goods and how exchanged?) How much such currency would guys like asmor have compared to someone like you? What would be the methods of obtaining and consuming such currency?
Stay sentient. Don't drink bad milk.
My opinion != proof. Perhaps the world would be a better place if it was. :-)
For example, on slashdot, what would you consider to be the currency that mediates the exchange of goods?
Eyeballs
If you don't want crime to pay, let the government run it.
Can you say hubris? Not illegal but highly irritating and probably not good for any community, be it slashdot or any other.
Eyeballs? Do you really believe CmdrTaco and Co. do this for just the ad revenue? You spoke with reference to a "truly free market". If that were true of slashdot, then anything goes, and the whole thing would turn into a popularity contest forever chasing the next big thing. Kind of like the music or entertainment industry. I very much doubt that's what you wish of slashdot. Naive and ill concieved may asmor and his question have been, but he is *not* an attention monger. The editors, sloppy as they are sometimes, are not *that* braindead. The article you referenced is heavy on the business side of things and makes a big deal of "market price". Do you think that really mean anything to those who currently run slashdot? The day slashdot gets sold is the day slashdot dies.
Stay sentient. Don't drink bad milk.
Absolutely.
If you don't want crime to pay, let the government run it.
You're confused. OSTG doesn't run slashdot. While they own the resources that keep slashdot running, they can't excercise content control of any kind. All of that is still done by slashdot founder, Rob Malta and his crew. Judging by your slashdot ID number, you may not have been around long enough to know that Rob Malta started slashdot long before it's association with OSTG, long before money was even on the radar. Do some research. Go look at what slashdot was like in the late nineties. Find out the circumstances under which slashdot was first aquired by a business entity. I'm tempted to call you lazy for posting before you knew what you were talking about. But that would be hypocritical. Instead, I'll chalk it up to your lack of time and experience on this forum and make nothing of it. Rather, it would be much more useful to clue you in on what I'm talking about.
note the follwing: "Why Andover?
We talked to several companies: Some that you've heard of, and some that you haven't. We were looking for a company that would guarantee us complete and total creative control, but provide us the financial resources necessary to expand Slashdot in the way we consider best "right"...... It is pretty evident to most old timers here that they've kept their word through the different times slashdot has changed hands.
Stay sentient. Don't drink bad milk.
Is this an assumption or judgement?
If you don't want crime to pay, let the government run it.
Neither. logical deduction. You have a high slashdot ID number and have devised consistantly poor analogies to characterize your understanding of slashdot and how it is run. The simple observations lead to a simple conclusion. There is no reliance on unspoken expectations, thus I do not call you ignorant for not knowing slashdot's history. There is no critical evaluation of the reason(s) for your comments and opinions, thus I do not say you are lazy for not looking things up.
But to fixate on all that is missing the point. Pressing the issue of how much you know, when you knew, or if you are expected to know a lot about slashdot is largely irrelevent. The point is to give you the opportunity to know now. I don't subscribe to a market model for community interaction. It doesn't cost me much to provide information and it is a lot less effort than being frustrated or upset at others for having need of such information. Hopefully, by my effort, the constituents of the community are better for knowing than not knowing.
Stay sentient. Don't drink bad milk.
This is an interesting way of determining someone's understanding or competence about a subject. This must mean that it's ok for me to "observe" that you've made relatively few posts with that low Slashdot ID of yours.
You get -5 gazillion karma points for the high slashdot ID comment. You might as well be looking at my shoe size to determine my level of understanding on how Slashdot works. You say that you drew your conclusion through "logical deduction" and yet you include completely irrelevant facts in your reasoning. Simply amazing.
I know that you're going to try to respond to what I just said, but before you do I want you to think long and hard about this question - "What Slashdot ID number separates those who are experts in the workings of Slashdot from those who are not?" And don't tell me that its 42 or 451585. I'll retract everything I just said as soon as you can give me a number that you can defend. Otherwise, don't waste my time by using such a ridiculous argument.
But to fixate on all that is missing the point.
Explain this one to me. You say that judging people based on their submissions is bad, and I say it's good. You "observe" my behavior and make a judgement, and then somehow it's not relative to the discussion? Your point this entire time is that I was wrong in judging Asmor, yet you try to dodge the issue when judging me.
I don't subscribe to a market model for community interaction.
All communities are by definition markets. They provide something of value (service, product, friendship) at an expense to the participant (money, time, talent). The only exception that I can think of to this rule is a forced community such as a prison or slave labor camp.
If you don't want crime to pay, let the government run it.