Do-it-Yourself or looking for a Ready-for-Use package?
programming
71
White

Joe viết ngày 28/03/2018

Hi

After 2 years with different IT fora my impression about Vietnamese IT Development community is ambiguous. It's like standing in the twilight -neither dark, nor bright. Even when I look into some "more professional" sites such as Kipalog.com I mostly found contributions that deal more with using than developing. I wonder out loud about the reasons. Are they IT developers or IT users? I don't know and look for an answer HERE. The fact is: if it's about a contribution, it's usually about the usage of something.

This asking, for example, "Data visualization tool for machine learning?" on a Forum is one of the Looking-for-a-Ready-For-Use proof. The author may argue that "he does not want to reinvent the wheel". He errs. Probably because of his lack of IT self-confidence. Jack Ma becomes a Multi-billionaire because he did reinvent "Alibaba" from the old wheel "Amazon" pioneered by Jeff Bezos

A veritable developer, newbie or not, always starts to ponder about his/her own solution, tries to devise a raw way how to attain the goal. If one claims to be an IT developer and knows what one needs why one has to ask around for a "ready-for-use" solution? Does (s)he know that such an "asking effort" just reveals his/her inability to work as an IT developer?

Or why a company should hire a high-paid IT personal whose "job" is to ask around for ready-for-use applications? It's much cheaper to hire a low-paid clerk who gets a list of needed "ready-for-use" packages and does the search and the assembling (i.e. "coding").

Some forum members love to talk about high-flying solutions, coquette with "complex-and-abstract" mathematic algorithms, boast with thunderous buzzwords (e.g. Data Visualization for Machine Learning) but some of them cannot even spell a word in correct English or understand about the thing they are speaking of. Everyone knows XOR (Exclusive OR). How many IT developers know about its application in real life?

Problem: A dark sleeping room: How to switch the bulb on so that one can go to bed and to switch it off without having to stand up and to go to the switch at the door?

Solution: 2 switches. One at the door, one at the bed. The switches need only to be XORed.

alt
Most "IT developers" complain loudly about slowness and sluggishness of this or that, but does (s)he has ever thought about an alternative, a new solution to circumvent the slowness, to bypass the sluggishness? I demonstrate hereunder 2 most basic methods which look more complex and more verbose than the standard counterparts (but in reality they aren't):

  • toDouble(String) versus Double.parseDouble(String)
  • toInt(String) versus Integer.parseInt(String)

It's in JAVA, but applicable with every OOPL.

public class BasicMath {
    public static void main(String... a) throws Exception  {
        if (a.length != 2) {
            System.out.println("Usage: java BasicMath int_String Double_String");
            System.exit(0);
        }
        for (int i = 0, len = a[0].length(); i < len; ++i)
        if (a[0].charAt(i) < '0' && a[0].charAt(i) != '-' || a[0].charAt(i) > '9')
        throw new Exception("Invalid integer:"+a[0]);
        for (int i = 0, len = a[1].length(); i < len; ++i)
        if (a[1].charAt(i) < '0' && a[1].charAt(i) != '-' && a[1].charAt(i) != '.' || a[1].charAt(i) > '9')
        throw new Exception("Invalid double:"+a[1]);

        BasicMath t = new BasicMath(a);
    }
    public BasicMath(String... a) {
        long beg, t1, t2;;
        double d;
        int I;
        //
        System.out.println("Time in NanoSeconds");
        System.out.println("----------------------------------------------------");
        beg = System.nanoTime();
        d = toDouble(a[1]);
        t1 = System.nanoTime()-beg;
        System.out.println(" 1.T1="+t1+"\td="+d+" for toDouble");
        //
        beg = System.nanoTime();
        d = Double.parseDouble(a[1]);
        t2 = System.nanoTime()-beg;
        System.out.println(" 2.T2="+t2+"\td="+d+" for Double.parseDouble\n"+
                           " The difference: T2-T1:"+(t2-t1)+" nanoSec.");
        //
        System.out.println("----------------------------------------------------");
        beg = System.nanoTime();
        I = toInt(a[0]);
        t1 = System.nanoTime()-beg;
        System.out.println(" 3.T1="+t1+"\tI="+I+" for toInt");
        //
        beg = System.nanoTime();
        I = Integer.parseInt(a[0]);
        t2 = System.nanoTime()-beg;
        System.out.println(" 4.T2="+t2+"\tI="+I+" for Integer.parseInt\n"+
                           " The difference: T2-T1:"+(t2-t1)+" nanoSec.");
        //
        System.out.println("----------------------------------------------------");
    }
    private int toInt(String I) {
        boolean neg;
        int li, i = 0;
        if (I.charAt(0) == '-'){
            neg = true;
            li = 1;
        } else {
            neg = false;
            li = 0;
        }
        for (int b = I.length()-1, f = 1; b >= li; --b) {
            i += (I.charAt(b)&0x0F)*f;
            f *= 10;
        }
        return (neg? -i: i);
    }
    private double toDouble(String D) {
        boolean neg;
        double d = 0;
        int li, i = 0;
        if (D.charAt(0) == '-'){
            neg = true;
            li = 1;
        } else {
            neg = false;
            li = 0;
        }
        if (D != null) {
            int len = D.length();
            for (int b = 0; b < len; ++b)
            if (D.charAt(b) == '.') {
                double f = 10d;
                for (int e = b+1; e < len; ++e) {
                    d += (double)(D.charAt(e)&0x0F)/f;
                    f *= 10;
                }
                f = 1d;
                for (--b; b >= li; --b) {
                    d += (double)(D.charAt(b)&0x0F)*f;
                    f *= 10;
                }
                return (neg? -d:d);
            }
            double f = 1d;
            for (int b = len-1; b >= li; --b) {
                d += (D.charAt(b)&0x0F)*f;
                f *= 10;
            }
        }
        return (neg? -d:d);
    }
}

the results reveal a big dicrepancy between Developer's codes and standard codes.

alt

Joe 28-03-2018

Bình luận


White
{{ comment.user.name }}
Bỏ hay Hay
{{comment.like_count}}
Male avatar
{{ comment_error }}
Hủy
   

Hiển thị thử

Chỉnh sửa

White

Joe

29 bài viết.
216 người follow
Kipalog
{{userFollowed ? 'Following' : 'Follow'}}
Cùng một tác giả
White
27 11
Fuzzy Logic and Machine Learning Hi First of all: I apologize everyone for my writing in English. I come to this site because someone of Daynhauh...
Joe viết 12 tháng trước
27 11
White
25 11
You're a fresh graduate and work for more than 12 months in an IT company with some boring coding tasks... The tasks are unchallenging. Day in, day...
Joe viết 1 tháng trước
25 11
White
23 14
Chao cac ban To the Admins: if you think that this posting breaks some rules of your site please just delete it. NO need to send me a feedback. Th...
Joe viết 24 ngày trước
23 14
Bài viết liên quan
White
53 23
Luận về comment code (Phong cách kiếm hiệp) Comment code luôn là vấn đề gây tranh cãi sứt đầu mẻ trán trong giới võ lâm. Xưa kia, thuở còn mài đít...
Huy Hoàng Phạm viết gần 3 năm trước
53 23
White
13 0
Không gì đẹp bằng nụ cười khi đôi mắt e lệ nhìn xuống. Victor Hugo Các bạn có thể đọc bài viết gốc tại (Link) Tò mò khi tìm hiểu hoạt động của ...
Đào Văn Hùng viết 9 tháng trước
13 0
White
26 2
Khi các ban cố gắng học bất cứ ngôn ngữ cũng như coding skill nào, họ thường gặp một số thách thức tương tự như: Một số khái niệm có thể gây nhầm...
Hoàng Nguyễn viết hơn 2 năm trước
26 2
{{like_count}}

kipalog

{{ comment_count }}

bình luận

{{liked ? "Đã kipalog" : "Kipalog"}}


White
{{userFollowed ? 'Following' : 'Follow'}}
29 bài viết.
216 người follow

 Đầu mục bài viết

Vẫn còn nữa! x

Kipalog vẫn còn rất nhiều bài viết hay và chủ đề thú vị chờ bạn khám phá!