Slashdot Mirror


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?"

459 comments

  1. CVS by Anonymous+Crowhead · · Score: 5, Informative

    Use CVS or some other revisioning system.

    1. Re:CVS by g-to-the-o-to-the-g · · Score: 5, Informative

      Mod parent up. CVS or SVN is the way to go all-round. Make sure its backed up, and set up viewvc and you'll have yourself a great place for keeping code. Not only is it easy to view from any machine, but you can quickly see a history of revisions.

    2. Re:CVS by jazir1979 · · Score: 5, Informative

      Choose SVN over CVS, there are many good reasons for it. Also, you'll get the view cvs part for free, since you can automatically browse the repository over http.

      --
      What's your GCNSEQNO?
    3. Re:CVS by maxume · · Score: 1

      Also consider one of the many distributed version control systems ala bazaar-NG, arch, svk and so on. They may be slightly easier to get going for a beginner, both software-wise and conceptually. If you are on windows and decide to go with cvs or svn, make sure to check out tortoise-cvs or tortoise-svn.

      --
      Nerd rage is the funniest rage.
    4. Re:CVS by DarkMantle · · Score: 1

      CVS is one way to go, and seriously consider it if you're going to be working on group projects.

      However, for just storing snippets (like connecting to mySQL) you can use a software program that's designed for one person like. I personally used iCodeLibrary for quite a while in college and found it helped quite a bit. If I recall it allows you to add new languages as well, since it was mainly designed for Visual Studio .NET adding languages like PHP would be needed.

      It was easy to use, but now projects are group jobs so a CVS is needed for us. It's a free program and available from http://www.imetasoft.com/iCodeLibrary/ I hope this helps.

      --
      DarkMantle I been bored, so I started a blog.
    5. Re:CVS by ArchAngelQ · · Score: 1

      Agreed. If you are starting out new, rather than maintaining old repositories, go subversion. I switched recently for a new project, and it's just plain better.

    6. Re:CVS by Anonymous Coward · · Score: 3, Informative

      I'd go with OpenGrok if you have the resources. It's very fast and very powerful.

    7. Re:CVS by dgatwood · · Score: 1, Interesting
      Wow, an AC with something useful to say for once. When they get it working with subversion, it might be worth a look. (For people who don't use svn, it probably is already, but I live on svn.)

      --

      Check out my sci-fi/humor trilogy at PatriotsBooks.

    8. Re:CVS by abertoll · · Score: 4, Insightful

      Version control is good advice, but I think he/she means "how do I maintain a code library" not just how to physically store it or revisions. In other words, how do you maintain pieces of code in a way that allows you to easily incorporate them into new projects.

      For me the answer is to create individual projects or modules (using version control) that contain a logically connected set of components. Version control is really just a means to the end of actually making the library available in a convenient way.

      --
      "he drew his sword Ringil that glittered like ice... and he wounded Morgoth with seven wounds..."
    9. Re:CVS by LordNightwalker · · Score: 1

      Agreed; CVS/SVN or any other versioning system you feel comfortable with is the way to go. Also, don't limit yourself to just the often used stuff; versioning systems are great for work in progress as well, even if you're the only coder on the project. Boss/client wants a major change in the tool? No problem; you're stored the last known good version in your versioning system and tagged it, so even if you screw up while applying the changes, you can always check out that version and start over. You can accomplish the same by just making a backup copy of your known working code, but storing it in a versioning system has additional benefits like being able to track the changes, comitting only the changed files after every minor change instead of having to take another copy of the complete source code etc...

      Other than that, on the code side of things, make sure your often used code is separated from the main logic of your projects, and just include the oft used functions/classes where appropriate. This is obvious to most seasoned coders, but since you mention you're self taught I felt compelled to point this out.

      An example would be my own php stuff at work: all our tools at work look the same, same basic layout, just different menus and code on the application logic level of the site. We have a bunch of useful functions/classes stored in a separate CVS project called "empty framework" which we can just check out, including a couple of database tables which share the same layout across all our projects. We just check out the bare framework, create a tablespace for it and populate the user table with at least one admin user, edit the config file to point to this tablespace and then fill in the blanks like our menu (for which we have a menu editing module that's accessible from within the tool and stores its menu in the DB, already set up at creation time to contain a link to its own so we can start editing the menu from within the new tool) and the application specific code. This approach assumes you write your "framework" code in such a way that it's fairly independent of the application itself, and accepts a couple of parameters to tweak it to the specific needs for your app.

      Example: I work in the helpdesk business; most tools are just simple call logging tools. Presenting a sortable table of all call log entries which can be searched and filtered involves no more than setting a couple of variables and calling one function that renders the whole table, X rows per page, with navigation buttons for prev/next page, clickable column headers to change the sorting and a view/edit/delete button per call log. This is so basic for all our tools, we split the code off in its own class, and just call that class to do the hard work for us. So basically what I'm saying is: split off your oft used code so you can reference it instead of copy/pasting it in your tool.

      The good thing about this is that when a bug is found in the basic framework, we can fix it once there, and just overwrite the appropriate file in all our tools if it doesn't break the API. New projects wil automatically benefit from the fix.

      --
      Install windows on my workstation? You crazy? Got any idea how much I paid for the damn thing?
    10. Re:CVS by dan+the+person · · Score: 1

      Is there really any point in using CVS or similar when this is a personal collection of code that only one person is accessing?

      Why not try using ext3 as your filing system? Set your editor to store past revisions in a backup directory everytime you save. That way you have a history of all the changes you have made.

      The C in CVS is for Concurrent. Ain't no concurent when it's only one person. CVS is overkill.

      Also, have you considered using a language like Java where you'll find such 'oft-used code' is part of the standard library set and you dont have to write it yourself, leaving you to concentrate on writing the code that is unique to the problem you are solving?

    11. Re:CVS by Anonymous Coward · · Score: 0

      We just converted several of our projects from CVS to SVN without problems. No need to stay with CVS at all.

    12. Re:CVS by Anonymous Coward · · Score: 0

      So what you're suggesting is that instead of using an SCM that's designed to do the job, you'd be better off with a half-assed editor configuration and a filesystem? Why would that be better or easier to manage? It sounds like a nightmare.

      The C in CVS might be Concurrent, but those other two letters should be a dead give away.

    13. Re:CVS by Sweetshark · · Score: 1

      Forget about CVS, because you will not want it, if you can use subversion - use subversion with trac. It gives you a wiki to store ideas and concepts, a bugtracking system and a webfrontend for subversion and some more.
      http://www.edgewall.com/trac/

    14. Re:CVS by dan+the+person · · Score: 1

      Because he doesn't need any features of a SCM system. He just wants to store some code somewhere so he can access it later. That's what filesystems are for.

      As a bonus, turning on one simple option in your editor gives you revision history without having to download install configure and maintain CVS or a similar SCM system.

      If the "library" ever gets grander than a few utility classes and multiple people need to work on it, then you can invest the time in setting up a SCM at that point. At that point you will actually be getting a return on the time you invest.

    15. Re:CVS by Anonymous Coward · · Score: 0
    16. Re:CVS by commanderfoxtrot · · Score: 1

      Admittedly I'm biased, but for most people the added complexity of distributed revision control is not required. While the benefits of advanced merge mechanisms cannot be denied, there is a steeper learning curve.

      We recommend Windows users use TortoiseSVN and have had few problems- it's a fantastically easy to use interface on Windows to the power of Subversion.

      Once you're used to version control, it's hard to work without it. I use it for almost everything.

      --
      http://blog.grcm.net/
    17. Re:CVS by smallfries · · Score: 1

      SVN does rock, and I use it over CVS any chance that I get ... but the NFS issue does suck. Not being able to host repositories on mounted drives is a bitch, especially at work where all of the machines are locked down and everything is done over NFS. Luckily our sysadmin is fairly understanding and made local partitions for us to use, but the repositories on them still have to be cron'd onto an NFS mount for backup.

      There are some noises that you can avoid the data corruption by switching the berkley db for another options, but even the subversion book calls this 'experimental' at the moment.

      --
      Slashdot: where don knuth is an idiot because he cant grasp the awesome power of php
    18. Re:CVS by WebCrapper · · Score: 1

      I took this question the same way as you - wanting to store old parts of code (functions, etc), instead of storing whole projects.

      If I where looking at staying on Windows, I would try this. It actually would help my current issue of creating files for each function I like.

      Unfortunately, I have come to hate (and I do mean HATE) windows and am switching. Anyone know about anything like this on Linux?

    19. Re:CVS by Meostro · · Score: 4, Informative

      This is also how I saw the question, not "what do you use for concurrent versioning?" but rather "how do i make libraries?".

      If you want to make reusable code, one thing you're going to have to do is generalize. Don't make ultra-specific functions that just do one ultra-specific thing, put in a couple of parameters to make your function more generic. That's not to say you should have one function that does everything; just don't have a CreateRadio and a CreateCheckedRadio function in your js library, have a CreateRadio that accepts a parameter for checked or unchecked.

      You may want to prefix your functions in some way so that you won't run into namespace conflicts - use your initials or something simple. The CreateRadio above would be xyz_CreateRadio.

      Group your functions logically into modules. If you have a bunch of stuff that deals with HTML form controls, make an htmlformcontrols.js library. As before, don't go overboard either way, too many functions in a library or too many libraries with just a few functions will drive you nuts.

      Use a style, and stick to it as much as possible. The most popular style I've seen is one true brace, but personally it drives me nuts to work with this kind of code. I like BSD/Allman much better, but any style is a matter of personal preference. Use what works for you.

      Use clear, descriptive function names. Don't make function x(a,b,c) unless you have a good reason. If "nobody will ever see it and i'll never use it again," think again. Someone will see it, and you will have to use it again, and it will be a pain in your ass.

      Finally, and perhaps most importantly, comment everything. Not every line of code, but every function: what it does, what its parameters are, what its outputs are. You won't remember what $stamp is in your hash-cash implementation unless you have some kind of comment or reference you can check where you clearly stated what it is and why it's part of your function.

    20. Re:CVS by Anonymous Coward · · Score: 0

      CVS? SVN? Real Men just upload their stuff on ftp, and let the rest of the world take care of keeping the old versions online.

    21. Re:CVS by Anonymous Coward · · Score: 0

      Use GMail it will even mine it and suggest tools to purchase.

    22. Re:CVS by maxume · · Score: 1

      I've been using bazaar-NG for simple personal stuff, and it beats the pants off the last version of tortoise-svn I tried(somewhere around 1.0x).

      I'm open to the ideas that I didn't 'get' tortoise-svn and that I don't have to do anything real complicated so I'm not making a good comparison, but I got pretty discouraged when I had to start thinking about whether I should use the same repository for everything or use seperate repositories with tortoise. It was a pain setting up repositories too. Setting up version management with bazaar-NG amounts to switching to the directory and running two commands: bzr init, bzr checkin. That's it.

      I guess storing the repository in the directory being managed might not sit well with some people's file management ethos, but for my small personal projects, it works great; everything is in one conceptual bundle.

      I'm not really sure the learning curve was/is steeper, at least for bazaar-ng.

      --
      Nerd rage is the funniest rage.
    23. Re:CVS by Ramses0 · · Score: 1

      I agree with the parent poster. Logical vs. Physical storage. For Physical, use SVN as it is easy and helpful. For logical, let me describe what I've generally seen-

      Module => Project => Global

      Do as much 'hack-hack-hack' as you want, but at the module (ie: login module, calculation module, reporting) levels... those might correspond to individual directories or individual files when you are working on your project. When you see an opportunity for re-use (hey, I'm always needing to build SQL strings in a certain way) then make that bit of extra effort to make those functions more generic and move them to the "project" level.

      Always group things by "theme" ... for PHP / JS, real "object oriented programming" is less useful, no matter what the purists say. Rule #1 about OOP is that you absolutely *DON'T* want to go down the path of relating Software Objects / Classes to Physical Objects. The example of a "class CAR has-a class STEERING_WHEEL which has-a class IGNITION_KEY" turns out to be just plain dumb. Group your functionality into useful chunks so that when you import those class/objects you can immediately start doing useful things with them. If you see that your "useful object" has two or three main themes, split those themes into separate classes and make that decision: do I make it shareable to more areas of my project.

      After you've been doing this for a while, you'll start to see where the Global libraries come into place. Consider those things like PEAR or your own personal PEAR-equivalents. It requires more work, a slightly unnatural way of doing things at times, but exposes your work in a highly consistent manner for you to use in the future or other people as well.

      Summary-

      module-level: doing reporting... make some useful SQL functions

      transition to shared SQL classes / functions for your whole project
      (re-org, re-write your original SQL functionality as necessary)

      make that SQL functionality even more generic for you to re-use from proj. to proj. or so you can share it on a semi-global basis. ...and as a correspondence to this... don't be afraid to pull in stuff from "global-shared" (ie: PEAR, PHP-Classes) to get a head start (so long as you agree with the licenses)... that's why those things are out there in the first place, and how open source is supposed to work. :^)

      --Robert

    24. Re:CVS by tha_mink · · Score: 3, Funny

      Actually I usually go with...

      File>>Save As..

      --
      You'll have that sometimes...
    25. Re:CVS by knewter · · Score: 1

      I would definitely suggest SVN coupled with Trac (http://www.edgewall.com/trac/). There is nothing better. :)

      --
      -knewter
    26. Re:CVS by Anonymous Coward · · Score: 0

      LOL, you are right. Most of these responses are pretty obtuse.
      Use version control is good advice but he's asking how to make your code reusable.
      Read up on functions, make them not dependant on GLOBAL variables.
      Use classes. Object Oriented Programming (OOP) is the most powerful way to make reusable code. Keep your classes simple and make them do very specific jobs.

      Example:
      When making an object to manage sessions, don't put string filters, a calculator, and calendaring functions in it. If you have a application that uses it, and doesn't need calendaring functions, you are loading a bunch of unnecessary stuff with every page load. Anything not closely related to the class's job belongs in another class or in the code using the class.

      There are books written on this subject. Slashdot isn't going to help much here. Good OOAD (Object Oriented Analysis and Design) is a necessity.

      www.zend.com is a good resource for learning how to do this with php. A java class or three would really get you some good OOP skills. The stuff you will learn in java classes can be applied to any high level language. Check out http://www.ooad.org/ for some good resources. There are entire books written on this subject, and many factions in the programming community about what is the "right" way to do this stuff.

      Few programmers really "get" it including some with degrees in computer science, including at least half of the ones that claim they do. My objects get butchered and innappropriately added to by my co-workers regularly. I'm constantly fighting this and backing out their mistakes.

      I had one guy add character filtering and url rewriting to a socket library! Don't be that guy.

      -AC

    27. Re:CVS by poot_rootbeer · · Score: 1

      Use CVS or some other revisioning system.

      Submitter is not even sure what people mean by "libraries" and "APIs". I think he's looking for information a little more basic than that.

    28. Re:CVS by CableModemSniper · · Score: 1

      It's a .NET app, so you could try running it under Mono. Some how I doubt that'll have the effect you're going for.

      --
      Why not fork?
    29. Re:CVS by aevans · · Score: 1

      OO People are going to hate this, but the trick to resusability is to create procedural code. Treat data as God intended it to be used -- as input and output.

      If your code relies on specific objects & data structures, it will be less re-usable. Objects are domain specific. A 'car' object in a racing game is different from a 'car' in a mechanic's billing application, even if they both have a car type of 'Ferarri'. That's where alot of cruft in OOP comes in, tying data to closely to behavior.

      Object Oriented programming isn't meant to increase reusability, it is for reducing complexity.

    30. Re:CVS by Anonymous Coward · · Score: 0

      Its nice to see someone still follows the path of BSD/Allman style indentation. I simply despise the 1TBS and GNU styles with a passion; they make code so much more difficult to read and track properly for my brain (and GNU is way more annoying to code in a plaintext editor). But I'm the only person from both my college friends and my work colleagues who thinks that way, they're all in love with 1TBS or GNU(since emacs defaults to that in our lab).

      So I'll endorse BSD/Allman for code libraries as well; whitespace is not a bad thing for readability, especially for libraries you're going to use as a reference. The era of 640x480 monitors and limited screenspace is well and truly over with, after all. 5 extra lines to make a program more easily readable should not force you to scroll a ton more.

    31. Re:CVS by WebCrapper · · Score: 1

      I thought about running it under Linux, but I figured I would have a better experience if I actually did it myself. I'm currently learning C++ and later, Java2, so this will be something I can use and practice programming with as well.

    32. Re:CVS by kchrist · · Score: 1

      Why not just store all the repositories on the file server (non-exported) and access them over the network (via https or svn+ssh)?

    33. Re:CVS by dusik · · Score: 1

      Real Men (TM) also don't ask on /. about how to do this ;) So let's keep the Real Men (TM) out of this.

    34. Re:CVS by pthisis · · Score: 1

      CVS is one way to go, and seriously consider it if you're going to be working on group projects.

      Version control is invaluable even for individual developers. It's helped me out on personal projects more than once.

      --
      rage, rage against the dying of the light
    35. Re:CVS by e2d2 · · Score: 1

      Also one thing that seems to be lost on some is that the code itself is worthless. The design of that code is where the value is at. If you have a design pattern, reuseable code, whatever, the strength is in that knowledge, not in having access to the code itself necessarily. For instance, if I have a great way to manage objects across the network I can abstract this to a design pattern or technique that I can carry with me for the rest of my life and into other languages, modifying it to fit the application.

      I do keep a historical code base on CDs and available via ftp but to me the design is more useful than the actual implementation. Kind of a broad statement but usually true in my experience.

      So to sum it up? Abstract those chunks of code to good designs and put them in your notebook or whatever medium you choose. Just one more tool in your toolbox.

    36. Re:CVS by Anonymous Coward · · Score: 0

      Just so no one wastes their time clicking the rudd-o.com link below (page hit whoring is lame):

      Subversion. I do Subversion for a living. You may choose another version control system, such as DARCS or SVK, but I use Subversion. I organize my code in:

      trunk/
      branches/
      tags/

      form, which allows me to perform most common repository operations (merge, branch, tag) fairly quickly and without worries.

      After I've pronounced a release stable enough, I tag the release (by copying the trunk/ into tags/release-x.y.z. Then, I check it out, and make a tarball out of it, which I place on a separate folder.

      Each project gets its own repository. Each project also gets a unique folder named after the project's name, which usually contains a TO-DO list in text form, a checkout of the trunk/ for that project's repository, and assorted files and documentations (or symbolic links to my knowledge base folder, Information collection). In each project folder, I also have a subfolder which contains each release in source tarball form, and (if the project needs compilation for a target platform) the compiled installable packages (.tar.gz, or RPM)

      I help myself by using Trac. It couples fairly well with Subversion, letting me know how my project is evolving, and letting me see colored differences for each revision.

      All in all, use a version control system. That, along with regular backups, ensures you have full productivity and complete history of your work.

    37. Re:CVS by smallfries · · Score: 1

      Non-root users don't have access to the server for security reasons. And the sysadmin doesn't want any non-critical processes running on the box. Basically it does nothing but NFS.

      --
      Slashdot: where don knuth is an idiot because he cant grasp the awesome power of php
    38. Re:CVS by JacobO · · Score: 1
      Good call, but...

      With proper decomposition you can deal with this issue too.

      For example, instead of using the domain type for everything, you divide your functionality into different concerns, each supported by a fairly specific interface.

      This is far more reusable for example:
       
      bool ListContains(IEnumerable list, IComparable itemToFind)


      than
       
      bool ListContains(Car[] list, Car itemToFind)


      Admittedly, there is a cost to this effort (design) but it's the sort of thing that one can work on over time.
    39. Re:CVS by jgrahn · · Score: 1
      If you want to make reusable code, one thing you're going to have to do is generalize. Don't make ultra-specific functions that just do one ultra-specific thing, put in a couple of parameters to make your function more generic.

      No! That way lies Madness.

      Possible there are people who can pull this off, but when I've observed people attempt to write reusable code, they come up with something slow and buggy which is so hard to understand that they won't reuse it anyway. Reuse is hard.

      For the kind of thing the original poster asked for, I simply use copy-and-paste programming. I keep all my source code in version control (in CVS, which unlike SVN suits my needs well). If I need something I think I might have coded before, I go look for it, find it, copy it, and adapt it. The third time I do this, I might consider making it one single, reusable component. At that time I know the problem pretty well, and can guess what is general and what is specific about my problem.

  2. Depending on the editor by T-Ranger · · Score: 2, Funny

    Usualy something like ":wq" "^s" "^x^s" "alt-F,a"

  3. Reusable by MyLongNickName · · Score: 5, Informative

    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
    1. Re:Reusable by tepples · · Score: 1

      Inventing something once is Genius. Inventing something twice is stupidity.

      Your stupidity, or the Patent Office's stupidity?

      Using OOP, code should be reusable without having to have some external database.

      Where are you going to share the source code for your OOP classes "without having to have some external database"?

    2. Re:Reusable by MyLongNickName · · Score: 2, Insightful

      Copy and paste? Read his question again. He is not an advanced programmer. Don't get him tied up with unnecessary technical details.

      When he is a program manager for a team of 20, then he will need something more robust.

      --
      See my journal for slashdot ID's by year. Mine created in 2005. http://slashdot.org/journal/289875/slashdot-ids-by-year
    3. Re:Reusable by Ravatar · · Score: 1

      This is similar to how I do it. Most of my programming anymore is done in .NET, so I've created a set of libraries, organized by the scope of the work (Database/IO, alrogithms, network transport). I then used nDoc to create MSDN-style documentation that I can easily search later on if I need to code something similar.

      That way I can locate the exact class, make sure that it suits my needs, and copy it over (along with any dependencies) into the project quickly and easily.

    4. Re:Reusable by Anonymous Coward · · Score: 0

      Heh...I wish.

      I'm a self-employed contractor who moves around fairly consistently (max every couple years)...unfortunately amost every contract I accept requires me to sign over all IP for anything I develop.

      This means I am constantly re-inventing (and re-improving) on stuff I have done before.

      Where do I keep my previously used code? In my brain. Try and keep that IP!

    5. Re:Reusable by infochuck · · Score: 2, Insightful

      What? What does any of this have to do with the question? He didn't ask for the features of OOP; he asked how to store/organize his libraries/modules/classes/headers files/what-have-you. The implication that simply using an OO language - regardles of the exact language or platform - obviates the need for basic file storage and management is ludicrous.

      On top of all that, source repositories (I assume that's what you mean by "external databases") aren't primarily intended to help folks oranginze and store things; they're for revision control, so why you bother to bash them is beyond me.

    6. Re:Reusable by LeonGeeste · · Score: 1

      A good practice is to comment function and classes before coding.

      I hope you don't *just* comment the functions and classes before coding! You should have the function planned out completely before you type anything. It's extremely tempting to just hammer away, but that always, always wastes time. "Think before to do."

      --
      Rank my idea: http://www.sinceslicedbread.com/node/531
    7. Re:Reusable by Nutria · · Score: 2, Insightful
      Using OOP

      All I can say is, "Wow". Code reuse has been around for 40 years.

      FORTRAN card-wallopers would keep routines as stacks of cards in their desk drawers. The C rtl is reusable code, as are libm, Turbo Pascal units (am I dating myself?), SQL stored procedures, GTK, the 10 jillion Perl modules, etc, etc.

      I don't know much (anything, really) about how PHP and JavaScript store software, but if this were a 3GL, you could group your common code into funtional units that compile into .o/.so (or .obj or .dll, depending on your platform) files. With Python, you group them into .py files and compile them into .pyc files.

      --
      "I don't know, therefore Aliens" Wafflebox1
    8. Re:Reusable by 1shoonya0 · · Score: 2, Informative

      Exactly, he is probably asking about code as in code snippets and not projects. I have most of my frequently used code lying in a few files. Most of my java code are in a few classes and some with main methods so that I can quickly test or execute them. My favourite PHP and JavaScript code are in two files from where I can copy post. I have these on a few backup cds and in a couple of mails in the yahoo and gmail servers. The other bigger projects are safe on some cds.. which I can never locate when I really need them.

      --
      I doubt, therefore I might be.
    9. Re:Reusable by Anonymous Coward · · Score: 0

      "am I dating myself?"

      Hopefully not, in any interpretation...

    10. Re:Reusable by msloan · · Score: 1

      It's too bad that often times when you find something that might suit your purposes it is badly designed and lacks features. So you end up reinventing it because they did not implement it well.

    11. Re:Reusable by Anonymous Coward · · Score: 0

      Maybe he's not an advanced programmer, but he still needs a good and reliable code repository to back up his work.

      He does not need to learn the commandline (although - this wouldn't hurt either), if he's got himself a nice UI for that.

      In any case the code repository not so big an issue - i'ts all just about backing up the code. The resuability of the code is whole another matter.

      Nobody can tell you the exact steps You must take.The main keywords are modulaization, refactoring and convensions.

      Object oriented approach is a good start for modularization as objects are usually much easier to reuse.Try to design your modules so that closely related functionality is in a single file.

      Refactor a lot - any time You find yourself excessively copying and pasting or reinventing your existing code - try to look at that code from the higher level and see the patterns - isolate those patterns into generic and reusable classes.

      Search the net and find yourself a suitable set of coding standards. This includes the way you comment your code, the way you use the witespace and line breaks around language elments and the way you name Your variables. That way You can read your code easier next time you need to change something. Or refactor it.

    12. Re:Reusable by ultranova · · Score: 3, Interesting

      Copy and paste?

      So when you find some critical bug in that code, you'll have to hunt down every copy and update them as well. And if you make some l33t optimization to the code, you need to update every copy to get any speed advantage. Yes, really smart and simple, that.

      If you don't want to use external databases, then simply break the code down to one logical unit per file, and use soft/hard links to bring them to every project that needs them. That way any bugfix/speedup affects every program immediately, and you don't get hundred-plus versions of code floating around and causing trouble.

      He is not an advanced programmer. Don't get him tied up with unnecessary technical details.

      Giving some thought to technical details avoids giving a lot of thought to solving the problems caused by lack of attention to details.

      When he is a program manager for a team of 20, then he will need something more robust.

      When he is a manager, he can get his underlings do copy-paste maintenance all day long. As long as he's working alone, he is the one who has to fix his fuckups. So he needs the robust system now, not in the future.

      --

      Forget magic. Any technology distinguishable from divine power is insufficiently advanced.

    13. Re:Reusable by Anonymous Coward · · Score: 0

      "Inventing something twice is stupidity."

      I think to be fair the guy might have meant that "it was no trouble re-inventing the wheel because it helped me to learn and it was fun to do".

      That's how people learn: Observe and replicate.

      Are you suggesting a novice programmer's first project should be to link to R and do linear regression on a multivariate function?

      Anyway here's my 2c.

      Create a directory for all your neat stuff: /home/me/stuff

      In there have a README and directories for:
      C perl php java or whatever plus

      In these directories have:
      src include obj bin doc sbin tools etc var Makefile README

      This will set you up with a pretty standard structure.
      CVS is probably overkill right now.
      Try automatic documentation generators.
      Doxygen, Javadoc, Robodoc - its all good.

      Cut it all onto CD every now and again and store one
      of those CD's offsite every now and again in case of
      floods etc. If you are concerned about IP, send a CD
      to yourself recorded delivery as this will set a date
      for your inventions. Do not underestimate the power
      of companies to steal your work, no matter how trivial
      you think it is.

      Mostly, have fun.

    14. Re:Reusable by Crayon+Kid · · Score: 1

      Inventing something once is Genius. Inventing something twice is stupidity.

      If somebody comes up with a solution on his own, unaware there was already one ready-made, does that make him stupid? I'd say he's just as much of an inventor as the first one.

      There's a distinction to be made here.

      If we want productivity (and money) then of course one should always look for ready-made solutions first, look into modifying an existing one second, and only third should they attempt to make their own from scratch.

      But if we want learning, then there's no substitute to coming up with good solutions on your own. That's solid programming education, that will teach you to gather relevant information, analyse it, make decisions and come up with a solution. This is the kind of stuff that will allow him to become a project leader later on.

      --
      i ate crayons when i was a kid and now i have two braincells and the blue ones taste nicer
    15. Re:Reusable by Eivind+Eklund · · Score: 3, Insightful
      Note: The following may not apply to some totally exceptional programmers. However, unless you've got at least ten years of professional experience, assume it applies to you and you just don't have enough experience. I've never met nor heard of anybody it does NOT apply to.

      This seems reasonable when one don't actually write real world code, instead just playing around with "what I want to do". Often, reinventing the wheel is cheaper than trying to use an old wheel, and trying to make something that can be perfectly reused is more expensive than writing it several times.

      Writing things several times also leads to you knowing what things you did right and wrong, so the second or third time you do something similar can be much better. It's important to be careful on go #2, though - it's easy to try to solve all the things that were bad with the first system, and overengineering. That's known as "The Second Systems Effect".

      Eivind.

      --
      Doubting the existence of evolution is like doubting the existence of China: It just shows that you're uninformed.
    16. Re:Reusable by chriseyre2000 · · Score: 1

      You obviously have never heard of Test Driven Development.

    17. Re:Reusable by packeteer · · Score: 1

      What the question asker needs is a standard education in programming. I think all of the problems he is having are solved with standard education. Self-taught only goes so far and i suspect that he is staying self-taught as a matter of pride of for bragging rights. I know many programmers who are like this and it is silly and counter productive.

      --
      unzip; strip; touch; finger; mount; fsck; more; yes; unmount; sleep
    18. Re:Reusable by mwanaheri · · Score: 1

      Same idea: Use comments. Use them excessively. Start the single files with a description of what your idea in writing it was. When it comes to legalese: Put it unter a bsd-license, so you can use it at work as well. For storing: Put it in your own toolbox and keep using the toolbox. You won't loose the files you keep working with.

      --
      Idha khatabahum lijahiluna qalu salaman
    19. Re:Reusable by Anonymous Coward · · Score: 0

      And there is the whole topic of 'fragile base classes'.

      OOP is NOT a panacea nor is it universally applicable or even renowned for portability.

      It's a tool. Useful for many things but not an end in itself.

      I'll take clarity over direct recompilability many times. What's a little editing to quickly solve a specific problem? Many times people lose their balance and excessively complicate the smallest things just for some hypothetical potential future reuse.

      Yin-Yang, all that.

      For long term storage of code, be very careful with media shelf life.

      Paper works amazingly well for keeping that important algorithm you developed available twenty years from now. I've actually been through that path several times to advantage.

      If I had stored it on 9 track tape like everybody else was doing in those days then I'd have been hosed ... And they laughed because I printed and bound that stuff. HAH!

    20. Re:Reusable by Anonymous Coward · · Score: 0

      Some notable experts would disagree with you regarding improvisation and prototype building.

    21. Re:Reusable by MadKeithV · · Score: 1

      If I had points I'd mod the parent up, but the best I can do is reply in agreement, and with the adage
      "Build one to throw away, you will anyway".

    22. Re:Reusable by j-cloth · · Score: 4, Insightful

      Very true, but if all of your code uses the same library you have to be very smart up front when building it to avoid not having to rebuild existing projects every time you update the codebase.

      For the first application, I create function foo(). Later I find I need to do something very similar to foo() for a new application that I didn't anticipate the first time around. Should I have assessed every possible use of foo() when creating it originally (most of which I will never use)? Or should I change foo() and update every application that uses it? Or should I update foo() and be hampered by my original interface to it? Or should I take my original library, modify foo() and have each application use the version specific to it? If I need to make changes to the original appication later, I can make it use the newest library to take advantage to the updated foo(), but unless there is a compelling reason to it's stupid to change working code.

      Of course, with experience, you can make foo() very robust on the first attempt, but read the OP, he's just getting warmed up and even experienced programmers can find new uses for old functions. Eventually, you get your libraries to the point where the interfaces are pretty consistent, but not off the bat and not for a novice programmer.

      Side comment to the OP: Be aware of the balance between too much abstraction (don't have one function or even library that does absolutely everything) and too much specificity (see PHP -- different functions doing extremely similar things).

    23. Re:Reusable by osoese · · Score: 0

      The whole basis of OOP is re-uiseable code. I for one, thought that was a very thoughtful answer. Libraries that are re-useable by many programs seem to be exactly what the question was about. In fact, for those of us who are unorganized, classes and objects might be the only way to catalogue our code for re-use.

    24. Re:Reusable by Anonymous Coward · · Score: 0

      You misunderstood. What was meant was one person inventing something twice is stupidity.

    25. Re:Reusable by infochuck · · Score: 1

      Dude. Re-read the submmittor's question. Then re-read the OP's comment. Then re-read my reply. You say:

      "The whole basis of OOP is re-uiseable code"

      And I completely agree - but you HAVE T OSTORE IT SOMEWHERE. And then you have to be able to FIND IT ON YOUR HARD DRIVE before you can reuse it. If it's lost in a home directory somewhere amongst hundreds of other files - some source, some not - you ain't reusin' shit.

      He wants to know how/where to store them - on the filesystsm, in a database, in some fancy third-pary code-organization libary, etc; organized by name, subsystem, function, the tier it's typically used in... these kinds of things. The fact that you've not caught on makes me think you aren't a programmer - just an OOP/JAVA fanboi.

    26. Re:Reusable by LeonGeeste · · Score: 1

      Improvisation doesn't contradict me. You can improvise while planning the code. You can come up with better ideas while typing it and re-plan the function. I'd like to know how the got the result that buy just charging forward with typing, you get better code.

      --
      Rank my idea: http://www.sinceslicedbread.com/node/531
    27. Re:Reusable by ultranova · · Score: 2, Insightful

      For the first application, I create function foo(). Later I find I need to do something very similar to foo() for a new application that I didn't anticipate the first time around. Should I have assessed every possible use of foo() when creating it originally (most of which I will never use)? Or should I change foo() and update every application that uses it? Or should I update foo() and be hampered by my original interface to it? Or should I take my original library, modify foo() and have each application use the version specific to it? If I need to make changes to the original appication later, I can make it use the newest library to take advantage to the updated foo(), but unless there is a compelling reason to it's stupid to change working code.

      But this isn't a situation in which copy-paste would help either. It only helps if you need to use the same code in every application, not similar. In fact, copy-pasting foo() everywhere is a guaranteed way of losing track of which application uses which version and what exact semantics apply to them. It will quickly turn into a nightmare.

      The correct way to handle this is to make function foo_two(), and link that to applications that need its semantics. If the function is complex, you could put the common parts to include files - that way both foo() and foo_two() can use them without needing to copy-paste them.

      After all, if function foo() does something, and you need a function which does something else, why on Earth would you call it too foo() ? It is easy enough to make stupid mistakes when programming without purposefully trying to confuse yourself or other maintainers. KISS - Keep It Simple Stupid ;).

      --

      Forget magic. Any technology distinguishable from divine power is insufficiently advanced.

  4. On disk or tape by Profane+MuthaFucka · · Score: 5, Funny

    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!
    1. Re:On disk or tape by zephc · · Score: 1

      duh, you use a hi-speed scanner and OCR, that's just as good, right? Right?

      As a related idea, I've often wondered if it would be possible to port Doom to a high-speed printer, where it prints each frame on a separate piece of paper. Not eco-friendly, but that's not the point.

      --
      "I would say that 99 per cent of what my father has written about his own life is false." - L. Ron Hubbard Jr.
    2. Re:On disk or tape by SpacePunk · · Score: 1

      It's the duty of noob developers to work their fingers till they bleed. So, printing it out is the best choice.

    3. Re:On disk or tape by Fulcrum+of+Evil · · Score: 1

      I've often wondered if it would be possible to port Doom to a high-speed printer

      Already been done, mostly. There exists a vt100 doom port, which could be easily converted to a line printer and timed to a strobe.

      --
      "We returned the General to El Salvador, or maybe Guatemala, it's difficult to tell from 10,000 feet"
    4. Re:On disk or tape by Anonymous Coward · · Score: 0

      Come on, everybody knows Linus and RMS both use sourcesafe.

    5. Re:On disk or tape by Anonymous Coward · · Score: 0

      Nonsense, tree killer! Real men dictate their code to audio tape instead of wasting paper on print-outs.

    6. Re:On disk or tape by Anonymous Coward · · Score: 0

      Ah fucking brilliant!

    7. Re:On disk or tape by AragornSonOfArathorn · · Score: 1

      That's a good idea, but this is the 21st century. What about backups?

      I recommend dictating into a digital voice recorder, download the .wav file to your computer, uuencode it, and print it out. Keep the printouts in a safe-deposit box just in case.

      --
      sudo eat my shorts
    8. Re:On disk or tape by MobKiller · · Score: 0

      duh ! What about security ?
      Anybody can steal his tape, listen to it, type the code and there it is, you just lost millions cause somebody stole your revolutionnary software! He should learn a language that nobody understands like ancient greek or simply invent a new language. THEN he can record his code on audio tape !

      Seriously. If he's talking about storing code, he should use some kind of CVS like Subversion. If he's talking about code maintainability/reusability, he should learn about the Object Oriented Programming principles, the design patterns, etc... This is the kind of stuff you learn at universities, though it can be self-taught. For some people, it can take the fun out of programming. Be ready to invest a lot of time going through books and websites to learn about that...

    9. Re:On disk or tape by SpacePunk · · Score: 1

      Every tree killed makes it easier to pave the world!

  5. Paper by eta526 · · Score: 1

    Printed out, of course. File cabinets full. :-D

    1. Re:Paper by Anonymous Coward · · Score: 0

      Which is still marginaly more sane than using Microsoft's Visual Source Safe!

  6. PHP by Anonymous Coward · · Score: 0

    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.

    1. Re:PHP by Anonymous Coward · · Score: 0

      ....and this is exactly why "PHP programmer" is an oxymoron.

      code reuse != copy and paste.

    2. Re:PHP by zeath · · Score: 1

      While large chunks of reusable modules can be useful for large projects, efficiency is also key. Simple db functions would probably be in a module that is also referenced by a user account or cart module, and those types of modules would also include many other functions. This can be something as complex as an encryption routine or something as simple as a particularly useful XML-parsing loop. I believe the overlying question is how to maintain a comprehensive reference for useful loops and one-liners, while also keeping a repository of functions and whole modules that need not be used as a whole module (such as user accounts) just to include one item (like encryption support).

      To that, I have no answer. My work varies enough that I often only need to go pull one or two functions from older projects, and they're always specific enough that I always know right where to find them. But, at the same time, most of that is not web work. When doing my web work (in perl, as I do most everything else), I usually copy old modules and tinker with them to add whatever functionality that I need. There are very few modules that I will reuse between unrelated projects without editing.

    3. Re:PHP by kabz · · Score: 2, Funny

      Reminds me of university, where I once saw a fellow student copy a listing out by hand, then actually sit down and type it all in again to one of these old DEC lineprinters (probably old in 1984)!! Just to get a listing. :-)

      --
      -- "It's not stalking if you're married!" My Wife.
    4. Re:PHP by menkhaura · · Score: 1

      And what "ASP/VB programmer" is? A singularity?

      --
      Oxymoron

      --
      Stupidity is an equal opportunity striker.
      Fellow slashdotter Bill Dog
    5. Re:PHP by hazah · · Score: 1

      Hey now, just because one of us is uninformed in the Art, doesn't mean the rest of us are lost as well. I copy paste nothing, yet I use PHP... go figure.

    6. Re:PHP by smittyoneeach · · Score: 1

      Hand-keying can be a great way to learn a new language, and a help to understanding an intricate function.

      --
      Get thee glass eyes, and, like a scurvy politician, seem to see things thou dost not.--King Lear
    7. Re:PHP by drxenos · · Score: 1

      This isn't a lineprinter, it's a dumb terminal for the PDP-11 that used paper instead of a screen. Back in the early 80's I wasted a lot of time (and paper) playing Adventure on one of these.

      --


      Anonymous Cowards suck.
  7. Files! by Anonymous Coward · · Score: 0

    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.

  8. Google for two things by Anonymous Coward · · Score: 0

    1) OOP: It will teach will how to abstract logic;

    2) Refactoring: It will actually create the libraries.

  9. SVN by anielsud · · Score: 5, Informative

    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.

    1. Re:SVN by H0p313ss · · Score: 1

      If you're doing PHP and considering either CVS or SVN I'd recommend :

      CVS integration is built into the Eclipse platform. If you're going to use Subversion integrate in Eclipse with Subclipse.

      When I'm working on a project where I have NO IS&T to support me I set up my own Subversion server on an Apache box (usually my own machine) download Eclipse, point it to the update sites for all the above and it's off to the races!

      --
      XML is a known as a key material required to create SMD: Software of Mass Destruction
    2. Re:SVN by PeteABastard · · Score: 1

      The parent is good advice for a project, but just in case your focus is on code snippets, heres what I do. Within my projects I generally have a directory especially for library or utility code named something like lib. Within this are modules which contain related classes or functions, for example date handling routines. They might include common conversions, date dropdowns etc (try not to duplilicate anything in php's own libraries, but certainly wrap them to make common uses easier). Then any page within your site can include these routines easily (add the directory to the path), and its easy to just grap the whole directory of your utility files for the next project. For a more detailed discussion on this and other topics around the practicalities of code read Code Complete by Steve McConnell. Dont be put off by the fact its a Microsoft Press publication. I'm a Linux zealot and its the most influential book I've ever read on coding. Peter

    3. Re:SVN by Anonymous Coward · · Score: 0

      Question: I run a small web developer business as well. I just installed CVS (which I should upgrade to SVN, but that's besides the point). We manage each of our web projects for clients as seperate models in the repository.

      Now, deploying is a pain in the ass! Right now I have no good solution. I can either:

      1. delete the entire contents on the web-server and reupload which may delete configuration files, etc.
      2. Upload only the files that have changed, but this I have to remember from memory and it doesn't remove files that may have been deleted/renamed since the last upload.
      3. Just upload all the files right over the top of the old files, which presents the same problems as #1 and #2.

      There has to be a better way. Any suggestions? To recap: what is the best way to deploy updates to a web project stored in CVS/SVN to a webserver?

  10. Old code by SysKoll · · Score: 4, Interesting
    I have code I wrote 15 years ago in an "archive" dir in my home directory, subdivided by projects.

    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/

    1. Re:Old code by Anonymous Coward · · Score: 0

      This is the FIRST realistic response i've seen in this entire discussion. Honestly, when you've been coding for a decade, you're still learning enough every six months that you'd be embarassed by what you wrote that long ago.

    2. Re:Old code by Anonymous Coward · · Score: 0

      Are you talking about code written on the job or at home? Also, doesn't it make a difference how similar the project you work on in your own free time is to the one you work on at work (e.g. database code at work, and graphics code from a game at home)?

    3. Re:Old code by Anonymous Coward · · Score: 0

      Or a chair

    4. Re:Old code by TheQuantumShift · · Score: 1

      In other words, leave the animated GIFs of the company logo, but keep the code.

      --

      Shift happens. Fire it up.
    5. Re:Old code by funpet · · Score: 0

      Based on his question, he's not a professional programmer, so keeping all his code would be fine.

      OOP is key for code reusability. If you write code with reusability and extensibility in mind, it will take longer to code, but you won't have to do it again.

    6. Re:Old code by Anonymous Coward · · Score: 0

      This depends on the papers you signed when you got hired. Most papers state that any and all work you do during your employment is own by your current employer. The logic usually being that your work must be inspired by whatever they ask you to work on.

      The way around that argument (but maybe not all the document you signed) is to always work on personal project that are totally unrelated (work on a game when at work you create a DNA analysis application).

      In any case you should make sure to keep your work at work and home at home. Even an internet access to your work from home can bring your trouble. This has been in courts already (IANAL), and is a reason I never ask for work access from home (that and once I have access I am expected to be on call 24/7).

      Personally I always bring debugging tools everywhere I go. If it is necessary, that is if I had to sign a very restrictive paper, I make a list of my lib tools, name and description, I write a note that the code was developed before my hiring date, that it is used in several commercial product I worked for before, I give it for free to my employer, but me and my future clients might also use it. When explained how much dev time I save, I never got problems.

      Just make sure that every single file has a header with your name and a dev date previous to your hiring. Be careful to any additions to the library, I prefer to re-code them at home (second writing is always better anyway), I make code generic for any case and ready for the next job.

    7. Re:Old code by Maximum+Prophet · · Score: 1

      Few of my former employers even know which code I wrote, and which was copied from publicly available sources. (Like the examples in books) Some of the code is based on GPD'd code, so it inherits that license. Hmm, is the GPL an object-oriented license? Does it support multiple inheritance?
      Remember - A simple recipe isn't copyrightable. What's copywritten is the expression of that recipe, either in a collection or with other explanitory text. Thus a library routine that sorts based on date isn't copyrightable, but the program that uses it is.

      Of course I don't write code that is published, just used in house, so there's no way for a former employer to examine my code.

      --
      All ideas^H^H^H^H^Hprocesses in this post are Patent Pending. (as well as the process of patenting all postings)
    8. Re:Old code by slapout · · Score: 1

      Most employers specify that code written by employees belongs to the company.

      Well, what if (before you start working there) you create a library of your code and make the library freely available on the internet. Then you can include your library in the code you write for the company and they shouldn't be able to claim ownership (of the library functions).

      --
      Coder's Stone: The programming language quick ref for iPad
    9. Re:Old code by SysKoll · · Score: 1
      In that case, the code you make available for free needs to be explicitely covered by a public domain license. The GPL won't cut it if you don't want your target code to be GPLed.

      But this doesn't cover the case where you change jobs. I very much doubt that any private company paying you to work on proprietary code would let you put in on the Web when you're leaving.

      --

      --
      Mad science! Robots! Underwear! Cute girls! Full comic online! http://www.girlgeniusonline.com/

  11. Re:Oh - My - God by MyLongNickName · · Score: 5, Insightful

    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
  12. Read the label by Anonymous Coward · · Score: 0

    Like the label suggests, I store my code in a cool, dry place. Duh.

  13. On your hard drive? by level_headed_midwest · · Score: 0, Redundant

    That's where I store mine: /home/user/code.

    --
    Just "gittin-r-done," day after day.
    1. Re:On your hard drive? by Anonymous Coward · · Score: 0

      That's begging for trouble.  There's going to be confusion of what code is for where.  I'd highly recommend against such a solution.

      The correct way to do it is to have:
      /home/user/play
      /home/user/work

    2. Re:On your hard drive? by corychristison · · Score: 0

      Or how about: /home/user/code/play/ /home/user/code/work/

      ? :-)

  14. Re:Oh - My - God by Jeff+Benjamin · · Score: 1

    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.

  15. Don't know of any software packages, but... by jkauzlar · · Score: 4, Informative
    In an ideal world, I would have my libraries kept in some safe server-space somewhere, probably with versioning control implemented. Then I would organize the code into directories for each language, and then by usage, then the actual package. You're probably not going to access it THAT much, so a descriptive readme file with each package would be necessary as well. Nor would you probably need an advanced cataloguing system... but a fun project would be to create a web-based one.

    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? :)

    1. Re:Don't know of any software packages, but... by toddbu · · Score: 1
      probably with versioning control implemented.

      Probably? Version control is great for everything, perhaps with the exception of stuff you TiVo.

      --
      If you don't want crime to pay, let the government run it.
  16. I don't by Anonymous Coward · · Score: 0

    I don't, it's pretty easy to reverse binaries to assembly code :-)

  17. Subversion, disks, www by mrseigen · · Score: 1

    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.

  18. Re:Oh - My - God by QuantumG · · Score: 0, Troll

    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.
  19. sourceforge by Anonymous Coward · · Score: 0

    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.

    1. Re:Sourceforge by Anonymous Coward · · Score: 0

      I create a project around it and submit to Sourceforge as a GPL project. Someone might get interested in the stuff and the APIs could have a chance to have a life of their own.

      No offense to you personally, but this must be why I find so much worthless crap on SF whenever I search for something.

  20. Don't bother...yet. by Anonymous Coward · · Score: 1, Insightful
    If you're really a novice programmer then anything you would be likely to save for later will be so simple that when you get to be an intermediate programmer you'll implement it from memory in a few lines (or be aware of library routines that do what you want).

    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.

    1. Re:Don't bother...yet. by AKAImBatman · · Score: 1

      If you're really a novice programmer then anything you would be likely to save for later will be so simple that when you get to be an intermediate programmer you'll implement it from memory in a few lines (or be aware of library routines that do what you want).

      Indeed. If he has a JavaScript library, it's probably something along the lines of the stupid "mm_OpenWindow" "API" that was so popular for a while. (Hello? window.open(), people?) Not to mention antique browser detection routines that just aren't worth the trouble anymore.

      You haven't actually coded in JavaScript until you've built Object Oriented libraries, learned to cast everything (stupid loose typing, I want an INT, not a string!), and learned the voodoo of the DOM. (And how Microsoft doesn't support it. Boo! Hiss!)

    2. Re:Don't bother...yet. by LordMyren · · Score: 1

      Yeah i just ran smack into the IE/no-dom jerk off yesterday. Fan fucking tastic.

      No, I think there's real value to having your existing code to know what you did. Often beginning code is a process of doing things a bunch fo times till you find something that works. The truly dogged find something that works well. Especailly in the latter case, having the answer to old problem sets someplace on disk can be infinitely useful.

      Then again, I often change languages. I just wrote my first non-trivial perl program in probably five years. Having reference material of my own creation is invaluable for reasons exactly like this. Even Oreilly's ____ in a Nutshell's usually got nothing on looking at some of my own old code.

      Myren

  21. Why is there no mention of version control? by Inoshiro · · Score: 0, Redundant

    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.
    1. Re:Why is there no mention of version control? by hibiki_r · · Score: 1

      Except when you are working in a large project with a large team. In that case, the cost of SVN's extra features becomes quite painful.

      With just one developer though, SVN's features will matter more than the performance issues.

  22. Re:Oh - My - God by GoofyBoy · · Score: 3, Insightful

    >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.
  23. We use files by mnmn · · Score: 0, Redundant

    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
  24. I store my code... by Anonymous Coward · · Score: 0

    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...

  25. Re:Oh - My - God by Eideewt · · Score: 1

    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.

  26. Re:Oh - My - God by mctk · · Score: 1
    "What I don't think is ok is being ignorant and asking others for advice without doing any basic research yourself."

    Why not?

    --
    Paul Grosfield - the quicker picker upper.
  27. Re:Oh - My - God by iamelgringo000 · · Score: 1

    Now, now, boys. Be nice to the noob.

  28. Re:Oh - My - God by toddbu · · Score: 1
    He is at the beginning of the curve. Laughing at him won't help.

    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.
  29. Gmail. by JohnnyLocust · · Score: 5, Interesting

    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.

    1. Re:Gmail. by matthewg42 · · Score: 1, Interesting

      I wonder what implications the terms of using gmail have for your code... Maybe Google own it now?

    2. Re:Gmail. by lewp · · Score: 1

      That's smart. I've got a CVS repository on my main machine that's rsync'd nightly to my laptop and a remote box, but I like your idea better :).

      --
      Game... blouses.
    3. Re:Gmail. by johndmann · · Score: 1

      I can just imagine some company doing such a thing.

    4. Re:Gmail. by klep · · Score: 1

      And when Google goes bankrupt? or it just bubble-explodes, and takes down all the data with it? Unless you do the backups, you are not in control.

    5. Re:Gmail. by Grab · · Score: 1

      The key requirement is offsite backups. That way, if your house burns down (or a burglar rips off your PC and all surrounding CDs), all your data is still safe.

      There's no requirement for a backup to exist forever. If you burn CDs or DVDs to back up, you'll want to redo your backups every 5 years or so, bcos they don't last forever. Similarly, if Google happens to be crashing and burning, it's time to get a new place to put your data.

      "Backup" is a continuous process, not a one-shot deal.

      Grab.

    6. Re:Gmail. by silvertemplar · · Score: 1

      Don't forget GSpace [plugin for Firefox] which turns your Gmail into a FTP-account via email. Interface looks like FTP and you "copy" your stuff across into virtual folders . In the end it's all just email with attachments.

    7. Re:Gmail. by Anonymous Coward · · Score: 0

      Wow! What a good idea.

      (Note to self: steal idea, make fortune).

    8. Re:Gmail. by JohnnyLocust · · Score: 1

      And when Google goes bankrupt? or it just bubble-explodes, and takes down all the data with it? Unless you do the backups, you are not in control.

      A good sign the apocalypse is nigh, so my source probably won't be much use by then :)

    9. Re:Gmail. by Anonymous Coward · · Score: 0

      I also use Gmail to back up my code, but I make sure I encrypt it first.

    10. Re:Gmail. by Sithgunner · · Score: 1

      Although I wouldn't store codes that don't want to be read by someone else over to someone else's server over plain text protocol.

      I just, like you, tar bz2 it up and store them under project folder with project name.
      Of course, for availability, there's always SCP and putting backup on another server of your own will keep it there in safe, although you need to tighten up your server, otherwise it has more break in possibility than putting on Gmail...but this is just general stuff to do with any server you own.

    11. Re:Gmail. by lewp · · Score: 1

      Then I'll still have the main copy of my data that resides on my own box?

      --
      Game... blouses.
    12. Re:Gmail. by DimGeo · · Score: 1

      That's what I do with my pet projects as well.

  30. Quoth Linus Torvalds: by Philip+K+Dickhead · · Score: 0, Offtopic

    "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
  31. A source-control-revision-system-what-huh-who? by GoofyBoy · · Score: 2, Interesting


    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. 06/VersionControlAndTheDeveloper/

    --
    The surprise isn't how often we make bad choices; the surprise is how seldom they defeat us.
  32. Put it on the web by republican+gourd · · Score: 3, Interesting

    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

    1. Re:Put it on the web by Anonymous Coward · · Score: 0

      Bookmarket Generator - Generate your own bookmarklets like the ones below without having to mess with any javascript.

      You misspelt bookmarklet.

    2. Re:Put it on the web by khakipuce · · Score: 1

      This is the way to go. I keep most of my stuff on a webserver and then I can access it from anywhere I work (or just about) - also duplicate a lot of this on a USB pen drive. There is nothing worse than spending 4 hours solving a problem only to have to solve the same thing again a year later because you don't have access to the code you generated last time.

      There are lots of suggestions here about version control systems - these are good (SVN/Tortoise is excellent - I use it all the time) but offer you nothing if what you want to retrieve a little snippet of code created 18 months ago. What you need is searchable code - either by grep'ing files in a shell or by having a full text search through a web server. (I know one can grep an SVN repo but it adds nothing over stuffing it all in a few directories as far as finding 3 lines of code go).

      If you are doing PHP/JS then it really is a good idea to create re-usable classes, tempting though it is to not bother with the extra code. Once you get into it, it is easy and makes re-use really easy. The more you do, the easier life gets.

      All that said, I find that the things I need are the ones I don't use very often - little shell scripts, one line commands, regexs, etc. I kind of half-heartedly put these in a wiki - it is easy to edit and if I was abit more dilligent about it, it would be a really useful reference resource - may be that's another New Year's resolution to abandon by March.

      --
      Art is the mathematics of emotion
    3. Re:Put it on the web by DaveQB · · Score: 1

      Yeah i agree with this. I have a link on my blog to my software i have developed. Its just an Apache dir listing. But i must admit my software is quite basic :)

  33. Re:Oh - My - God by toddbu · · Score: 1
    ... but he really just a kid (look at his homepage).

    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.
  34. In the shoebox by Anonymous Coward · · Score: 0

    With the sales tax receipts.

  35. Subversion, apache, web-dav auto-versioning commit by mhanoh · · Score: 4, Informative

    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/

  36. my system by Kohath · · Score: 5, Funny

    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.

    1. Re:my system by cperciva · · Score: 1

      I usually print it out and staple it to a squirrel.

      I ran into problems with that approach. If I stapled my code to a squirrel's tail, the squirrel would turn around and chew on it, rendering the code illegible; but if I stapled my code to the squirrel's body, I'd often end up killing the

    2. Re:my system by gbobeck · · Score: 1

      Rookie! I use badgers badgers badgers... magic mushroom.... to store my code.

      --
      Navicula hydraulica plena anguilarum est. Omnes castelli tuus nostri sunt. Ed elli avea del cul fatto trombetta.
    3. Re:my system by aggressivepedestrian · · Score: 1

      Ok, I'll admit this is funny as hell. But what I'm really curious about is who mod'ed it as "informative?"

    4. Re:my system by Anonymous Coward · · Score: 0

      I use a pack of wolverines. They're a clustering implementation of storage, and are less prone to failure (and by failure, I mean being eaten by a pack of wolverines)

    5. Re:my system by i_finally_got_an_acc · · Score: 0
      (Score:5, Informative)

      Mods?????? Explain this please????

      --
      "I'm not religious, but at the same time I don't get why science always has to have something to prove."
    6. Re:my system by gbobeck · · Score: 1

      Yes, but can you install Linux on a dead wolverine?

      --
      Navicula hydraulica plena anguilarum est. Omnes castelli tuus nostri sunt. Ed elli avea del cul fatto trombetta.
    7. Re:my system by Angostura · · Score: 1

      First time for long time that a post has made me laugh out loud. Thank you.

      Now, where did I leave that stapler.

    8. Re:my system by DavidHOzAu · · Score: 1

      Ok, I'll admit this is funny as hell. But what I'm really curious about is who mod'ed it as "informative?"
      Insightful/Informative gives them more karma. BTW, the GP has been modded Funny too. You must be new here.

    9. Re:my system by Anonymous Coward · · Score: 0

      Squirrel? Are you nuts?

    10. Re:my system by jalspach · · Score: 1

      But only if you sit by the window near Milton Waddams
      "...I used to be over by the window, and I could see the squirrels, and they were married, but then, they switched from the Swingline to the Boston stapler, but I kept my Swingline stapler because it didn't bind up as much..."
      Gotta love Office Space!
      http://www.imdb.com/title/tt0151804/

      James

  37. Where to store your code by zobier · · Score: 2, Insightful

    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.
  38. Re:Oh - My - God by Anonymous Coward · · Score: 0
  39. Huh? by Hard_Code · · Score: 1

    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?
  40. I usually chisel them... by Ekhymosis · · Score: 1

    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.
    1. Re:I usually chisel them... by Gryle · · Score: 2, Funny

      Except for Charleton Heston. He'll get mad and smash them on his way down.

      --
      Only two things are infinite, the universe and human stupidity, and I'm not entirely sure about the universe - Einstein
  41. You need to learn the "include" statement by Anonymous Coward · · Score: 0

    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

    1. Re:You need to learn the "include" statement by menkhaura · · Score: 5, Informative

      It may be all you *need* to get started, but I'm sure you know that PHP's OO these days is quite stellar. PHP 5 classes are now complete, with the whole OO shebang: polymorphism, encapsulation, interfaces, C++-like exception handling... the only thing that it doesn't support, and I'm not sure it *is* strictly necessary, is multiple inheritance. For the rest, you should try PHP 5, it is a very mature language and, IMHO, quite suitable for general purpose programming, not only web pages, even more so with the recent release of PHP-QT (there is already a PHP-GTK if that's your poison) for stand-alone GUI applications.

      --
      Stupidity is an equal opportunity striker.
      Fellow slashdotter Bill Dog
    2. Re:You need to learn the "include" statement by Anonymous Coward · · Score: 0

      Yeah yeah, perl too!

    3. Re:You need to learn the "include" statement by menkhaura · · Score: 1

      At the risk of make a fool of myself, what was so funny in parent post?

      --
      Stupidity is an equal opportunity striker.
      Fellow slashdotter Bill Dog
    4. Re:You need to learn the "include" statement by menkhaura · · Score: 1

      s/make/making, of course.

      --
      Stupidity is an equal opportunity striker.
      Fellow slashdotter Bill Dog
  42. API's and Libraries by sterno · · Score: 5, Informative

    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
    1. Re:API's and Libraries by Danyul · · Score: 1


      Thanks for the advice. One question, though- is there any reason to choose CVS instead of SVN, other than a case in which a project is already using it?

    2. Re:API's and Libraries by sterno · · Score: 1

      SVN would work too. I've always used CVS but the concept is the same.

      --
      This sig has been temporarily disconnected or is no longer in service
    3. Re:API's and Libraries by Anonymous Coward · · Score: 0

      No. I've used both (in fairly simple cases, admittedly), and SVN rules. In particular:

      - It handles directories properly (renaming one in CVS requires you to add a new one and "delete" the old; and you can't actually delete directories.)
      - The status system's far nicer. `svn status` gives you a complete rundown of the files in your project directory, which are modified, which new, which deleted, properties modified, and so on.
      - (*NIX-only) You can include simlinks in the repository and they checkout AS simlinks...
      - There's a nice on-line manual: http://svnbook.red-bean.com/

    4. Re:API's and Libraries by Anonymous Coward · · Score: 0

      It's like have CTRL+Z for your entire project.

      Only problem is you have to `fg` it to get anything useful.

    5. Re:API's and Libraries by Castar · · Score: 1

      Google Desktop Search is awful for finding code. I actually sent them comments along these lines, too. The problem is that Google's search algorithm ignores a lot of punctuation and other characters that don't add a lot of meaning in regular English text. However, when you start dealing with code, they become incredibly important. It's hard to search for particular functions when parentheses are ignored, for example. I actually find the Windows "Search" tool to be superior for searching code files, which says a lot.

      What I'd like to see is an extension that uses Google's brains to make searching code even easier - being able to find the declaration of a function, for example, or every time where you add to a variable rather than subtract from it, or things like that.

      --
      I yearn for you tragically. A. T. Tappman, Chaplain, U.S. Army.
  43. you can use cookies by circletimessquare · · Score: 5, Funny

    to retrieve that information

    --
    intellectual property law is philosophically incoherent. it is your moral duty to ignore it or sabotage it
    1. Re:you can use cookies by pionzypher · · Score: 1

      Squirrel please....

      --
      I'll believe in corporations having personhood when Texas executes one... - advocate_one
    2. Re:you can use cookies by Anonymous Coward · · Score: 0

      that's nuts!

    3. Re:you can use cookies by Enigmafan · · Score: 2, Interesting

      >I'm making a Low Budget HDV Filipino Horror Movie in NY [griefmovie.com]

      To be very honest, it's not very exciting (yet?). Why is the main character walking around so slowly? The telephone conversation at the beginning... Well, no-one talks like that in real life. Am I missing something? Is it that I'm Dutch and don't get it?

    4. Re:you can use cookies by Tellarin · · Score: 3, Funny


      That really gives a whole new meaning to *random* access memory.

  44. Comment removed by account_deleted · · Score: 1

    Comment removed based on user account deletion

  45. Come on, it's PHP by Anonymous Coward · · Score: 1, Insightful

    You're supposed to write new code from scratch for every PHP project you do. You obviously must not have browsed freshmeat lately.

  46. Re:Oh - My - God by theStorminMormon · · Score: 5, Insightful

    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.
  47. Projects and Archve by Psionicist · · Score: 1

    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.

  48. Freeze dried and shrink wrapped by Anonymous Coward · · Score: 0

    Ok, I really don't code.

  49. Re:Oh - My - God by theStorminMormon · · Score: 5, Insightful

    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.
  50. two issues here by blue_adept · · Score: 4, Interesting

    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?"
    1. Re:two issues here by Anonymous Coward · · Score: 0

      Where do you store you PGP key? Flash memory stick?

    2. Re:two issues here by Ezerick · · Score: 1

      (written in a language that doesn't encourage re-usability to boot)

      We are talking about PHP right? Exactly how does it not encourage re-usability? I've coded PHP for a living and never had problems reusing code with minor changes such as altering parameters in functions and the like.

    3. Re:two issues here by hazah · · Score: 1

      As far as my own experience goes (PHP/MySQL), the only thing I find that's missing is namespaces.

    4. Re:two issues here by Urkki · · Score: 1

      I've coded PHP for a living and never had problems reusing code with minor changes such as altering parameters in functions and the like.

      That's not actually "reusability", that's copy-paste-edit coding, which is a reusability nightmare. As soon as you have slightly altered versions of of same code, and then you find a bug in that code, you'll have hard time fixing the bug in all the places. Or if you don't plan to do that, then you'll have hard time remembering which instances of this code has the bug fixed and can be further copied, and which shouldn't be copied since they still contain the bug. If it doesn't sound like a big issue, then multiply that by a hundred snippets of copy-paste-edit code, and a few generations of bugs...

      Version-controlled copy-paste-edit code snippet library certainly can have it's uses, and it can make small things easy, but it isn't real re-usability.

    5. Re:two issues here by CortoMaltese · · Score: 1
      Some ppl here are recommending cvs and other such overkill. If your a novice PHP coder, none of that matters... At this point, you biggest concern should be storage for sake of making frequent backups.

      I don't see why version control wouldn't matter for novice programmers. At that stage, there's probably more iteration and trial-and-error than amongst seasoned programmers. Storing the various trials as branches in a repository makes life so much easier than having a dozen directories with the slightly different variants in them.

      Setting up a versioned filesystem repository (FSFS) for SVN is a breeze. You can make backups of the repository. I don't think it's overkill at all.

    6. Re:two issues here by blue_adept · · Score: 1

      I dont use keys, I just create self-extracting archives, change their extension from .sda.exe to something else, and then upload them. When you execute the archive it queries you for a password. I find the archives to be quite small too.

      --

      "Is this just useless, or is it expensive as well?"
    7. Re:two issues here by Anonymous Coward · · Score: 0

      Well actually there are many issues. If you are keeping code for yourself to use in your own personal projects (case 0) you are in a different situation than if you are maintaining the code for commercial reasons. If you are employed as a programmer, in most cases the code belongs to your employer (case 1). One common exception to this is consulting or similar code-for-hire situations (case 2). In that case, the code often belongs to the person who hired you or your employer.

      In case 0, do whatever you want.
      In case 1, it is unethical and sometimes illegal to share code developed at one company with another company.
      In case 2, the contract governing the relationship will spell out what can (or cannot) be done with the code. Some consulting firms retain the software rights so that they may use it in subsequent projects (thus building a library of expertise). Other contracts will require all such software rights to be retained by the customer who asked for it to be written.

      Finally, beyond these legal and ethical issues, you must decide if you are concerned with backup, maintenance, or code re-use. Backup protects against disk/system failure. Maintenance requires some form of software configuration management (SCM) to track changes that correct (and sometimes cause) software errors. Code re-use involves software design practices and arrangement of libraries. All three of these topics answer the question "How Do You Store Your Previously-Written Code?" but do so in different ways.

    8. Re:two issues here by AIM31 · · Score: 1

      Um - generally if I write a class or function or something that might be useful again, I put it in a seperate file and require() it - you can put it in a seperate folder and call it from multiple projects. Places like phpclasses.org index these (although admittedly much of what is there is librarys, if you can really see a difference). Can you give an example (excluding namespaces, which I think we all already know about and from my experience aren't actually that useful - as long as you name your classes properly) of a language that does encourage this? And how it does it?

  51. Re:Oh - My - God by theStorminMormon · · Score: 1

    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.
  52. CS101? by redblue · · Score: 1

    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.

  53. cards by Lehk228 · · Score: 1

    why punch cards of course, what else would you use to store your code?

    --
    Snowden and Manning are heroes.
    1. Re:cards by freeasinrealale · · Score: 1

      paper tape

      --
      A man spends the first half of his life accumulating stuff, the second trying to get rid of it all.
  54. 1 file by MrCawfee · · Score: 3, Funny

    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.

  55. Sourceforge by zanderredux · · Score: 2, Informative
    I create a project around it and submit to Sourceforge as a GPL project. Someone might get interested in the stuff and the APIs could have a chance to have a life of their own.

    Once in Sourceforge, you get CVS and all the goodies. Better than using GMail for it.

  56. Function FIle by boxxa · · Score: 1

    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
  57. In a tagged, public code snippets site by Peter+Cooper · · Score: 3, Informative

    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.

  58. Re:my system (cont) by cperciva · · Score: 1

    [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.

  59. Mod parent down by Anonymous Coward · · Score: 0

    STFU. If you don't have anything worth posting, don't.

  60. I forgot by Kohath · · Score: 1

    Patent Pending

  61. So by VonSkippy · · Score: 1, Interesting

    So reading thru the comments, I see my personal favorite of using yellow sticky notes is not a good idea?

    1. Re:So by pjt33 · · Score: 1

      You should use mauve instead. It has the most RAM.

  62. Re:Oh - My - God by SpacePunk · · Score: 1

    I doubt they teach this in skool.

  63. Punched Cards!!! by sk999 · · Score: 1
    I learned to program in the days of punched cards. Think of one card as one line of code. A complete program is a card deck. The card deck is stored in a card box. The box is important - it is your "code repository".

    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!

    1. Re:Punched Cards!!! by Anonymous Coward · · Score: 0

      " The most difficult problem with storing code [ ... ] is this: REMEMBERING WHERE YOU PUT IT "

      Well if you're old enough to remember punched cards it's no surprise if you're going a bit gaga in your dotage! :)

  64. Harddrive? by nukem996 · · Score: 0

    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 ;)

  65. You can always... by whitespiral · · Score: 0

    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.

  66. Re:Oh - My - God by SpacePunk · · Score: 1

    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.

  67. Don't bother by twistedcain · · Score: 0, Troll

    If you keep reusing the same code it will never get any better, nor will you.

  68. Subversion + Trac by Anonymous Coward · · Score: 0

    http://www.berlios.de/ - free for open source projects
    http://wush.net/ - for commercial projects

  69. The trick... by NoMoreNicksLeft · · Score: 1

    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".

  70. Old code by ENOENT · · Score: 0, Troll

    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.
  71. Some Will Be Lost by kwalker · · Score: 1

    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.
    1. Re:Some Will Be Lost by Mad+Marlin · · Score: 1

      You really need to learn to use this invention called a paragraph. Please.

    2. Re:Some Will Be Lost by kwalker · · Score: 1

      There are breaks in the text. Slashdot ate them for some reason. Don't believe me? View the source.

      --
      ... And so it comes to this.
  72. Re:Oh - My - God by SpacePunk · · Score: 1

    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.

  73. Re:Oh - My - God by b17bmbr · · Score: 1

    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.
  74. Thats what I do too. by Anonymous Coward · · Score: 0

    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.

    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 ..or..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.

  75. Simple... by Anonymous Coward · · Score: 0

    /bin/rm -f -r $HOME/code

  76. REAL MEN! by furry_wookie · · Score: 1, Insightful



    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.
  77. simple library of files by se1256 · · Score: 1

    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.

  78. Don't Use CVS by kbahey · · Score: 4, Informative

    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.

    1. Re:Don't Use CVS by JPyObjC+Dude · · Score: 3, Informative

      Very true.

      I analysed and deployed a SVN repository for my team two years ago and I love it more every day.

      It is stupidly easy to configure and maintain (as opposed to CVS) and very powerful. The only thing I really miss with Subversion is an obliterate command which hopefully will come around some time.

      If you have to windoze your way around, get TortoiseSVN - Once of the best Open Source Win32 projects available.

      As a side suggestion about managing your documents, it is a good idea to get anal about foldering your files and maintaining consistent naming conventions in your repositories.

      eg.
      repo/trunk/
      ~repo~/branch/dev ~~ Developmental Branches
      ~repo~/branch/rel ~~ Release Branches (Trunk branches)
      ~repo~/trunk ~~ Trunk Releases

      JsD

    2. Re:Don't Use CVS by JulesLt · · Score: 1

      Any good sites / pointers as to why Subversion beats CVS?

      --
      'Capitalists of the world, unite! Oh ... you have' (League Against Tedium)
    3. Re:Don't Use CVS by gbjbaanb · · Score: 1

      If you plan to share the code in an Open Source project with many people

      then look into something that they might actually have heard of and have client tools for, not the most obscure scc system you can find.

      SVN and CVS are both excellent choices, free, and popular with lots of different clients.

    4. Re:Don't Use CVS by gregoryb · · Score: 1

      If you have to windoze your way around, get TortoiseSVN - Once of the best Open Source Win32 projects available.

      As an aside, does anyone know if there is anything similar to TortoiseSVN for linux? I use TortoiseSVN at work since I'm on windows there and absolutely love it. Easily the most useful app on my box. It would be cool if there was something out there for linux that was similar.

      gb

    5. Re:Don't Use CVS by vortigern00 · · Score: 1

      > As a side suggestion about managing your documents, it is a good idea to get anal about foldering your files and maintaining consistent naming conventions in your repositories.

      "foldering" ? What the?

      You've been made, project manager. Verbing nouns will give you away every time. Now where did you learn about SVN? Who are you working for? Which geeks violated our trust and imparted you with knowledge you aer not worthy of?

    6. Re:Don't Use CVS by JPyObjC+Dude · · Score: 1

      I agree Foldering is probably not the best word but it does get the point across but since I have been working stupid amounts of hours lately, my veriage engine is not the most efficient at the moment.

      BTW - I am a self taught programmer working on very siginificant projects for a very big company. The fact that I sound like a PM scares the !@#$!@ out of me :]

    7. Re:Don't Use CVS by kbahey · · Score: 1

      CVS is antiquated by today's standards.

      It suffers from several drawbacks, and SVN does address those.

      For example, if you move or rename a file or directory in CVS, you lose its history.

      Supposed you have a file called foo.c that you have been committing to for months, and then decide that instead of being in directory src/blah, it should be src/blat. Or if you want it to be simply bar.c. You do a cvs remove and then a cvs add, and bingo: you lost all the history of that file. It will go back to 1.1.

      SVN handles that nicely.

      The other thing in SVN is that commits are set at a time, not file at a time. Each commit has a unique number that spans all the files, and you can arbitrarity branch the entire project at any point back, without the need to have a tag.

      Those are from my own experience. I have been using CVS for the past years, both professionally and in open source projects that I contribute to (have you done any Drupal lately?).

      CVS is showing its age. SVN is much better.

    8. Re:Don't Use CVS by Gambit253 · · Score: 1, Funny

      In my dictionary "verb" is a noun, so I guess you're a project manager too.

    9. Re:Don't Use CVS by Anonymous Coward · · Score: 0

      >As an aside, does anyone know if there is anything similar to TortoiseSVN for linux?

      Google for 'eSvn'.

    10. Re:Don't Use CVS by Castar · · Score: 1

      A good SCM that no one has mentioned so far is Perforce - it's what seemingly everyone uses in the game industry. It's really overkill for individual people, but they'll give you a free two-user license. It's a pleasure to use, and much more friendly than SVN or CVS. The client also runs on Linux, Windows, and OSX if you do multi-platform development.

      --
      I yearn for you tragically. A. T. Tappman, Chaplain, U.S. Army.
    11. Re:Don't Use CVS by DrXym · · Score: 1
      If you have to windoze your way around, get TortoiseSVN

      And if you use Eclipse get Subclipse. It integrates perfectly.

    12. Re:Don't Use CVS by JulesLt · · Score: 1

      Ta. I'd forgotten about the non-atomic commits - we had the same problem back with SCCS and ended up implementing an application that sits as a wrapper around RCS, SCCS, and now CVS repositories, maintaining a database of versions (and applying a common stamp tag in CVS case). Looks like we could eliminate a whole load of code / maintenance.

      --
      'Capitalists of the world, unite! Oh ... you have' (League Against Tedium)
    13. Re:Don't Use CVS by JulesLt · · Score: 1

      Ta. Google is good, but drawing on the knowledge of experienced developers is better.

      --
      'Capitalists of the world, unite! Oh ... you have' (League Against Tedium)
  79. Re:Oh - My - God by IsThisBl**dyNameUniq · · Score: 1

    Well said.

    It is better to aska question and be thought ignorant than to not ask and remain ignorant
    (sorry can't attribute it)

  80. Reusable code by cagle_.25 · · Score: 1
    Beyond archiving, the best advice I could give is

    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.
    1. Re:Reusable code by geminidomino · · Score: 4, Funny

      There's nothing worse than coming back to your code a year later and asking, "What the *&$#^& was I thinking here?"


      Not true.

      You could come back to your code a year later and think: "What the...? What kind of "Teach yourself C in 24 hours" mental midget committed THIS? This idiot should be fired... into space! He's...uh... oh, damn..."

    2. Re:Reusable code by russh347 · · Score: 1

      The code done yesterday should be as good as you could make it
      yesterday. The fact that you know more today, and are more capable
      today, is good news about today, not bad news about yesterday.
      --Ron Jeffries

  81. save code and notes by gregorlowski · · Score: 1

    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...

    In ~/notes I keep subdirs: /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.

    I keep my /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.

    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.

  82. And Dick Cheney... by djward · · Score: 3, Funny

    ... to erase it.

    1. Re:And Dick Cheney... by HolyCoitus · · Score: 3, Funny

      We're talking about the code or the coder?

      --
      That's scary.
    2. Re:And Dick Cheney... by Anonymous Coward · · Score: 0

      That won't work. He suggested stapling your code to a squirrel, not a hunting buddy.

  83. Store it? by rubicelli · · Score: 1

    I just let it propagate via Microsoft Outlook.

    1. Re:Store it? by eyepeepackets · · Score: 1

      Damn dude, that was seriously funny but you've not gotten the mod. Sheesh, must be serious night on /.

      Thanks for the laugh!

      --
      Everything in the Universe sucks: It's the law!
  84. Well, look how other (good) programmers do it: by guruevi · · Score: 1

    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
  85. email by rich_r · · Score: 3, Funny

    To Chuck Norris. He's got infinite storage space, but recovering the files will almost certainly involve a roundhouse kick.

  86. Re:Oh - My - God by QuantumG · · Score: 1

    I suggest you shut your hole.

    --
    How we know is more important than what we know.
  87. My Retarded Method by Stopher2475 · · Score: 1

    I put it in a text file and send it to my gmail account. Label it as programming and archive.

  88. Version control plus backups, and organization by Rudd-O · · Score: 0, Redundant

    I have a recipe which has served me well for years. If you want to know more, read:

    http://rudd-o.com/archives/2006/02/16/how-do-i-sto re-my-previously-written-code/

    --
    Rudd-O - http://rudd-o.com/
    1. Re:Version control plus backups, and organization by Achromatic1978 · · Score: 1

      Dude, we saw it the first time you pimped it in this article, we don't need to see it again.

    2. Re:Version control plus backups, and organization by Achromatic1978 · · Score: 1

      And when I did see it, I took the liberty of blocking the FOUR ads you conveniently had on the page.

    3. Re:Version control plus backups, and organization by CmdrGravy · · Score: 1

      Don't bother following the link, his recipie is "Use Subversion" but he needs a lot of ads to bring you that information.

  89. README files, directory structure by urdine · · Score: 1

    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.

  90. Re:Oh - My - God by tloh · · Score: 1

    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. 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 /.ers would consider appropriate. If they are willing and brave enough to ask, they deserve any help they can get.

    --
    Stay sentient. Don't drink bad milk.
  91. Re:Oh - My - God by yorkpaddy · · Score: 2

    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 .k.p ,.by xprt. gbe.p.oycmaycbi yd. cby.nci.bj. ru yd. am.pcjab lgxlcj" don'
  92. Version control plus backups, n' good organization by Rudd-O · · Score: 1

    I have a recipe which has served me well for years. If you want to know more, read:

    http://rudd-o.com/archives/2006/02/16/how-do-i-sto re-my-previously-written-code/

    --
    Rudd-O - http://rudd-o.com/
  93. Version control plus backups, 'n good organization by Rudd-O · · Score: 0, Redundant

    I have a recipe which has served me well for years. If you want to know more, read:

    http://rudd-o.com/archives/2006/02/16/how-do-i-sto re-my-previously-written-code/

    (this post contains the valid link, the others I couldn't edit and I don't know why)

    --
    Rudd-O - http://rudd-o.com/
  94. Re:Oh - My - God by nko321 · · Score: 1

    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.

  95. Re:Oh - My - God by Anonymous Coward · · Score: 0

    "look at his homepage"

    Which is surviving a slashdotting.

  96. Just gmail it by mattcoug · · Score: 1

    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.

    1. Re:Just gmail it by klang · · Score: 1

      you know, that you can mount your gmail account as a network drive, right?
      (http://www.viksoe.dk/code/gmail.htm)

      and yes, for source code, 2+ gigs lasts a while ..

  97. Use Post it's by quadrocerebra · · Score: 1

    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
  98. Re:Version control plus backups, 'n good organizat by Wabbit+Wabbit · · Score: 1

    Would have loved to read this, but your page breaks bigtime in Safari.

    --
    Nothing is inexplicable; only unexplained -Tom Baker, Doctor Who
  99. Re:Oh - My - God by transient · · Score: 1

    Looks like you need more practice.

    --

    irb(main):001:0>
  100. Re:Oh - My - God by QuantumG · · Score: 1

    I know you are but what am I?

    --
    How we know is more important than what we know.
  101. Re:my system (cont) by WhiteWolf666 · · Score: 2, Funny

    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
  102. Start with a well organized directory by syousef · · Score: 1

    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
  103. if it's just your code by coaxial · · Score: 1

    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.

  104. Re:Oh - My - God by toddbu · · Score: 1
    Great comments, even though I think you're wrong. :-)

    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.
  105. Don't Laugh! Will there be CD/DVDs in 50 years? by BigBlockMopar · · Score: 2, Insightful

    Printed out, of course. File cabinets full. :-D

    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.
    1. Re:Don't Laugh! Will there be CD/DVDs in 50 years? by pclminion · · Score: 1
      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.

      Actually, I'd print two versions for paper archiving -- one human readable, and the other in some sort of error-correcting barcode format. That way you don't need OCR to get the code back into digital form, just a barcode scanner, which is much more reliable.

    2. Re:Don't Laugh! Will there be CD/DVDs in 50 years? by owlstead · · Score: 1

      Uh, I can remember getting games this way. Actually, my mother sometimes helped and read the applications. In MSX BASIC with machine code :)

      1560 DATA 3E, 22, C9, F3, 23, 5E, EE, AA, well, you get the drift.

      And then the game did not run. Ok, start reading again.... 2E - noo 2D, darn.

    3. Re:Don't Laugh! Will there be CD/DVDs in 50 years? by BigBlockMopar · · Score: 1

      That way you don't need OCR to get the code back into digital form, just a barcode scanner, which is much more reliable.

      Sure! It's great, but... let's say RFID takes over and UPC codes (and other barcodes) are gone within 5 years.

      --
      Fire and Meat. Yummy.
    4. Re:Don't Laugh! Will there be CD/DVDs in 50 years? by pclminion · · Score: 1
      Sure! It's great, but... let's say RFID takes over and UPC codes (and other barcodes) are gone within 5 years.

      Yeah, but suppose RFID is taken over by... You could follow that argument a long ways. All a barcode requires is paper and ink (hell, you could impact print it on a sheet of soft metal for better longevity) and it can be decoded by hand if necessary.

    5. Re:Don't Laugh! Will there be CD/DVDs in 50 years? by pclminion · · Score: 1
      That's what was cool about the MLX tool from Compute!'s Gazette (for Commodore 64). Each 16 byte (or was it 8 byte) line had a CRC code at the end and the program would BZZZT you if you typed in a byte incorrectly.

      Typing in 13k of machine code is pretty tedious but I always enjoyed running the programs after entering them in.

  106. My thoughts... by Anonymous Coward · · Score: 0
    I may be reading too much into the question, but to me it is rather apparent that this novice coder has asked a very insightful question about the nature of programming. Ostensibly he's just asking, "How do I store my code for reuse?" However, if you read between the lines, I think he's really asking if there's a practical way to automatically include only the portions relevant to his future programs. In other words, he's looking for the scripting language analogy of a link editor in a compiled program. Unfortunately, no such tool exists, but it's worth explaining so that perhaps some enterprising young mind will come along and create such a tool!

    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:

    <SCRIPT LANGUAGE="JavaScript" SRC="path/to/mylibrary.js">
    </SCRIPT>

    In PHP, you'll just put

    <?php
    include 'path/to/mylibrary.php';
    ?>

    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

  107. Re:Version control plus backups, 'n good organizat by Rudd-O · · Score: 1

    That problem is solved now

    --
    Rudd-O - http://rudd-o.com/
  108. Don't. by Anonymous Coward · · Score: 0

    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.

  109. Storing your code is just the beginning by ebuck · · Score: 4, Informative

    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

    1. Re:Storing your code is just the beginning by Anonymous Coward · · Score: 0

      Here's a great write-up on "conceptual approaches to structuring developer's material for re-use and efficiency of development": http://wiki.rubyonrails.org/rails/pages/TheBigPict ure/

      In places this is specific to Ruby on Rails, but key ideas should remain very useful.

    2. Re:Storing your code is just the beginning by dlaur · · Score: 2, Informative
      I combed this thread looking for good advice (and I found a lot of it), but I have one other bit of my own to add. When it comes to designing reusable code, the biggest mistake I have made is to try to design too much reusability in at the beginning. Over time I have found that the true test of reusable code is code that I find that I want to reuse it, not that I intend to reuse it. The distinction is one of simplicity of purpose versus over engineering. If I try to write code that will solve all today's problems, plus all those problems that I can anticipate encountering in the future, I find I am frequently wrong about what I will face in the future. Solve your problem today and if you have the same problem again in the future, you will have reusable code.

      I understand that this is a balance, and that a well thought out design will take future use into account, but I, like many programmers, am a terrible psychic. The parent post seems to address the fact that many times you are best off enhancing/refactoring a library each time a new need arises rather than trying to get it all figured out in version 1.0; I just wanted to emphasize it.

    3. Re:Storing your code is just the beginning by Eivind+Eklund · · Score: 2, Insightful
      There are often good reasons for using distributed VC systems (Darcs, monotone, Arch, BitKeeper, etc) instead of SVN.

      There MAY be a good reason to use CVS in that CVS is slightly more trivial to set up; this Subversion tutoral makes the SVN setup fairly painless, too, though.

      Subversion is likely to give you less pain in the long run than CVS, though.

      <soapbox>
      I think SVN's lack of distribution support might end up being the worst thing to happen to open source ever. Distributed development can boost the open source model A LOT, and CVS suckiness made it much more likely that this would become the norm. Instead, Subversion creates a much higher bar that has to be jumped, delaying the full use of distributed systems a lot, possibly effectively killing it. Unfortunately, people need to think long and carefully about version control, development, hurdles, personal effort economics, and open source culture before the impact of this is obvious.
      </soapbox>

      Eivind.

      --
      Doubting the existence of evolution is like doubting the existence of China: It just shows that you're uninformed.
    4. Re:Storing your code is just the beginning by fishbowl · · Score: 2, Insightful

      CVS integration works really well in Eclipse, SVN integration is promising, but can be unpleasant. This alone keeps me using CVS.

      --
      -fb Everything not expressly forbidden is now mandatory.
    5. Re:Storing your code is just the beginning by muddyblooz · · Score: 1

      [offtopic] Eivind! There you are! Long time no see (Jerry Hicks here). Went retro, I'm building tube amps and playing old school blues in Mississippi these days. Stay well. Regards, J.

    6. Re:Storing your code is just the beginning by Eivind+Eklund · · Score: 1
      Cool! I've also branched out a bit - I'm spending a lot of my time on studying influence, hypnosis, NLP, human attraction, and various aspects of self improvement and therapy. I still live in Oslo and work with programming. I took a brief stint doing sales to test out influence in practice, though.

      Good to hear from you!

      Eivind.

      --
      Doubting the existence of evolution is like doubting the existence of China: It just shows that you're uninformed.
  110. Using Smalltalk, you simply.... by BarnabyWilde · · Score: 1

    ...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

    1. Re:Using Smalltalk, you simply.... by Ian-K · · Score: 1

      Well, you didn't lose me (good old uni years)... but smalltalk is like an old Lambo Diablo. It has many of the nice features built in, what it does it does very well and it's of exceptional build, but it's not very practical for everyday use.

      For our friend who started this topic, what I do is store first by language and then a subdirectory by project (and subdirs with important versions sometimes).

      Having said that, now that I have quite a bit of a code base, sometimes I find it hard to remember what project it was that I wrote a certain small but tricky bit of code. I need to find a solution to that sometime, probably by writing a database of code snippets and store them by keywords & relevance.

      But come to think of it, such an app wont be useful just for code storage. It'll be handy to store all those small but useful pieces of information you collect in every day life (like tips you hear about one thing, maybe you write them down in a small piece of paper and then you lose it) in all sorts of topics: DIY / health / nutrition / history / God knows what.

      If only I were a database & search engine expert :-/

      (nut now I got off topic)

      --
      I'm no longer fed up with MS Windows: I go rid of them :)
  111. Re:Version control plus backups, 'n good organizat by Wabbit+Wabbit · · Score: 1

    And it looks great. Nice job -- and good article too. Glad you fixed it.

    --
    Nothing is inexplicable; only unexplained -Tom Baker, Doctor Who
  112. from another self-taught home user: by Hosiah · · Score: 1

    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!!!

  113. Re:Oh - My - God by Anonymous Coward · · Score: 0

    Regardless of age, this guy is ugly as sin

  114. The short answer: By project. by ThomK · · Score: 1

    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

  115. Re:Oh - My - God by Hosiah · · Score: 1
    I started becoming self-taught on a TRS-80 Model I. The code I wrote was a joke... *high five* Me too!

    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!

  116. I do the exact same thing by bxbaser · · Score: 1

    Id love to swap strategies about it but i have about 14 squirrels to catch before a 9 am metting tomorrow.

  117. Re:Oh - My - God by cjHopman · · Score: 0, Troll
    How about one I can attribute...

    It is better to keep your mouth shut and appear stupid than to open it and remove all doubt. -Mark Twain

  118. To back it up by a famous quote by bain_online · · Score: 1

    "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
  119. How do I store my code? by zeketp · · Score: 1

    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!
  120. Re:Oh - My - God by bleak+sky · · Score: 1

    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.

  121. This calls for quantum statistical analysis by steveoc · · Score: 4, Funny

    This is one of the most complex problems in the realm of computer science, and the answers to this question are less than obvious.

    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 .. I find that a typical Euler-lagrange transformation works a treat, especially when numerising C code.

    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 .. 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.

    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 .. 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.

    So .. 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.

    Best wishes on your journey

    1. Re:This calls for quantum statistical analysis by Anonymous Coward · · Score: 1, Funny

      Wow - did you just make all that up off the cuff, or did you write it years ago, and sit on it, spider like, waiting for the right slashdot post to wander along?

      either way, well done!

    2. Re:This calls for quantum statistical analysis by ObsessiveMathsFreak · · Score: 1

      A word of caution here. Some mathematicians can and do produce results like this, applying insane techniques to simpler problems, resulting in confusion and often incompetance all round.

      --
      May the Maths Be with you!
    3. Re:This calls for quantum statistical analysis by Anonymous Coward · · Score: 0

      Sure, I do that ALL the time. I wonder how do you raise your kids, if you have some... :)

    4. Re:This calls for quantum statistical analysis by Anonymous Coward · · Score: 0

      Hello Sir
      Thaks for all the great guidance but help me a bit.I searched my books,the library,and even googled(though I hate to do that) but I couldnt understand what "Wolverton-Hasselby" thing is.All other I understood,just one little help and I'll be on my way to World-Domination .
      Please help.please...

    5. Re:This calls for quantum statistical analysis by steveoc · · Score: 1

      I make this shit up on the spot, thanks. It sort of rings true to me at the time, so I just spit it out.

      You might also find my theory of optical interpolation when viewing CGI images to be quite interesting :

      http://slashdot.org/comments.pl?sid=101108&cid=862 1227>

      I have many other writings on here too - eg: that rant about birds attacking cavemen, and the continuing relevance to todays modern life is worth a read if you care to look around.

  122. parent is page-hit whoring by subtropolis · · Score: 3, Funny
    If you've got something to say about this thread, just pipe up here.

    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.
    1. Re:parent is page-hit whoring by Anonymous Coward · · Score: 0

      Thank God for Adblock's "Adblock Background" feature.

    2. Re:parent is page-hit whoring by Anonymous Coward · · Score: 0

      Yea - except for about 4 or so paragraphs, the rest of it is a advertisement

  123. Re:Oh - My - God by tloh · · Score: 1
    ...submitting a question like this would be like going to a convention of heart surgeons...

    *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 focus

    I 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.
  124. Simple measures by Anonymous Coward · · Score: 0

    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. :)

  125. I use WORN-RAID by maharvey · · Score: 1

    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)

  126. Re:Oh - My - God by raftpeople · · Score: 1

    Fortunately nobody really cares what you think is right or wrong.

    He asked a question and those that care to help responded.

  127. Perforce or Subversion by Will+Sargent · · Score: 1

    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.

  128. monotone by Anonymous Coward · · Score: 0
  129. Contribute to open source by njh · · Score: 1

    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.

  130. Why has nobody said JSAN? by Anonymous Coward · · Score: 1, Informative

    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.

  131. PEAR by jpkunst · · Score: 1

    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

  132. Unit Tests by Anonymous Coward · · Score: 3, Informative

    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.

  133. Ctrl+Z ??? by Anonymous Coward · · Score: 0

    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?

    1. Re:Ctrl+Z ??? by Anonymous Coward · · Score: 0

      Get on with the program. "Modern" unix desktop programs now imitate windows programs, right down to following windows keyboard shortcuts.

    2. Re:Ctrl+Z ??? by 1110110001 · · Score: 1

      No, Mac OS X uses cmd+Z.

  134. Storing or Organizing? by Keen+Anthony · · Score: 1

    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. ;-)

  135. dumb question about git and windows by aeoo · · Score: 1

    Does anyone know if someone is porting git to Windows (not cygwin)?

  136. Snippets are often more useful by coldPhage · · Score: 0

    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!
  137. Commit to opensource! by nikanj · · Score: 1

    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!

  138. Thank you, mods! by Anonymous Coward · · Score: 0

    If you hadn't funny++ this, I would have been all WTF, but instead I was all LOL.

  139. My favorite packaging by Chabil+Ha' · · Score: 1

    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
  140. Bazaar-ng by tchernobog · · Score: 1

    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.
  141. That's somewhat futile. by Abedneg0 · · Score: 1

    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

  142. Re-using Code with Visual Studio by Anonymous Coward · · Score: 0

    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!

  143. I don't. Not in the sense you're after... by LoveMe2Times · · Score: 5, Informative
    I've been programming for 20 years now, and I've worked in a variety of languages during that time on a lot of different things. And you know what? All of the code that I ever wrote before has pretty much zero value now, with a few exceptions. Especially at your phase of development as a coder, I think you'll find the value of code reuse after significant time has elapsed practically non-existant. Why? Well, because you'll find that your abilities grow substantially every couple years, and you're almost always better off to start with a clean slate rather than fooling around with your old code.

    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:
    1. This is just good practice in general, but you have to make the code *independant*. It has to stand on it's own. You might have heard about encapsulation, this is what they're on about. Make sure your application code no longer has to make any assumptions about how the library works. Get rid of "magic numbers" and define well-named constants. Make some effort to make the libraries data protected so app code can't screw it up.
    2. Make all of your functions meaningfully named. Make sure each function sanity checks it's inputs. Return meaningful errors anytime something goes wrong. This can be the hardest part. You have to check for and return errors *rigourously*.
    3. Define error constants, and provide a function to get a meaningful error message as a string. Alternatively, if you're using exceptions, make sure the exceptions can provide a message as a string.
    4. Provide appropriate initialization and cleanup/shutdown routines. Clearly define whether or not the library or the application "owns" any resources (memory, file handles, database connections, sockets, and so forth) so people know whether or not to release them.
    5. Make an effort to decompose your functions to expose a fine-grained interface, and then write "convenience" functions that use the low level functions to implement common needs. For example, if you have something that opens a file and processes it, break that down into something that works on a memory buffer and provide a convenience function that opens a file and feeds it into the memory buf
  144. build yourself a centralized arsenal of objects... by v3xt0r · · Score: 0

    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.
  145. Re:Oh - My - God by mcrbids · · Score: 1

    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.
  146. Well... by OneSmartFellow · · Score: 1
    There's my morning chuckle out of the way.

    THANKS !

  147. Re:Oh - My - God by mo^ · · Score: 1

    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!*@%!
  148. Sourceforge by Dr.+Hok · · Score: 1

    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...
  149. My Solution by Lord+Kano · · Score: 1

    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
  150. Re:Oh - My - God by Lord+Kano · · Score: 1

    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
  151. How I do it by ajs318 · · Score: 1

    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.

    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 /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.

    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!
  152. How the old-timers do it. by rjwoodhead · · Score: 2, Insightful

    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"
  153. Build libraries. by w4rl5ck · · Score: 1

    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.

  154. Re:Oh - My - God by my+$anity++0 · · Score: 1

    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.

  155. CVS beats Subversion in my opinion by slashbart · · Score: 4, Interesting
    Hi all

    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.

    svn add *
    svn rm *.log (oops added some test runs)
    svn commit
    " unable to get lock on file blabla". You'll now have to manually do svn rm ... on every file you accidentally added. The only way to know which ones, is by committing and waiting for the error.

    Big 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.

    1. Re:CVS beats Subversion in my opinion by fireboy1919 · · Score: 4, Informative

      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.

      If you use fsfs, you can just delete the last revision. 1 revision=1 file in that one. Otherwise, I'd say that you've hit upon the point of having a revision control system. From a technical standpoint, not having 1 to 1 mapping of files in the repository to files in the system allows you to make cheap copies, do directory versioning, do branching easier, and make backups easier.

      Really wrong error messages.

              svn add *
              svn rm *.log (oops added some test runs)
              svn commit

      " unable to get lock on file blabla". You'll now have to manually do svn rm ... on every file you accidentally added. The only way to know which ones, is by committing and waiting for the error.


      FUD. You was probably some other error in there too. I've done exactly this and it worked. Or it could be that whole "not using Berkley DB" thing.

      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.

      In the subdirectory: svn switch --relocate [new server]

      The subdirectory will update to the new place; rest of it will update to the old place. Don't blame subversion that you can't be bothered to learn how to use basic commands in it.


      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.


      I guess its just me. The solution seems obvious: don't use Berkeley DB as the backend. I don't. I wouldn't even touch a database format that only works right on ext2 partitions. That's already far too picky for me. What if my ext2 partition dies and I don't have another handy?

      And the fact that you can do incremental backups and actually get only new data is a nice plus.

      --
      Mod me down and I will become more powerful than you can possibly imagine!
    2. Re:CVS beats Subversion in my opinion by slashbart · · Score: 1
      Hi

      Ofcourse I've used svn switch --relocate, how else. Still the subdirectory did not update from the new server. Yes I know svn info to see what the server is.

      You might call it FUD but it is exactly what happened a few weeks ago.

      We've been using subversion for two years now, and are not impressed. As for your other backend suggestion: maybe you're right. I don't have the time to keep playing with different options for a revision control system. If there is one thing that needs to be rock solid, it's my version control. At least CVS is reliable, without having to fiddle with settings and options.

      Call me when subversion is ready for real world use; maybe right now this is the case, but once bitten, twice shy. I can live with the limitations of CVS, I am not ready for the hidden troubles we get with Subversion.

      Bart

    3. Re:CVS beats Subversion in my opinion by Gigs · · Score: 1

      So let me get this straight you been using subversion for two years but you can't be bothered with learning how to use it correctly and that's somehow subversion's problem... That's like blaming the hammer because it hit your thumb!!

      Wanna try the fsfs backend:

      #svnadmin create --fs-type fsfs /path/to/newrepos
      #svnadmin dump /path/to/oldrepos | svnadmin load /path/to/newrepos

      Ya that took me all of five minutes to find here:
      http://svnbook.red-bean.com/nightly/en/svn.reposad min.html

      You should also take a good long hard read of this section:
      http://svnbook.red-bean.com/nightly/en/svn.reposad min.maint.html#svn.reposadmin.maint.cleanup
      It'll help you with your clean up issues from the first post.

    4. Re:CVS beats Subversion in my opinion by slashbart · · Score: 1
      Very simple.

      When I started using SVN there was only Berkeley DB. It was extolled as the best thing ever.... I don't wanna try anything on my version control system. Are yous suggesting that using the BDB is not using SVN correctly? If so, they should remove the option from the tool, and make very clear to all users that they should upgrade.

      I don't feel like trying if fsfs will be reliable, I am not in the business of usertesting version control systems.

      Anyway, thanks for your tips, which I am well aware of since I moved from one version of BDB to another (remember my first post).

      Also, I have the printed manual of subversion on my desk, and did read most of it, especially when we ran into trouble. blog nicely points out some of the problems I have, including the non-existent branch/merge mechanism in SVN.

      Bart

    5. Re:CVS beats Subversion in my opinion by matfud · · Score: 1

      fsfs seems quite reliable for us (we use it in one of our products), however it can grind to a halt on some filesystems.

      Some bright spark thought it would be a good idea for each revision to be stored as a seperate file in a single directory. Most file systems don't take kindly to 40,000 files in a single dir. It, for some odd reason, really hurts thier performance.

    6. Re:CVS beats Subversion in my opinion by Cron0s · · Score: 1

      >> including the non-existent branch/merge mechanism in SVN

      DAMN !! What is this copy thing I ve been using for years ????

  156. One word: nuweb by sidles · · Score: 1

    I maintain my code in nuweb. Requires: nuweb, tetex, plus the usual linux utilities. Yes, Literate Programming lives!

  157. Ditto on that one by Anonymous Coward · · Score: 0

    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/

  158. No, really, thank you mods! by iGN97 · · Score: 1

    The collective IQ of the universe just dropped a full point as a result of this being modded insightful.

  159. Why stop at code? by smittyoneeach · · Score: 1

    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
  160. Reusable Assets by Anonymous Coward · · Score: 0

    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

  161. Code in modules an store in a revision system by Giometrix · · Score: 1

    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
  162. /Work + overturning backups; but build libs by Qbertino · · Score: 1
    Every main home I've got on Linux or OS X has a /Work directory with all the projects I've ever done in it. Theres also a /old-stuff for projects that I don't work on any more.
    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
    function generate_table_assoc_list_view($tableName1, $tableName2, $targetViewForEdit, $pageSize, $pageNumber)
    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
  163. In computer files. by Anonymous Coward · · Score: 0

    Yes indeed.

  164. @Work, @Home, & how both work together for me by Anonymous Coward · · Score: 0

    @ 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

  165. Re:Oh - My - God by theStorminMormon · · Score: 1

    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.
  166. My system by ericlondaits · · Score: 1

    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.
  167. Re:Oh - My - God by theStorminMormon · · Score: 1

    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.
  168. Don't use bzr by amightywind · · Score: 1

    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
    1. Re:Don't use bzr by Anonymous Coward · · Score: 0

      I think that its cool that there's a lot of choices to pick from. If GnuArch is what satisfies your needs, then stick with it. That said, Bazaar-NG has been a big win for our users. There's no need to setup repositories or decide what you need to call a branch. For example, in order to get a project controlled and pushed, one would run:

      $ tar xvfz code.tgz; cd code
      $ bzr init
      $ bzr add
      $ bzr commit -m"My new branch"
      $ bzr push sftp://isp.com/public_html/newbranch

      And thats it. Yes, its _that_ easy. Merge and the rest are about the same as well.

      You are right though, that we're a bit slow today when it comes to initial pushes and pulls. The good news though is that we'll have this fixed in about a month.

      I'm not quite sure what to say about your python comments. I've come to like python myself. I suppose though that if you have a hatred not just for python, but for anything implemented in it as well, that bazaar-ng is not the right choice for you.

      Its up to you as to whether or not you want to reevaluate that bias. If not, you're unneccesarily cutting yourself off from a lot of pretty neat stuff.

      -jblack

  169. Why is this here? by reed · · Score: 0, Offtopic

    Aren't there editors on slashdot approving stories? This post is pure troll/ridicule bait. There will be very few if any useful responses.

  170. Missing the point by Anonymous Coward · · Score: 0

    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.

  171. Re:I don't. Not in the sense you're after... by amiak · · Score: 1

    all that gets is a 5?

    --
    accurately define good according to a criteria and seek it out.
  172. Keep it simple. Zip it. by JamesR2 · · Score: 1

    I zip my code with the date as a version. Keep it simple.

  173. Mod parent up by Ignignot · · Score: 1

    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.
  174. PHP organization tricks by jarkun · · Score: 2, Informative

    Make sure you are using #include (or #include_once) and function calls

    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_controller

    As you start to tweak/modify your librarys/modules storing them in CVS is great way to track how they evolve over the ages

  175. Use SourceForge? by FreakyJellyFish · · Score: 1

    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
  176. Intelectual Property might be an issue by Anonymous Coward · · Score: 0

    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

  177. You know you're old when... by Anonymous Coward · · Score: 0

    ...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?

  178. cvs.sf.net by dsmatthews · · Score: 1

    duh!

  179. Question about VC or ...? by Elixon · · Score: 1

    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.
  180. I did it by infolib · · Score: 1
    I modded it insightful. The post just looked so much cooler with an "insightful" tag. Since that tag's gone now anyway I might as well undo the mod by posting.

    I might not get mod points again for a year - so what?

    --
    Any sufficiently advanced libertarian utopia is indistinguishable from government.
  181. Perl programmers use the CPAN for this. by jonadab · · Score: 1

    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.
  182. Im not buying it by osoese · · Score: 0

    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....
    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 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.

  183. engravings by eyrieowl · · Score: 1

    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.

  184. Some Easy Tips by SloppyElvis · · Score: 1
    There's a bunch here on source control, etc. so I have a few practical tips for keeping code reusable (which as some have pointed out, it often is not).

    Any Language
    1. DO: Comment Well - You should know exactly what a snippet does by reading it. Do not assume you will remember a year later.
    2. DO: Name functions / objects with meaningful and specific names - same as above.
    3. DO: Try to use consistent but flexible mechanisms for error logging/handling.
    4. DO NOT: Allow dependencies (internal/external/platform) to develop. Code that is tied to other code is on the whole less reusable. There are some exceptions, but as a general rule, avoid dependencies.
    5. DO: Keep code generic and avoid "lock-in" APIs if possible. Microsoft will tempt you into using their lock-in garbage and your code will be useless when the "new and improved" APIs come out. Also, you will sacrifice portability if you make this mistake.
    6. DO: Treat reused code as its own "project". Keep it separated from other projects in source control, and insert a "release" version of your code library/snippets into other projects
    7. DO: Version your code library. It is easy to insert breaking changes and side-effects without realizing it, and you don't want to kill an older project by failing to include the correct version of your code.


    C/C++ Language
    1. DO: Start with a simple "Utility.h" header and write inline or static methods right in the header with minimal dependencies. This is the most reusable method C/C++ offers, and I have an age-old C header still in use to prove it.
    2. DO: When your code is too much for a simple header, break it into a few headers, or consider static libraries. Extern the methods in an include-able header that has limited or no link dependencies. Objects can be reposed in this manner, but be aware that objects are very difficult to construct in a truly reusable manner.
    3. DO: Namespace your code. It will be easier to replace/find/use if you do. Perhaps this should be under the "Any Language" catagory.
    4. DO NOT: Expect that your subclass of Micro$oft's latest data grid will be reusable for any appreciable measure of time. Chances are there are bugs in it you need to work around that may be fixed in the next version, and bugs that will be introduced in the next version that will wreck your hard efforts. On the whole, UI objects are rarely reusable unless you are ever so clever to be able to keep them looking "up to date" (or you're just years beyond your time ;)


    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.
  185. first things first... by igotmybfg · · Score: 0, Flamebait
    I'm specifically curious about PHP and JavaScript,


    Learn a real language, then come back and ask this question

  186. CVS, module headers, and philosophy by Draconomicon · · Score: 1

    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!
  187. The key is finding code and having backups.... by Anonymous Coward · · Score: 0

    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

  188. In PHP I Use PEAR by SandBender · · Score: 1

    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?
  189. You're going to learn a lot by try_anything · · Score: 1

    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.

  190. PHP-specific advice. by dasil003 · · Score: 2, Insightful

    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.

  191. MMMMMM... by Alpha_Traveller · · Score: 1

    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)
  192. Coding Tips by ToxicBanjo · · Score: 1

    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.
  193. I store mine... by Kowgod · · Score: 1

    ...in compiled format.

    --
    -- Mesmer is the Dairy King Remove your panties to email me.
  194. Reuse important, but tradeoff ag. multiple lang. by j.leidner · · Score: 1
    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.

    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

    • to minimize library dependencies,
    • for licensing reasons, or simplay
    • because linking against a fat library turned my executable into bloatware.

    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.

  195. PHP and Javascript by RAMGarden · · Score: 2, Interesting

    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.
    1. Re:PHP and Javascript by dpu · · Score: 1

      The only problem I foresee with your method is the file size. On a fast server with a lot of RAM, a site without a lot of traffic might not have trouble with what could potentially be a HUGE "classes.php" file, but a busy site or less equipped server is going to slow down tremendously if there are a lot of open sessions.

      This is compounded in the "function.js" file, since it must be downloaded by the browser. If you have 50kb of code in that file, then every page request is going to have the 50kb overhead on top of whatever size the page already is.

      And in either case, isn't it hard trying to find a specific function in one of those files once they grow beyond a certain amount? What if you forget the exact name of the function, making a search useless?

      --
      Dammit, I meant to post that anonymously!
  196. Duh, local copy of code by boy_afraid · · Score: 0

    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.

  197. Re:Oh - My - God by avronius · · Score: 1

    Great. Now I'm older than "old people"...

    Reprobates!

    - Avron

  198. Reusability by moxiejkk · · Score: 1

    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.

  199. Re:Oh - My - God by SpacePunk · · Score: 1

    You can always bring it. Attitude adjustments are my specialty.

  200. Yep, and open source it. by CarpetShark · · Score: 1

    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.

  201. Libraries of Congress by CarpetShark · · Score: 1

    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...

    1. Re:Libraries of Congress by 73 · · Score: 1

      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...


      That was YOU!? You bastard. :-) I spent weeks trying to learn Perl algorithms using a Martha Stewart book. The scary thing? It made sense...
  202. Folders by icleprechauns · · Score: 1

    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.
  203. Use a Wiki by taradfong · · Score: 1

    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?
  204. No, use VMS by FORTRANslinger · · Score: 1

    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!
  205. Conversation by bobcat7677 · · Score: 1

    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)

  206. 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
  207. And I never have, either... by Javaman59 · · Score: 0
    I've been programming for 20 years now,...


    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.
  208. Classes and Files - Simple Organization by dpu · · Score: 1

    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!
  209. Re:Oh - My - God by toddbu · · Score: 1
    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.

    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.
  210. Long term offline storage by raider_red · · Score: 1

    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.
    1. Re:Long term offline storage by toddbu · · Score: 1
      We have our code etched in marble slabs by a bunch of low-paid college interns.

      Remember the good old days of carrying around boxes full of punchcards, only to lose control of the box and watch the cards scatter when they hit the floor? I can't imagine what it would be like trying to piece together the code on the marble slab that's broken into bits (or bytes :-)

      --
      If you don't want crime to pay, let the government run it.
  211. Create your own APIs by mstahl · · Score: 1

    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.

  212. Re:Oh - My - God by mcrbids · · Score: 1

    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.
  213. I use a Wiki... by mardoen · · Score: 1

    ...to store code snippets, example code, and documentation.

  214. fsfs by lorcha · · Score: 1

    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
  215. FSFS is no longer experimental by Captain+Tripps · · Score: 1

    As of version 1.2 it's the default, and bsd-db is deprecated.

    1. Re:FSFS is no longer experimental by smallfries · · Score: 1

      That's good to hear. Are there any reports of people using it over NFS? One of the problems with subversion used to be that once a repository was corrupt you were screwed. I think that the repair tools have improved a lot since then, but I'd still be a bit dubious until lots of other people had already tested it ;^)

      --
      Slashdot: where don knuth is an idiot because he cant grasp the awesome power of php
  216. Re:Oh - My - God by tloh · · Score: 1
    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.

    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.
  217. The Subversion 1.1 manual claims it's OK by Captain+Tripps · · Score: 1
    From Chapter 5: Repository Administration:
    Because there's no journaling or shared-memory files being used, the repository can be safely accessed over a network filesystem and examined in a read-only environment.
    I've only used it locally or over SSH, so I can't vouch for how robust it is with NFS in practice.
  218. Re:Oh - My - God by toddbu · · Score: 1
    Sorry for the slow response. I've been busy. :-)

    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.
  219. wxCRP by admorgan · · Score: 1

    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/

  220. Re:Oh - My - God by tloh · · Score: 1

    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.

    ...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?

    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.
  221. Re:Oh - My - God by toddbu · · Score: 1
    Ok, I'm only going to answer one of your questions. :-)

    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.
  222. Re:Oh - My - God by tloh · · Score: 1
    Ok, I'm only going to answer one of your questions. :-)

    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.
  223. Re:Oh - My - God by toddbu · · Score: 1
    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... 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.

    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.
  224. Re:Oh - My - God by tloh · · Score: 1
    Ok, but half of those 400 posts are you and me, so what does that say?

    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.
  225. Re:Oh - My - God by toddbu · · Score: 1
    It says to me that half of that half are posts by those whom you would consider jerks.

    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.
  226. Re:Oh - My - God by tloh · · Score: 1
    Never once did I even imply that I thought anyone was a jerk, nor would I make such a statement.

    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.

    ....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.

    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.
  227. Re:Oh - My - God by toddbu · · Score: 1
    In response to a hypothetical asterik guru who snubs you

    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.
  228. Re:Oh - My - God by tloh · · Score: 1
    Sure, I think that people who clearly flame someone for no good reason are jerks. Can we at least agree on that point?

    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.
  229. Re:Oh - My - God by toddbu · · Score: 1
    Sorry again for the delay. Rebuilt a major server and had to work out a bunch of nasty issues. Can't imagine where I'd be without Google. ;-)

    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.
  230. Re:Oh - My - God by tloh · · Score: 1
    Sorry again for the delay

    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

    ....Perhaps you should read them again [slashdot.org] carefully without introducing any bias.

    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.

    ....What's wrong with wanting a better community?

    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.

    ....If you want general knowledge, buy a book. If you have specific questions then ask them on Slashdot.

    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.
  231. Re:Oh - My - God by toddbu · · Score: 1
    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. :-)

    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.
  232. Re:Oh - My - God by tloh · · Score: 1
    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.

    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.
  233. Re:Oh - My - God by toddbu · · Score: 1
    Despite your initial assertion, you have yet to *prove* me wrong.

    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.
  234. Re:Oh - My - God by tloh · · Score: 1
    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.

    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.
  235. Re:Oh - My - God by toddbu · · Score: 1
    First thing you said to me: "Great comments, even though I think you're wrong. :-)"

    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.
  236. Re:Oh - My - God by tloh · · Score: 1
    Perhaps the world would be a better place if it was. :-)

    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.
  237. Re:Oh - My - God by toddbu · · Score: 1
    Do you really believe CmdrTaco and Co. do this for just the ad revenue?

    Absolutely.

    --
    If you don't want crime to pay, let the government run it.
  238. Re:Oh - My - God by tloh · · Score: 1

    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.
  239. Re:Oh - My - God by toddbu · · Score: 1
    Instead, I'll chalk it up to your lack of time and experience on this forum and make nothing of it.

    Is this an assumption or judgement?

    --
    If you don't want crime to pay, let the government run it.
  240. Re:Oh - My - God by tloh · · Score: 1

    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.
  241. Re:Oh - My - God by toddbu · · Score: 1
    You have a high slashdot ID number...

    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.