马上加入IBC程序猿 各种源码随意下,各种教程随便看! 注册 每日签到 加入编程讨论群

C#教程 ASP.NET教程 C#视频教程程序源码享受不尽 C#技术求助 ASP.NET技术求助

【源码下载】 社群合作 申请版主 程序开发 【远程协助】 每天乐一乐 每日签到 【承接外包项目】 面试-葵花宝典下载

官方一群:

官方二群:

趣文:程序员的进化史

[复制链接]
查看4663 | 回复1 | 2013-9-10 11:00:36 | 显示全部楼层 |阅读模式
初中/高中(注:Basic)

PRINT "HELLO WORLD"
END
 
大一(注:Pascal)
program Hallo(output);
begin
    writeln('Hello, world!')
end.
 
大三/大四
(defun hello
  (print
    (cons 'Hello (list 'World))))
 
入职第一年
#include <stdio.h>
void main(void)
{
&#160; char *message[] = {"Hello ", "World"};
&#160; int i;
&#160;
&#160; for(i = 0; i < 2; ++i)
&#160; &#160; printf("%s", message[i]);
&#160; printf("\n");
}
&#160;
入职干了几年
#include <iostream.h>
#include <string.h>
&#160;
class string
{
private:
&#160; int size;
&#160; char *ptr;
&#160;
string() : size(0), ptr(new char[1]) { ptr[0] = 0; }
&#160;
&#160; string(const string &s) : size(s.size)
&#160; {
&#160; &#160; ptr = new char[size + 1];
&#160; &#160; strcpy(ptr, s.ptr);
&#160; }
&#160;
&#160; ~string()
&#160; {
&#160; &#160; delete [] ptr;
&#160; }
&#160;
&#160; friend ostream &operator <<(ostream &, const string &);
&#160; string &operator=(const char *);
};
&#160;
ostream &operator<<(ostream &stream, const string &s)
{
&#160; return(stream << s.ptr);
}
&#160;
string &string:perator=(const char *chrs)
{
&#160; if (this != &chrs)
&#160; {
&#160; &#160; delete [] ptr;
&#160; &#160;size = strlen(chrs);
&#160; &#160; ptr = new char[size + 1];
&#160; &#160; strcpy(ptr, chrs);
&#160; }
&#160; return(*this);
}
&#160;
int main()
{
&#160; string str;
&#160;
&#160; str = "Hello World";
&#160; cout << str << endl;
&#160;
&#160; return(0);
}
&#160;

大师程序员
&#160; [uuid(2573F8F4-CFEE-101A-9A9F-00AA00342820)]
&#160; library LHello
&#160; {
&#160; &#160; &#160; // bring in the master library
&#160; &#160; &#160; importlib("actimp.tlb");
&#160; &#160; &#160; importlib("actexp.tlb");
&#160;
&#160; &#160; &#160; // bring in my interfaces
&#160; &#160; &#160; #include "pshlo.idl"
&#160;
&#160; &#160; &#160; [
&#160; &#160; &#160; uuid(2573F8F5-CFEE-101A-9A9F-00AA00342820)
&#160; &#160; &#160; ]
&#160; &#160; &#160; cotype THello
&#160; &#160;{
&#160; &#160;interface IHello;
&#160; &#160;interface IPersistFile;
&#160; &#160;};
&#160; };
&#160;
&#160; [
&#160; exe,
&#160; uuid(2573F890-CFEE-101A-9A9F-00AA00342820)
&#160; ]
&#160; module CHelloLib
&#160; {
&#160;
&#160; &#160; &#160; // some code related header files
&#160; &#160; &#160; importheader(<windows.h>);
&#160; &#160; &#160; importheader(<ole2.h>);
&#160; &#160; &#160; importheader(<except.hxx>);
&#160; &#160; &#160; importheader("pshlo.h");
&#160; &#160; &#160; importheader("shlo.hxx");
&#160; &#160; &#160; importheader("mycls.hxx");
&#160;
&#160; &#160; &#160; // needed typelibs
&#160; &#160; &#160; importlib("actimp.tlb");
&#160; &#160; &#160; importlib("actexp.tlb");
&#160; &#160; &#160; importlib("thlo.tlb");
&#160;
&#160; &#160; &#160; [
&#160; &#160; &#160; uuid(2573F891-CFEE-101A-9A9F-00AA00342820),
&#160; &#160; &#160; aggregatable
&#160; &#160; &#160; ]
&#160; &#160; &#160; coclass CHello
&#160; &#160;{
&#160; &#160;cotype THello;
&#160; &#160;};
&#160; };
&#160;
&#160; #include "ipfix.hxx"
&#160;
&#160; extern HANDLE hEvent;
&#160;
&#160; class CHello : public CHelloBase
&#160; {
&#160; public:
&#160; &#160; &#160; IPFIX(CLSID_CHello);
&#160;
&#160; &#160; &#160; CHello(IUnknown *pUnk);
&#160; &#160; &#160; ~CHello();
&#160;
&#160; &#160; &#160; HRESULT &#160;__stdcall PrintSz(LPWSTR pwszString);
&#160;
&#160; private:
&#160; &#160; &#160; static int cObjRef;
&#160; };
&#160;
&#160; #include <windows.h>
&#160; #include <ole2.h>
&#160; #include <stdio.h>
&#160; #include <stdlib.h>
&#160; #include "thlo.h"
&#160; #include "pshlo.h"
&#160; #include "shlo.hxx"
&#160; #include "mycls.hxx"
&#160;
&#160; int CHello::cObjRef = 0;
&#160;
&#160; CHello::CHello(IUnknown *pUnk) : CHelloBase(pUnk)
&#160; {
&#160; &#160; &#160; cObjRef++;
&#160; &#160; &#160; return;
&#160; }
&#160;
&#160; HRESULT &#160;__stdcall &#160;CHello:rintSz(LPWSTR pwszString)
&#160; {
&#160; &#160; &#160; printf("%ws
", pwszString);
&#160; &#160; &#160; return(ResultFromScode(S_OK));
&#160; }
&#160;
&#160; CHello::~CHello(void)
&#160; {
&#160;
&#160; // when the object count goes to zero, stop the server
&#160; cObjRef--;
&#160; if( cObjRef == 0 )
&#160; &#160; &#160; PulseEvent(hEvent);
&#160;
&#160; return;
&#160; }
&#160;
&#160; #include <windows.h>
&#160; #include <ole2.h>
&#160; #include "pshlo.h"
&#160; #include "shlo.hxx"
&#160; #include "mycls.hxx"
&#160;
&#160; HANDLE hEvent;
&#160;
&#160; &#160;int _cdecl main(
&#160; int argc,
&#160; char * argv[]
&#160; ) {
&#160; ULONG ulRef;
&#160; DWORD dwRegistration;
&#160; CHelloCF *pCF = new CHelloCF();
&#160;
&#160; hEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
&#160;
&#160; // Initialize the OLE libraries
&#160; CoInitializeEx(NULL, COINIT_MULTITHREADED);
&#160;
&#160; CoRegisterClassObject(CLSID_CHello, pCF, CLSCTX_LOCAL_SERVER,
&#160; &#160; &#160; REGCLS_MULTIPLEUSE, &dwRegistration);
&#160;
&#160; // wait on an event to stop
&#160; WaitForSingleObject(hEvent, INFINITE);
&#160;
&#160; // revoke and release the class object
&#160; CoRevokeClassObject(dwRegistration);
&#160; ulRef = pCF->Release();
&#160;
&#160; // Tell OLE we are going away.
&#160; CoUninitialize();
&#160;
&#160; return(0); }
&#160;
&#160; extern CLSID CLSID_CHello;
&#160; extern UUID LIBID_CHelloLib;
&#160;
&#160; CLSID CLSID_CHello = { /* 2573F891-CFEE-101A-9A9F-00AA00342820 */
&#160; &#160; &#160; 0x2573F891,
&#160; &#160; &#160; 0xCFEE,
&#160; &#160; &#160; 0x101A,
&#160; &#160; &#160; { 0x9A, 0x9F, 0x00, 0xAA, 0x00, 0x34, 0x28, 0x20 }
&#160; };
&#160;
&#160; UUID LIBID_CHelloLib = { /* 2573F890-CFEE-101A-9A9F-00AA00342820 */
&#160; &#160; &#160; 0x2573F890,
&#160; &#160; &#160; 0xCFEE,
&#160; &#160; &#160; 0x101A,
&#160; &#160; &#160; { 0x9A, 0x9F, 0x00, 0xAA, 0x00, 0x34, 0x28, 0x20 }
&#160; };
&#160;
&#160; #include <windows.h>
&#160; #include <ole2.h>
&#160; #include <stdlib.h>
&#160; #include <string.h>
&#160; #include <stdio.h>
&#160; #include "pshlo.h"
&#160; #include "shlo.hxx"
&#160; #include "clsid.h"
&#160;
&#160; int _cdecl main(
&#160; int argc,
&#160; char * argv[]
&#160; ) {
&#160; HRESULT &#160;hRslt;
&#160; IHello &#160; &#160; &#160; &#160;*pHello;
&#160; ULONG &#160;ulCnt;
&#160; IMoniker * pmk;
&#160; WCHAR &#160;wcsT[_MAX_PATH];
&#160; WCHAR &#160;wcsPath[2 * _MAX_PATH];
&#160;
&#160; // get object path
&#160; wcsPath[0] = '\0';
&#160; wcsT[0] = '\0';
&#160; if( argc > 1) {
&#160; &#160; &#160; mbstowcs(wcsPath, argv[1], strlen(argv[1]) + 1);
&#160; &#160; &#160; wcsupr(wcsPath);
&#160; &#160; &#160; }
&#160; else {
&#160; &#160; &#160; fprintf(stderr, "Object path must be specified\n");
&#160; &#160; &#160; return(1);
&#160; &#160; &#160; }
&#160;
&#160; // get print string
&#160; if(argc > 2)
&#160; &#160; &#160; mbstowcs(wcsT, argv[2], strlen(argv[2]) + 1);
&#160; else
&#160; &#160; &#160; wcscpy(wcsT, L"Hello World");
&#160;
&#160; printf("Linking to object %ws\n", wcsPath);
&#160; printf("Text String %ws\n", wcsT);
&#160;
&#160; // Initialize the OLE libraries
&#160; hRslt = CoInitializeEx(NULL, COINIT_MULTITHREADED);
&#160;
&#160; if(SUCCEEDED(hRslt)) {
&#160;
&#160; &#160; &#160; hRslt = CreateFileMoniker(wcsPath, &pmk);
&#160; &#160; &#160; if(SUCCEEDED(hRslt))
&#160; &#160;hRslt = BindMoniker(pmk, 0, IID_IHello, (void **)&pHello);
&#160;
&#160; &#160; &#160; if(SUCCEEDED(hRslt)) {
&#160;
&#160; &#160;// print a string out
&#160; &#160;pHello->rintSz(wcsT);
&#160;
&#160; &#160;Sleep(2000);
&#160; &#160;ulCnt = pHello->Release();
&#160; &#160;}
&#160; &#160; &#160; else
&#160; &#160;printf("Failure to connect, status: %lx", hRslt);
&#160;
&#160; &#160; &#160; // Tell OLE we are going away.
&#160; &#160; &#160; CoUninitialize();
&#160; &#160; &#160; }
&#160;
&#160; return(0);
&#160; }
&#160;




新手黑客
#!/usr/local/bin/perl
$msg="Hello, world.\n";
if ($#ARGV >= 0) {
&#160; while(defined($arg=shift(@ARGV))) {
&#160; &#160; $outfilename = $arg;
&#160; &#160; open(FILE, ">" . $outfilename) || die "Can't write $arg: $!\n";
&#160; &#160; print (FILE $msg);
&#160; &#160; close(FILE) || die "Can't close $arg: $!\n";
&#160; }
} else {
&#160; print ($msg);
}
1;
&#160;




有经验的黑客
#include <stdio.h>
#define S "Hello, World\n"
main(){exit(printf(S) == strlen(S) ? 0 : 1);}
&#160;




入行干过好些年的黑客
% cc -o a.out ~/src/misc/hw/hw.c
% a.out
&#160;




黑客大师
% echo "Hello, world."
&#160;




新手经理
PRINT "HELLO WORLD"
END

中级经理
mail -s "Hello, world." bob@b12
鲍勃,你能帮我写个输出“Hello, world.”的程序么?
我明天就要。
谢谢~
&#160;

高级经理
% zmail jim
Jim,我今天下午就要输出 “Hello, world.” 的程序!
&#160;

CEO/首席执行官
% letter
letter: Command not found.
% mail
To: ^X ^F ^C
% help mail
help: Command not found.
% damn!
!: Event unrecognized
% logout
it招聘
USABOGEDAY | 2014-1-26 14:22:51 | 显示全部楼层
看不到的说
*滑块验证:
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则