Massassi Forums Logo

This is the static archive of the Massassi Forums. The forums are closed indefinitely. Thanks for all the memories!

You can also download Super Old Archived Message Boards from when Massassi first started.

"View" counts are as of the day the forums were archived, and will no longer increase.

ForumsDiscussion Forum → how do you write code?
how do you write code?
2005-08-05, 2:36 PM #1
how do you write code?
i cut, paste and modify. i'm too lazy to start from scratch and i know it's one of the reasons i don't advance as quickly as i should with things like javascript and php.
2005-08-05, 2:37 PM #2
Step 1 is to decide which language you want to write code in. :p

[Edit: Oh, I thought you were asking for help... err... NINJA EDIT.]

2005-08-05, 2:38 PM #3
I don't really do any coding other than mIRCScript. I usually just start writing and work it all out as I go.
2005-08-05, 2:40 PM #4
I usually try to do the basics with starting a new document. But for stuff like PHP which I am pretty good at...copy paste and goooo
In Tribute to Adam Sliger. Rest in Peace

10/7/85 - 12/9/03
2005-08-05, 2:49 PM #5
Mine's a bit of both. I C&P stuff I previously wrote and take from others. The code I grab is mainly free for all, anyway so long as I give credit. Why reinvent the wheel?
Code to the left of him, code to the right of him, code in front of him compil'd and thundered. Programm'd at with shot and $SHELL. Boldly he typed and well. Into the jaws of C. Into the mouth of PERL. Debug'd the 0x258.
2005-08-05, 2:54 PM #6
I used to be a major script kiddie.
2005-08-05, 3:01 PM #7
Depends on what Im doing.

If Im writing a quick piece of code to convolve some data, or rebuild a database, or the like, I usually just modify an older script of mine. If Im starting a new application of course Ill start from scratch, but I might borrow snippets of code from other apps Ive written.


Originally posted by JediGandalf:
...Why reinvent the wheel?

...Because then its *MY* wheel.
And when the moment is right, I'm gonna fly a kite.
2005-08-05, 3:02 PM #8
I can't cut and paste. I HAVE to know what it is I'm doing, and I usually do it in an overly clear, overly whitespaced way with no shortcuts taken in syntax.

In C I *might* stretch to a pig++, but not often.

<.<
2005-08-05, 3:07 PM #9
Depends on what kind of thing i'm editing. If its a huge gigantic thing I try from scratch, if its a small hw assignment, I look up stuff and copy and paste and modify.
"The only crime I'm guilty of is love [of china]"
- Ruthven
me clan me mod
2005-08-05, 3:47 PM #10
The fist real coding experience (besides the minor stuff with JO/JA shader editing, and html) was with the Matlab scripting laguage (basically C/C++). At fist I copied and pasted from the example files and modified, then eventually started from scratch once I had all the commands down and determined that finding an appropriate template from older work would take too long. That's pretty much the way I work with all languages I use long enough.
Steal my dreams and sell them back to me.....
2005-08-05, 3:48 PM #11
I start from scratch, and, if I've already got my algorithm implemented in another program of mine, I rip it from that one. So that's...kind of "other."
the idiot is the person who follows the idiot and your not following me your insulting me your following the path of a idiot so that makes you the idiot - LC Tusken
2005-08-05, 3:57 PM #12
[QUOTE=Bounty Hunter 4 hire]The fist real coding experience (besides the minor stuff with JO/JA shader editing, and html) was with the Matlab scripting laguage (basically C/C++). At fist I copied and pasted from the example files and modified, then eventually started from scratch once I had all the commands down and determined that finding an appropriate template from older work would take too long. That's pretty much the way I work with all languages I use long enough.[/QUOTE]


GAHAH!!!

I asked for help ages ago with matlab coding- you must've not seen the thread! Boooooo!

Ah well, I've done it now, and got my degree, so I forgive you :p
2005-08-05, 4:08 PM #13
I start from a template that I've already written for myself. So a mix of c/p and scratch i guess.
2005-08-05, 5:07 PM #14
um, it really depends on what i'm doing.

If I know how to do it but i haven't done it before, I do it from scratch.
If I have done it before, I copy/paste/modify.
If I don't know how to do it I search around for some algorithms or existing examples and adapt them for my own needs.

Is there really any other way to do it?
Detty. Professional Expert.
Flickr Twitter
2005-08-05, 5:13 PM #15
What Detty said...

For Java I just can't get away from Eclipse. Easily the best IDE I've ever used. I'm not sure about the C++ plugin though.
Bassoon, n. A brazen instrument into which a fool blows out his brains.
2005-08-05, 6:00 PM #16
Well, it depends on the language. If I know the language well and know what I need to do to get the effect I want, I code it from scratch. However, if I don't know the language well or I do but don't know how to go about coding it, I rip it from someone else (only with web-related client-side code such as Javascript since no one can truely copyright that stuff).
The cake is a lie... THE CAKE IS A LIE!!!!!
2005-08-05, 6:07 PM #17
Originally posted by Emon:
For Java I just can't get away from Eclipse. Easily the best IDE I've ever used. I'm not sure about the C++ plugin though.

It sucks! (the C++ plugin) I was tormented in Software Engineering with that. I was on my knees begging to let me use VS .NET or Editplus.
Code to the left of him, code to the right of him, code in front of him compil'd and thundered. Programm'd at with shot and $SHELL. Boldly he typed and well. Into the jaws of C. Into the mouth of PERL. Debug'd the 0x258.
2005-08-05, 7:50 PM #18
I never used an IDE (well, I used to use VC6, but I don't program in Windows anymore). I just use vi, gcc, and gdb. Eclipse seems bloated to me, but I installed it anyway on the machines in the lab I run. I hear good things about it, but I'm pretty much set in my ways now.

When I code, it depends on what I'm coding. For C/C++ and Java, I tend to write it from scratch. For PHP, HTML, and CSS, I just copy and paste and only rewrite the things which actually differ.
[This message has been edited. Deal with it.]
2005-08-05, 7:56 PM #19
When I write webpages, which is honestly the only coding I do, I'll copy all the generic stuff that has to be there, like DOCTYPE and HEAD, just so I can get to the guts of the page, the stuff below BODY.

It's not like I don't know how to write a <head> tag properly, it's just annoying when you try to make 5 pages for a site and have to write the same damn thing for each. (This also extends into why I use so many freakin PHP and server side includes in my sites)
2005-08-05, 8:03 PM #20
Scratch.
2005-08-05, 8:13 PM #21
From Scratch.
"Flowers and a landscape were the only attractions here. And so, as there was no good reason for coming, nobody came."
2005-08-06, 7:43 AM #22
I rarely write something that I actually have use for, but for that I usually write from scratch. Most of the time, however, I'm trying to learn something new and I'm looking at someone else's code. What I do there is copy it down by hand in the hopes that it'll help me understand it.
Ban Jin!
Nobody really needs work when you have awesome. - xhuxus
2005-08-06, 8:53 AM #23
From scratch.
2005-08-06, 12:41 PM #24
I usually cut and paste a basic outline of my code, then I write the majority of the code myself.
Sam: "Sir we can't call it 'The Enterprise'"
Jack: "Why not!"
2005-08-06, 6:01 PM #25
Depends on the project and language.
2005-08-06, 9:21 PM #26
I won't C&P, but that won't stop me from reading some code, then typing it exaclty as shown. Just helps me a bit by physically typing it, cause then I can read/understand it a lot better (especially if I'm trying to figure something out)
$do || ! $do ; try
try: command not found
Ye Olde Galactic Empire Mission Editor (X-wing, TIE, XvT/BoP, XWA)
2005-08-06, 10:19 PM #27
[QUOTE=Darth Evad]how do you write code?[/QUOTE]

Simple: i don't.
50000 episodes of badmouthing and screaming like a constipated goat cant be wrong. - Mr. Stafford
2005-08-06, 11:01 PM #28
Originally posted by Martyn:
GAHAH!!!

I asked for help ages ago with matlab coding- you must've not seen the thread! Boooooo!

Ah well, I've done it now, and got my degree, so I forgive you :p

I'm only a sophmore engineer, so if you have your degree I probably dhadn't started learning Matlab at the time.
Steal my dreams and sell them back to me.....
2005-08-06, 11:16 PM #29
Just a hint, if you're copying and pasting any significant amount of code to create each new page in PHP, you are doing something wrong. Whatever you're copying and pasting should go in its own file and be include()d on each page, then you don't have to copy/paste anything.

If you are copy/pasting often, you are doing something wrong. Seriously.
2005-08-07, 6:17 AM #30
heh... i copy paste some includes too.
i just started a new project [url]www.coaterstech.com[/url] and it's going to have a lot of the same functionality as another site so i copy and pasted some of it for the new site.
2005-08-07, 6:20 AM #31
[QUOTE=Bounty Hunter 4 hire]I'm only a sophmore engineer, so if you have your degree I probably dhadn't started learning Matlab at the time.[/QUOTE]

This would have been early last academic year - about a year ago from now in fact :)

Engineering is a great career (from where I'm standing) - all the best :D
2005-08-07, 6:29 AM #32
Stealing is badass! :D
This is not the sig you are looking for. Move along.
2005-08-07, 7:12 AM #33
ya im a cut and paster
I <3 Massassi
2005-08-07, 10:54 AM #34
[QUOTE=Darth Evad]heh... i copy paste some includes too.
i just started a new project [url]www.coaterstech.com[/url] and it's going to have a lot of the same functionality as another site so i copy and pasted some of it for the new site.[/QUOTE]
If you're cutting and pasting for new sites, you need to take a look at how your code is set up and think of a better way to do it. You should have your commonly used code broken out into libraries which you can then include in your other projects. And they should be based on a "central" one so when you make updates to it, you can easily copy those files back out to all your other projects. CVS is great for this.

One major problem with copying stuff like that is if you end up finding a bug, you have to go change it in dozens of places instead of just one. Working on a 5-page project, no big deal, but working on something larger it becomes unmanagable.
2005-08-07, 1:28 PM #35
Originally posted by Brian:
If you're cutting and pasting for new sites, you need to take a look at how your code is set up and think of a better way to do it. You should have your commonly used code broken out into libraries which you can then include in your other projects. And they should be based on a "central" one so when you make updates to it, you can easily copy those files back out to all your other projects. CVS is great for this.

One major problem with copying stuff like that is if you end up finding a bug, you have to go change it in dozens of places instead of just one. Working on a 5-page project, no big deal, but working on something larger it becomes unmanagable.



Indeedily. This is why many of my pages have 32195234 includes in them.
2005-08-07, 2:13 PM #36
From scratch as much as I can, but I will C\P if needed.
The tired anthem of a loser and a hypocrite.
2005-08-08, 8:15 AM #37
Depends on what I'm doing and in what language.

If it is VB, C++, or php, I will copy/paste and then modify, or just modify, depending on what I am doing. I sorta understand the languages, but I don't know how to make a full blown program from scratch.

If it a scripting language, I will write from scratch, unless it is from an example for something I don't know how to do yet. I find that when I'm doing mIRCScript, I copy and paste from my own scripts.
A computer's worst nightmare:
0010111010011110210011010001

HazTeam Website-=HT=
2005-08-08, 10:18 AM #38
I have to do mIRC scripting by hand, because if I just C&P code and then my bot breaks, how else am I going to know where it broke? :p
$do || ! $do ; try
try: command not found
Ye Olde Galactic Empire Mission Editor (X-wing, TIE, XvT/BoP, XWA)
2005-08-08, 6:15 PM #39
thanks for the advice brian and cool matty. what i already have could be improved though so i'm copying, pasting and modifying to be better. at the same time i could probably use the new code for the old site too. i'll have to see how it looks when i'm done and if i even feel like fooling with the old site.
2005-08-09, 1:56 PM #40
When it comes to things like CGI programming, I normally start anew.

I find that using recycled code leaves me w/ recycled ideas. The code which I copy and paste are some of the background algorithms (parsing, searching, communicating) which you would reproduce line for line anyway.
I am married to Wuss. He's beast.

↑ Up to the top!