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

SEARCH KEYWORD -- Write



  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

  How Kafka achieves high throughput low latency

Kafka is a message streaming system with high throughput and low latency. It is widely adopted in lots of big companies. A well configured Kafka cluster can achieve super high throughput with millions of concurrent writes. How Kafka can achieve this? This post will try to explain some technologies used by Kafka. Page cache + Disk sequential write Every time when Kafka receives a record, it will write it to disk file eventually. But if it writes to disk every time it receives a record, it would ...

   BIG DATA,KAFKA     2019-03-08 09:42:57

  Writing unit tests for legacy code – an open letter to developers I work with

This is an email I sent today to developers who work with me, it is exactly as I wrote it except for project and developer names which I’ve redacted. Dear Developers, S asked me a difficult question today, and I think the answer (which took me a few minutes to arrive at) is worth sharing with all developers, mainly because many of you will surely face the exact same problem especially in [maintenance and enhancement] projects. By now I think it is crystal clear that one of our non-ne...

   Unit testing,Open letter     2012-02-09 05:39:56

  JavaScript Is Not A Language

Recently people presented arguments for and against using CoffeeScript. I felt the argument against was pointless and obviously wrong, but I couldn't figure out why, and I thought the counterargument for was kind of toothless and irrelevant. I've figured out the real issue.The real argument for CoffeeScript is that JavaScript is not really a language.Years ago I read something which explained, in my opinion, why Lisp has never achieved the mainstream adoption its passionate advocates belie...

   JavaScript,Not a language,CoffeeScript,Model     2011-12-29 08:46:15

  World leaders who know how to code

World leaders are those people who have extraordinary speaking skills and are a group of very busy people in most people's impression. But among them, there are a few who know how to program as well. Today we are going to summarize some of them. Lee Hsien Loong -- Singapore Prime Minister Lee Hsien Loong, Singapore Prime Minister posted a C++ program about Sudoku which he wrote several years ago. He shared the source code on Google Drive as well.  In 1971, Mr. Lee studied Mathema...

   World leader, Coding, Programming     2015-08-02 05:56:20

  Introduction to GoLang generics and advanced usage

Generics in Go allow you to write code that can work with multiple types of data, without having to write separate versions of the code for each type. This can make your code more flexible and easier to maintain, as you only need to write and test the code once, rather than maintaining multiple versions. To use generics in Go, you first need to define a type parameter, which is a placeholder for the type that the code will work with. For example, you might define a type parameter called "T" like...

   GOLANG,GENERICS     2022-12-17 05:12:21

  What to put on whiteboard during an interview

As a programmer, you may go through different kinds of programming tests while interviewing for jobs. The most famous and difficult one may be the whiteboard test for lots of people. Usually the interviewer will give the candidate an algorithm problem or case study and ask the candidate to implement the algorithm with his/her favorite programming language. The code to be written is not too much but it requires the candidate to thoroughly consider different edge cases. So wha...

   TIPS,INTERVIEW,WHITEBOARD TEST     2014-08-29 20:34:52

  4 types of programmers

Not every one who writes code is a programmer. Programmers are people who live with programming. There are 4 types of programmers: scientist, coder, expert and artisan.Scientist, they are more like mathematicians rather than programmers. They invented various theories, algorithms and terminologies. Proofs and calculations in textbooks are all from these people. Moreover other programmers more or less benefit from their work. Sometimes one paper published by them can change the way of thinking of...

   Programmer,Coder,Expert     2013-07-13 09:19:03

  The 9 lines of code of Google

Are you still remembering the then hot debated news about Oracle suing Google allegedly copying a small portion of codes from Oracle's Java in 2010. At that time, Oracle experts estimated that Google owes Oracle between $1.4 billion and $6 billion in damages if liable. But the court thought Oracle was eligible only for statutory damages for that copying, which were not expected to exceed a few hundred thousand dollars. At last, Oracle agreed the zero damage result. Are you curious about whi...

   Google,Java,Open source     2014-08-15 20:29:52

  How deep should unit test go?

There is a question on Stackoverflow which says "How deep are your unit tests?". It is asked by a guy named John Nolan. The question is not too new, but what catches me is the Best Answer given by Kent Beck, who is the creator of Extreme programming(XP) and Test Driven Development(TDD). Let's look at the question first. The thing I've found about TDD is that its takes time to get your tests set up and being naturally lazy I always want to write as little code as possible. The first thing I seem ...

   Unit test,TDD,XP     2012-09-03 10:11:27