Today's Question:  What does your personal desk look like?        GIVE A SHOUT

SEARCH KEYWORD -- Code comment



  Maybe we need //Comment comment

Do we need comment in our programs? Depends, if we can write a program which can clearly tell s the reader what the program does, then we had better to avoid unnecessary comments. However, if the program we develop is complex enough and it involves some uncommon logic which needs more explanation, then we have to add comment and make sure the comment we add can correctly tell the readers what we do. The worst scenarios is not you forget or you don't want to add comment, it's that you add comment...

   comment,programming     2014-07-23 04:38:04

  Art of code comment

Note : This post is just for fun. Please be careful about these tricks. Code comment is to provide complementary comment to abstract codes. We will introduce two comment styles while we are debugging our codes. we should avoid these styles in production codes. 1. if else style Only execute eatKfc() //* eatKfc(); /*/ eatMcdonalds(); //*/ Only execute eatMcdonalds() /* eatKfc(); /*/ eatMcdonalds(); //*/ Execute both //* eatKfc(); //*/ eatMcdonalds(...

   Comment,Style     2013-08-19 04:19:40

  golangci-lint to enable comment check for exported functions

golangci-lint is a command line tool which aggregates a list of different go linters to check whether the source code is in correct condition from different aspects. It is built to run during the CI pipeline so that there is no obvious coding issues before compiling and building the program. It is easy to run it with just below command $ golangci-lint run -v INFO [config_reader] Config search paths: [./ /Users /] INFO [config_reader] Used config file .golangci.yml INFO [lintersdb] Active 10 li...

   EXPORTED COMMENT,GOLINT,REVIVE,GOLANGCI-LINT,GOLANG     2022-04-15 20:21:34

  JavaScript-style object literals in PHP

The object literal notation in JavaScript looks like: var fido = {name: "Fido", barks: true}; or var fido = {}; fido.name = "Fido"; fido.barks = true; From assoc arrays to objects In PHP you would call that an associative array. $fido = array( 'name' => "Fido", 'barks' => true ); And you can easily make it an object too: $fido = (object)$fido; echo gettype($fido); // "object" Or if you want to start with a blank object and add stuff to it: $fido = (object)array(); or $fido...

   PHP,JavaScript,Object,Function call,Self vs this     2011-11-30 11:11:45

  Do you have this kind of comments in your source code?

Writing runnable code is the essential skill of a programmer, writing understandable comment is also a skill a programmer should acquire. There is some famous saying that bad comment is worth than no comment. Usually your code will be maintained by other people, if you provide them some difficult to understand or misguided comments, this will be nightmare to them. While at some other time, programmers may put some funny comments in their codes which may make others laugh. Today we...

   COMMENT,HUMOR     2016-08-01 10:25:14

  The war with spam comment

Spam comments are annoying and notorious. They are either malicious data from hackers to exploit the loopholes of the site or advertisements posted by robots. These kinds of comments have their own features and patterns, if we are careful enough, we can find ways to block most of them although it's not so easy. To block the comment with malicious executable codes such as JavaScript, we should remember one rule : never trust user input. So wherever there are user inputs, we need to check the vali...

   Spam comment,Block,Filter     2013-11-29 20:29:43

  Gracefully exiting from console programs in Ruby

Imagine you write a CLI program or a Rake task which loops through some data performing some work on it. You run it and then you remembered something. You’d love to kill the process with ctrl-c, but that will raise an exception somewhere in the loop. What you want is for the iteration to complete and then you want the program to quit. You could handle the Interrupt exception or add some conditions. But how about a cleaner and reusable way? No problem - you can trap signals, which...

   Ruby,Exit,Command window,Console,Graceful     2012-03-14 13:42:16

  Interesting program comments

With Google Code Search, we can search some interesting code snippets comments. Some of them are interesting. Programming is not a boring task if you have a good attitude. Lets see some funny comments. Have fun.Not very confident :Dragon everywhere :One more angry comment :I told them earlier:F**K:Don't look following programs:Author :  陈皓 Source : http://coolshell.cn/articles/290.html...

   Programming,comment,interesting     2012-04-23 06:51:05

  Get the 48×48 or 256×256 icon of a file on Windows

Getting the 16×16 and 32×32 icons on Windows is relatively easy and is often as simple as one call to ExtractIconEx. However, getting the extra large (48×48) and jumbo (256×256) icons introduced respectively by XP and Vista is slighly more complex. This is normally done by: Getting the file information, in particular the icon index, for the given file using SHGetFileInfoRetrieving the system image list where all the icons are storedCasting the image list to an IImageList interf...

   File icon,File extension,Association,Large icon,Windows     2012-03-23 09:35:17

  how to do online promotion to increase the traffic to your blog.

So many seo trics we can do to increase traffic to our blog, One of them is, by doing an online promotion. This trick is often done by the bloggers to increase traffic on their blogs.a very simple thing to do, but carry a big impact on traffic increases and the popularity of a blog on the internet. If you haven't already to do it for your blog, I think you should do it now, because it is more important than you are installing a lot of meta tags in your blogger.I have written some tips for doing ...

   Website,Promotion,SEO,Advice,Practice     2011-10-26 09:14:12