Jump to content

This forum, and copy-ing code.....


jskywalker

Recommended Posts

Code provided in these forums are not intended for production use merely act as an example for the user problem. For this same reason will you find almost never any validation on input like:

 

$var = $_POST['var'];
$query = "SELECT * FROM table WHERE var = '$var'";
mysql_query($query);

 

Some examples even contain parse error's if you would execute them all because they only acted as an example and were not intended for production or any use just to give the OP the highlights on what may be a solution to their problem. We don't know your project specs inside-out and the provided example is based on the information you did or did not provide.

 

If you want copy-paste code then you should buy a book, read a tutorial, or visit a snippet repository

Link to comment
Share on other sites

Ignace, he means readability of the codebox, and what it gives out. Atleast on

 tags if someone on windows posts some code, the parser spews out 0D 0A 0D. (\r\n\r)

 

Either causes a notepad to not read newlines, or to have it double spaced. I've seen come across this issue many times before actually.. where blocks of tabs and newlines would appear for no reason when copying to my IDE.

 

EDIT, I actually get 0A0A ..\n\n when posting on linux, further messing things up for M$ viewers.

Link to comment
Share on other sites

@ignace: i know that its my own problem if there is a bug in the script i copy/paste....

 

But i could be really helpfull if i try to help someone

(i.e. http://www.phpfreaks.com/forums/index.php/topic,286072.msg1356641.html#msg1356641)

 

that i can copy/paste his code to  my editor, and tweak it a bit.....

 

i wont buy a book, because i already have a PHPbook (its 'old' because its from 2000 about PHP4)

and most scripts in here are useless to me anyway, so i wont use them...

 

Link to comment
Share on other sites

hmmmm.....

 

copying from IE8, and pasting in Notepad does not work

copying from FF3.5.7, and pasting in Notepad does work

 

IE (along with MS's standards) relies on it being \r\n. (carriage return, newline). Linux \n, Mac just \r. If it is a mix of the two, or multiple, then yeah, IE may give you no lines or multiple lines. Firefox may possibly correct this when placing to clipboard.

Link to comment
Share on other sites

i wont buy a book, because i already have a PHPbook (its 'old' because its from 2000 about PHP4)

and most scripts in here are useless to me anyway, so i wont use them...

 

You should ALWAYS be on the lookout to buy books. Knowledge and Research should be your top 2 priorities. We can't waste our lives (and our brain) to do nothing or contribute nothing to this society. To many people already waste their lives by never touching a book again after high school.

Link to comment
Share on other sites

 

You should ALWAYS be on the lookout to buy books. Knowledge and Research should be your top 2 priorities. We can't waste our lives (and our brain) to do nothing or contribute nothing to this society. To many people already waste their lives by never touching a book again after high school.

 

i find experience more valuable than reading books.....

Link to comment
Share on other sites

Different people have different ways that work best for them.  Some people find it easiest to watch video tuts, some like to take snippets of code and poke at it, some are fine reading tuts online, some like having a physical book.  There's no "one way" that works best for everybody.  Trick is to find the way that works best for you.  The thing that seems to universally not work / be acceptable is expecting people to spoon-feed you stuff.  Hard fact to accept, but if you need to be spoon-fed, you obviously won't be able to make it on your own...maybe find something else out there that suits you better.  Some other language, or some other thing altogether.  Too many people out there think coding is some easy thing that can be picked up on the fly, but it's not.  Just like not everybody can be a doctor or scientist.  Just that...coding, especially something open-source like php, really easy for average joe to get access to it, and that makes average joe think easy access == easy learning.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.