4 ms·
Avalaxy, while I know companies use tools to do their thing... I don't, I'm old school. I have files on an FTP server and I write PHP code. But to explain: >
by mattbgates 9y ago
Avalaxy, while I know companies use tools to do their thing... I don't, I'm old school. I have files on an FTP server and I write PHP code.
But to explain:
> Author: completely optional, depends on what you are using, you aren't wrong.. since I'm old fashioned, if I were to hire some coder to help me maintain my programs, I'd like to know that he was in there, and I'd have no way of knowing.. again, probably not anyone's issue, but I'm old fashion.
> Status: Not all files are in use, but sometimes they are just leftover and may not be deleted, or sometimes, they might be used for testing purposes -- so Status can be changed to INACTIVE, TESTING PURPOSES ONLY, etc. Maybe the file is inactive because newer code was written, but this was kept as an archive? You never know.
> Purpose: always state the purpose of the code.. if it changes, than this should probably change. If it doesn't, than again: you must be doing your own thing.
> Notes: optional, this is just notes that might be necessary..... again.. Notes to myself: I have some code in there that is not currently being used and if I go into production, I probably won't need it so may as well delete it.
The Notes weren't supposed to be taken as a literal. This is just notes to anyone who reads the file.
Sure, there is a such thing as too much commenting, but no one wants to go through the code to figure out what it does. Leaving a little comment up top of every page, regardless of the simplicity or complications of the function, it is just nice to leave for anyone who has to go in there. It's a better form of organization. Imagine having to go in there 3 years later... would you remember what it does? The little statement up top might help you remember more quickly.
- no29 9y agorcs has been around ~40 years. you're not old school. you're sloppy.
- mattbgates 9y agoWell, I'm glad you don't have to go into my code to see that sloppy tabbed mess full of comments and code :)
- sverhagen 9y ago"Old school"? I think it's in most cases irresponsible not to use version control. Sorry to say, but it's "amateur hour". No better than "Rick". I agree with one of the parents that "Purpose" is probably the most useful, but even there: at that level the code should be largely self-documenting.
- mattbgates 9y agoI never said I didn't have version control. To assume "at the code level it should be largely self-documenting" is to be a Rick. Comments are there to help everyone, including non-programmers understand what is going on.
- skinnymuch 9y agoYou said initially companies have their tools and you don't. Later you went on about simply using ftp and coding php. It sure seems like you don't use version control. At least not at a level that it should be used at in this day and age.
- sverhagen 9y agoWhat am I to make from: "while I know companies use tools to do their thing... I don't", if not that you're not using a version control tool? It's not "genius behavior", but well accepted from people like Uncle Bob, that documentation should be in the names of small and focused functions, methods or classes, not in comments.
- debaserab2 9y ago> To assume "at the code level it should be largely self-documenting" is to be a Rick You don't have to be a Rick to write clean, concise code. I'd strongly recommend reading up: http://www.codeodor.com/index.cfm/2008/6/18/Common-Excuses-Used-To-Comment-Code-and-What-To-Do-About-Them/2293 http://www.codeodor.com/index.cfm/2008/6/18/Common-Excuses-U... https://blog.codinghorror.com/coding-without-comments/ https://blog.codinghorror.com/coding-without-comments/
- valuearb 9y ago
- gregmac 9y ago> Avalaxy, while I know companies use tools to do their thing... I don't, I'm old school. You would do well to learn source control system (which these days basically means git). Leaving aside the team/collaboration part, once you learn it, it's so incredibly freeing. I cannot understate this enough. You can make changes to the code, and then go back with one operation (discard changes). You can work on an experimental idea (in a branch) for a few days/hours, then switch back to your main code to fix an important bug, go back and finish your experimental branch eventually, and merge everything together -- often with nearly zero effort. If you're supporting multiple release versions at once, you can fix a bug in one and often easily apply it to all other versions. Ever have a situation where something just stops working, but you're not sure when other than in worked four months ago? You can arbitrarily check out any old version and test, and even - in a single operation - undo that change from the current version of code. Can you do all this without source control (or with copies named by date)? Sure, but it's kind of like the difference between fetching water from a well using a hand pump and bucket vs having running water and being able to open a tap. Before you have running water, it's just life, and it's not that big a deal to fetch water, really. Once you have it, you could never imagine having to live life that way.
- mattbgates 9y agoI do know what "source control" is but even when I wasn't working for myself, my boss made me still add this stuff, despite knowing at the end, upon saving, it would ask what changes were made. We used something called "Source Safe" from Microsoft. As for what's in the Notes and deleting it upon live production... that is the old stuff... in case the new stuff stopped working for whatever reason. I guess we all have our own methods of doing things. Fortunately, I've not had major issues, though everything is backed up to it a server upon my completion of work for the day.
- megaman22 9y agoMan, you're banging rocks together and working hard, rather than smart. My sympathies for being stuck with a crapfest like sourcesafe.
- 9y ago
- md224 9y agoI'm an old school surgeon... I like to operate without using anesthetics or sterilizing my tools.
- steego 9y agoMuch like the old school surgeon, he hops on the production server and types very quickly to minimize website downtime. "Time Me, Gentlemen!" https://www.theatlantic.com/health/archive/2012/10/time-me-gentlemen-the-fastest-surgeon-of-the-19th-century/264065/ https://www.theatlantic.com/health/archive/2012/10/time-me-g...
- steego 9y agoYou need to seriously stop wasting time talking about this on HN and learn you some basic git. https://try.github.io/ https://try.github.io/ It's not hard. It's not like you're computer illiterate and don't know how to program.
- imron 9y ago> I have files on an FTP server and I write PHP code. None of that prevents you from using source control.
- deleted 9y ago[deleted]