473,378 Members | 1,321 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Nesting Block Comments

code green
1,726 Expert 1GB
Has anybody got a trick for commenting out blocks of code that contain block comments.
This would be on a temporary basis and only used in degugging.

I vaguely remember doing something in 'C' that used dates and CONSTANTS
and was quite professional.
Jun 5 '09 #1
2 1621
Atli
5,058 Expert 4TB
You could try using a heredoc string to comment it out...

Like:
Expand|Select|Wrap|Line Numbers
  1. <?php
  2. class foo {
  3.  
  4.     private $name;
  5.  
  6.     /**
  7.      * A constructor!
  8.      */
  9.     public function __construct($name) {
  10.         $this->name = $name;
  11.     }
  12.  
  13.     /**
  14.      * Is it a bird? Or a plane?
  15.      */
  16.     function bar() {
  17.         echo $this->oof();
  18.  
  19.         $void <<< DEBUG
  20. /** Commented out for debugging purposes! **/
  21.     }
  22.  
  23.     /**
  24.      * This needs to be commented out
  25.      */
  26.     function oof {
  27.         return "No! It's a {$this->name}!";
  28.     }
  29. DEBUG;
  30.  
  31.     } // To close the foo function while debugging
  32. }
  33. ?> 
Jun 5 '09 #2
Dormilich
8,658 Expert Mod 8TB
the only thing I can think of is destroying the closing block comment tag. should be OK for debugging.
Jun 5 '09 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

13
by: Philip WATTS | last post by:
I am trying to carry out multiple checks on some input data. I am doing this by the running the data through a number of functions. i.e. I have an onclick that calls a function, which in turn calls...
4
by: Henk | last post by:
Hi group! What is the use of nesting DIV's? Henk
42
by: Mantorok Redgormor | last post by:
I have a question for the sages here. the comp.lang.c faq says: 20.20: Why don't C comments nest? Are they legal inside quoted strings? A: C comments don't nest because PL/I's comments...
1
by: Garris, Nicole | last post by:
We've actually implemented this kind of thing in a different DBMS. The physical design consists of a single "organization" table that's something like: Org_key (primary key) Org_type (group,...
2
by: iftekhar | last post by:
hi there , consider the followinf code #include <iostream> #include <stdexcept> using namespace std; int main (void) {
18
by: John Salerno | last post by:
I'm still tyring to figure out what "Pythonic" means, and I have a feeling the answer to my question may fall into that category. Are block comments somehow unpythonic?
22
by: Technoid | last post by:
Is it possible to have a conditional if structure nested inside a conditional switch structure? switch(freq) { case 1: CASENAME if (variable==1) { do some code }
3
by: MartinRinehart | last post by:
Tomorrow is block comment day. I want them to nest. I think the reason that they don't routinely nest is that it's a lot of trouble to code. Two questions: 1) Given a start and end location...
3
by: Richard | last post by:
Again, new to DB2. Trying to do something I can do in Sybase ASE. In any Sybase SQL script I can use /* */ to comment out a block of code. In the DB2 9.0 SQL Reference Manual V1 it says: ...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.