ALL


  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 styleOnly execute eatKfc()//* eatKfc();/*/ eatMcdonalds(); //*/Only execute eatMcdonalds()/*eatKfc();/*/eatMcdonalds();//*/Execute both//*eatKfc();//*/eatMcdonalds();//*/2. Block commentDon't comment/**/var foo = function() { ...};/**/Block comment 1/** /var foo = function() { ...

5,839 0       STYLE COMMENT


  Writing Java codes conforming to coding standard

Recently, I was doing some cleanup to one of my current Java project. I find there are many codes which are not conforming to the Java coding standard. So I list them here and hope that people can improve your codes and write maintainable codes.Format source code and manage imports in Eclipse Eclipse provides functions of auto-formatting and imports management, you can use following shortcuts to use these functions.Ctrl+Shift+F --> Format source codeCtrl+Shift+O -- Manage imports and remove unused import statementsIn addition to manually execute these two functions, you can also let Ec...

5,871 0       JAVA STYLE CODE STANDARD


  Getting the most out of your pixels - adapting to view state changes

In Windows 8, your apps run on a variety of screen sizes and under various view states. A user might have your app snapped to the side of a 25-inch desktop monitor, or fill the whole screen of a 10-inch widescreen tablet. In each case, you want your app to take full advantage of the available space. In this post, I show you how you can track the current size and view state of your app in code, and give you tips on how to write your app in the Windows 8 Consumer Preview to handle screen size and view state changes. At //build/ we gave you some ideas on how to design your apps for different scr...

3,923 0       RESOLUTION METRO STYLE WINDOS 8


  A New Experimental Feature: scoped stylesheets

Chromium recently implemented a new feature from HTML5: scoped stylesheets, aka. <style scoped>. A web author can limit style rules to only apply to a part of a page by setting the ‘scoped’ attribute on a <style> element that is the direct child of the root element of the subtree you want the styles to be applied to. This limits the styles to affect just the element that is the parent of the <style> element and all of its descendants. Example Here’s a simple document that uses standard styling:<html><body> <div>a div! <span>a span!...

2,410 0       HTML5 STYLE DRAW USE CASE


  Let Your Programmers Be Silly

6ShareYou’re in the middle of a crazy startup development sprint. Pressure is sky high as you might have to fire everyone if you don’t generate significant traction over the next 4 months. Make it or #fail situation.The guys (I wish we’d have girls but … wait we have a student, anyway) are killing tickets and you’re pretty much on the target you’ve set with your investors. Not comfortably confident but ok.And you catch your guys debating, for multiple days, whether they should be using “n/a” or a slashed zero to represent a div by ...

2,339 0       PROGRAMMER STYLE WORK MANAGEMENT


  JavaScript Needs Blocks

While reading Hacker News posts about JavaScript, I often come across the misconception that Ruby’s blocks are essentially equivalent to JavaScript’s “first class functions”. Because the ability to pass functions around, especially when you can create them anonymously, is extremely powerful, the fact that both JavaScript and Ruby have a mechanism to do so makes it natural to assume equivalence.In fact, when people talk about why Ruby’s blocks are different from Python‘s functions, they usually talk about anonymity, something that Ruby and JavaScript share...

1,863 0       JAVASCRIPT BLOCK STYLE FORMAT MAINTAINEBILITY


  All Programmers Are Self-Taught

When I was a teenager I played high caliber baseball. I’m competitive to a fault and when I decide I want to be good at something, results usually follow. Now I’m a third year undergrad studying computer science. There’s something critically different between programming and sports though: A pitching coach teaches you how to pitch, but a CS professor doesn’t teach you how to code.I was surprised that neither my TAs nor professors critiqued my code during my first year, but grew concerned after my second year. The assignments were larger and the problems tougher, but...

4,419 0       PROGRAMMING HABIT STYLE SELF LEARNING


  Front-end Style Guides

We all know that feeling: some time after we launch a site, new designers and developers come in and make adjustments. They add styles that don’t fit with the content, use typefaces that make us cringe, or chuck in bloated code. But if we didn’t leave behind any documentation, we can’t really blame them for messing up our hard work. To counter this problem, graphic designers are often commissioned to produce style guides as part of a rebranding project. A style guide provides details such as how much white space should surround a logo, which typefaces and colours a brand u...

3,948 0       DESIGN CSS STYLE SYSTEM GUIDELINE