473,791 Members | 2,933 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How-to: avoid some code problems in advance

This all below is my opinion, not any official post though...
=============== =============== ========

1) Have a debugging/error handling system. It is not so difficult to make, I
have made one myself and it really often helped us in development.

2) Test code ALL the time, after every couple of lines, not in big chunks.

3) Leave debugging features inside, even if you use simple lines like:
echo "now variable i = $i";
comment it, when you don't need it, but keep it there!

4) Name variables in a way that even others understand them
$person['phone'] is good name , $p['p'] is bad.

5) Put useful comments here and there. don't think commenting is waste
of time.

6) Learn to use error_reporting ();

7) When you ask questions in a newsgroup, take time to formulate
your post. Don't push your opinions on where the error
might be, since if you knew that, you wouldn't have needed
help in the first place.

8) Remember "Give-and-receice" principle in newsgroups:
Give help, give thanks to those who help you =>
You'll receice help, you'll receive thanks when
you help someone.

Feb 6 '07 #1
7 1321
"P Pulkkinen" <pe************ *************@P OISTATAMA.elisa net.fiwrote in
message news:VZ******** *********@reade r1.news.saunala hti.fi...
This all below is my opinion, not any official post though...
=============== =============== ========
....
7) When you ask questions in a newsgroup, take time to formulate
your post. Don't push your opinions on where the error
might be, since if you knew that, you wouldn't have needed
help in the first place.
Good point. Also good to remember is to try to isolate the problem to the
shortest piece of code you can. No one wants to debug 200 lines of code in
their head, hence the abbreviation TLDR (Too Long, Didn't Read!) exists.

And I'd like to add just one more advice:

10) Use an editor that higlights syntax! Much easier to spot the missing
quote, semicolon or some other typo when the syntax is highlighted.

--
"Ohjelmoija on organismi joka muuttaa kofeiinia koodiksi" - lpk
http://outolempi.net/ahdistus/ - Satunnaisesti päivittyvä nettisarjis
sp**@outolempi. net | rot13(xv***@bhg byrzcv.arg)
Feb 6 '07 #2

"Kimmo Laine" <sp**@outolempi .netwrote:
Good point. Also good to remember is to try to isolate the problem to the
shortest piece of code you can. No one wants to debug 200 lines of code in
their head, hence the abbreviation TLDR (Too Long, Didn't Read!) exists.
10) Use an editor that higlights syntax! Much easier to spot the missing
quote, semicolon or some other typo when the syntax is highlighted.
VERY good points!

http://www.hiliteme.com/ is a service for those, who are not working with
highlighting editor, or in a case where you are working wiht another
computer, or in a hurry etc.

Now I got so inspired that I'd like to develop this post into general
php-debug&newsgroup-faq. Let's see, how many are excited!

Feb 6 '07 #3
Rik
P Pulkkinen <pe************ *************@P OISTATAMA.elisa net.fiwrote:
Now I got so inspired that I'd like to develop this post into general
php-debug&newsgroup-faq. Let's see, how many are excited!
I'm all for a major rewrite of http://php-faq.com/. I'll contribute when I
can :-)
--
Rik Wasmus
Feb 6 '07 #4

"Rik" <lu************ @hotmail.comkir joitti
viestissä:op*** ************@mi sant.kabel.utwe nte.nl...
I'm all for a major rewrite of http://php-faq.com/. I'll contribute when I
can :-)
Well, that looks excellent work! I will not bother to rewrite something that
has already in excellent process.

I could imagine it would take you about 15-N minutes to write a widget, that
sent the plain text version of the FAQ on 1st day of every month to this and
the other newsgroup...:-)


Feb 6 '07 #5
Rik
P Pulkkinen <pe************ *************@P OISTATAMA.elisa net.fiwrote:
>
"Rik" <lu************ @hotmail.comkir joitti
viestissä:op*** ************@mi sant.kabel.utwe nte.nl...
>I'm all for a major rewrite of http://php-faq.com/. I'll contribute
when I
can :-)

Well, that looks excellent work! I will not bother to rewrite something
that
has already in excellent process.

I could imagine it would take you about 15-N minutes to write a widget,
that
sent the plain text version of the FAQ on 1st day of every month to this
and
the other newsgroup...:-)
'the' other?

I'm watching:
comp.lang.php
alt.php
alt.comp.lang.p hp
alt.php.sql (well, a bit specialised indeed)

I've never tried an automated NNTP post before, but it seems there's a
PEAR package for it. Posting the entire faq would be quite lengthy though,
not sure that's a good idea. Maybe a 'FAQ of the day'?

It could benefit from a more 'how to troubleshoot' portion too.
--
Rik Wasmus
Feb 6 '07 #6

"Rik" <lu************ @hotmail.comwro te:
'the' other?
maybe there are some more good than I know, but when i searched my
newsserver, I found comp.lang.php and php.general to be very active and
useful for me.
I've never tried an automated NNTP post before, but it seems there's a
PEAR package for it. Posting the entire faq would be quite lengthy though,
not sure that's a good idea. Maybe a 'FAQ of the day'?
That could be. Also one option is to make wholly/partially link-based faq
that would lead to your website. That would be shorter.
Also, process of defining the MOST typical questions from just typical
questions.
It could benefit from a more 'how to troubleshoot' portion too.?
Especially. Trouble-avoiding, trouble-shooting and trouble-handling.
Feb 7 '07 #7
"Rik" <lu************ @hotmail.comwro te in message
news:op******** *******@misant. kabel.utwente.n l...
>P Pulkkinen <pe************ *************@P OISTATAMA.elisa net.fiwrote:
>>
"Rik" <lu************ @hotmail.comkir joitti
viestissä:op** *************@m isant.kabel.utw ente.nl...
>>I'm all for a major rewrite of http://php-faq.com/. I'll contribute
when I
can :-)

Well, that looks excellent work! I will not bother to rewrite something
that
has already in excellent process.

I could imagine it would take you about 15-N minutes to write a widget,
that
sent the plain text version of the FAQ on 1st day of every month to this
and
the other newsgroup...:-)

'the' other?

I'm watching:
comp.lang.php
alt.php
alt.comp.lang.p hp
alt.php.sql (well, a bit specialised indeed)

I've never tried an automated NNTP post before, but it seems there's a
PEAR package for it. Posting the entire faq would be quite lengthy though,
not sure that's a good idea. Maybe a 'FAQ of the day'?

Well it might be a good idea to promote it at least some way, because I've
been reading this group for a couple of years now and this is the first time
I've seen the faq. Given that it isn't the official group faq, I understand
it though. If it is promoted as the official unofficial alt.*.php faq then
it certainly ought to be posted in the group in some format on regular
basis. But in that case it should also cover some aspects of news groups
posting, not just php (NO SHOUTING, speak english, don't post 300 lines of
code, be polite, etc...)

--
"Ohjelmoija on organismi joka muuttaa kofeiinia koodiksi" - lpk
http://outolempi.net/ahdistus/ - Satunnaisesti päivittyvä nettisarjis
sp**@outolempi. net | rot13(xv***@bhg byrzcv.arg)
Feb 7 '07 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
2983
by: Tom Szabo | last post by:
Just wandering how can you close a browser remotely. In some web applications the browser closes or refreshes periodically. How is that done and how can it be done through PHP? TIA, Tom
15
16340
by: Reid Nichol | last post by:
Hello, I was wondering if I could control how many bytes are in an int and the byte order. In C/C++ I can use int32 but how do I do this in python? How can I control byte order?
0
1828
by: v I n O | last post by:
hI Geeks Please do let me know how do i find how many instances sql server running on the single machine. or in the n/w my objective should with help of C#/vb.net
4
2030
by: James Salisbury | last post by:
Hi, I was checking my parent's website salisbury.cabrera.net on google by entering villa rent spain cabrera I can see the required site, ranked at 4, but I am concerend by the return at 1 and 5 in the list. Any ideas why somone else may be using the text from my site, and how can I make an abuse report? Thanks
2
2584
by: Frances Del Rio | last post by:
http://www.emol.com/especiales/cocina_chilena/comida.asp this page is so neat (goes in pop-up..) how was this done? how do you give a layer (or div, I guess) a semi-transparency so you can still see img under it? (and how do you do the scroll for the div?) I know HTML very well, I also CSS and JavaScript, but am a bit mystified here... PLEASE respond by e-mail, fdr58@yahoo.com, my access to usenet is very limited.. thank you..
4
1986
by: | last post by:
Developing, building, and testing. How do it the best? Learning from the world leader - Microsoft I'm very interested in how the developing/build/testing workflow @ Microsoft looks like. I think Microsoft as world leader in software developing business must have a very good workflow. Does anyone know how the development flow @ Microsoft looks like?
4
2387
by: Supra | last post by:
in vb6 listbox1.remove item 5 how will i do in vb.net? regards
3
1926
by: dba2adm | last post by:
The SNAPSHOT_STATEMENT table function gives the CPU used rows read etc information. How do I know the total number of time the particular statement was executed (as in snapshot_dyn_sql's num_executions)? Also, is the value "STMT_USR_CPU_TIME_S" etc cumulative? Thanks.
0
1989
by: candra | last post by:
Learn What Hackers Know? -General Hacking Information -Password Security -Scanning, Fingerprinting And Similar Techniques -How Hackers Attack Numerous Internet Services -How Hackers Attack Web Servers, Cgis, PHP, ASP, Etc -How Hackers Attack IRC, Instant Messaging, And Multiplayer Games -Vulnerabilities Found In Platforms With Smaller Market Share -How Hackers Attack Novell And Networks
2
1618
by: belred | last post by:
i just read this blog about how many objects (types) are loaded for a hello world program in C#. http://blogs.msdn.com/abhinaba/archive/2008/09/15/how-many-types-are-loaded-for-hello-world.aspx how can you find out how many are loaded for a python program: print 'hello'
0
9669
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9515
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10207
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9993
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9029
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7537
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5558
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4109
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3713
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.