5 ms·
PART II Uh, my padawan learner, you need a little more, and I will outline some 'principles' that actually have some lasting value: Some major events in progr
by HilbertSpace 16y ago
PART II
Uh, my padawan learner, you need a little more, and I will outline some 'principles' that actually have some lasting value:
Some major events in programming language design were in the 1950s -- Fortran (arrays, IF statements, and loops), Cobol (hierarchical data structures, IF statements, and loops), Algol (nice source code nesting, name scoping, and call by reference, value, and name, that last one a bit amazing), APL (clever things with arrays and a very sparse syntax -- interpretive), and LISP (a programming language that can examine and change its source code as it runs, with too many parentheses, interpretive).
Then, for icing on that cake, the 1960s were the 'golden age' of programming language design. So, there was PL/I (borrowed from Fortran, Cobol, Algol, and a little from assembler; had some exceptional condition handling NICELY connected with storage management and task management) and Algol 68 (oops, I never learned it!). Somewhere in or near there was C, Pascal, Ada, and Simula.
'Object-oriented' programming (OOP)? Given a language with aggregates, e.g., Fortran arrays and/or Cobol data structures, memory pointers, and dynamic memory allocation, the basics of OOP were immediately obvious and commonly reinvented by any programmer who ever hit a keyboard. IBM had it in microcode in the early 1970s.
Fortran? It didn't have pointers, but after a few lines of assembler it did! Another way was just to have a COMMON block (that is, an 'external' name, that is, 'resolved' by the linkage editor) with one array and use array addresses as memory pointers. If need a little more for manipulating addresses, then write a few, very short assembler routines.
Dynamic memory allocation? Not a lot new there. Actually, for each power of 2, have a root of a chain of pointers for free space of size that power of 2. So, an array of 64 pointers each 64 bits long should be sufficient for a while!
Then, roughly, if want some memory of size m where 2^(n - 1) < m <= 2^n, then go to the root for size 2^n and allocate the first block on the chain and correct the chain. If there is no free block of memory on that chain, then for some k > n allocate a block of size 2^k, use that memory to put its blocks of size 2^n on the chain, and allocate one of those. Can also slightly modify this scheme to free the block of size 2^k when it is empty of blocks of size 2^n. The scheme is fast and easy to implement and especially effective on a virtual memory computer where can get a lot of page alignment and where the 'wasted' free space is mostly just disk space.
Garbage collection (that is, compress out holes)? Not a lot new: Keep references and then move the memory and update the references. Can have some advantages for long running, complicated, production software but has a well deserved reputation for being slow. So far Microsoft's implementation seems to be at least reasonably fast.
'Collections'? Use AVL trees as in the first edition of Knuth's 'The Art of Computer Programming'.
Hashing? Don't miss extensible hashing!
C? A toy language written at Bell Labs for word whacking and so small the compiler could run in 8 KB or 5 KB or some such of main memory. It was so lacking in features that the usual fix-ups people did for OOP were eventually provided in a pre-processor called C++.
- deleted 16y ago[deleted]
- HilbertSpace 16y agoPART IV Assuming you can learn to program, we move right along here: Somewhere in your IT startup you will have to have your Web site go live and then get users and ad revenue. The example you want to follow early on is just Plenty of Fish (look it up -- you know how to do that, right?). For 'venture funding' of such startups, apparently the LPs (uh, 'limited partners', the guys at pension funds, university endowments, life insurance companies, and wealthy families who provide the money the venture people invest) got together and wrote a memo: "Thou shall fund no 'consumer facing' IT startup before the Web site is up and running with at least 100,000 unique users a month and this quantity growing rapidly." Yup, at $0.50 per thousand add impressions, that 100,000 might amount to a grand total of, let's see, may I have the calculator, please, right, $50 a month. So, 100,000 'uniques' is not a lot to take to the bank. But whether you take equity funding or not, that 100 K uniques is an early milestone. So, how to reach this milestone? Study and think a lot, have a few thousand ideas, evaluate them, pick one, learn to program, write software, bring up your Web site, get some publicity, and hopefully see your uniques scream above 1 million a month quickly. Uh, some venture partner idiot, some guy, once said something totally stupid, as idiots are wont to do, "Ideas are easy; execution is hard.". Yup, mark of a total idiot. No wonder he thinks execution is hard -- it is if start with only easy ideas! In fact, GOOD ideas are hard and then, if only by definition, execution is routine. Sorry guy. You need a GOOD idea, and for that you need, first, a wild, off the wall, unconstrained, violate all the common wisdom, high frequency, free running idea generator that has run out a few million ideas. It helps to have the ideas exploiting some powerful fundamentals (I can't go into those here). Then need to evaluate the ideas, ruthlessly, up, down, sideways, inside, outside, etc., today, tomorrow, and next week, and be ferociously critical. Also need to know some good ways to evaluate ideas (I can't go into that here). Only THEN do you have much chance of a GOOD idea. Those few weeks will be time VERY well spent. "Measure twice; saw once." "Look before you leap." At 6 million ad impressions a month at $0.50 per thousand, that's $3000 a month. Maybe with that you are 'profitable'. If you are just running your own Web servers and not paying a 'hosting' service, then actually the $3000 is enough for you to buy another Web server to handle the increased load! If you plug it together yourself from parts, $3000 will buy one very powerful computer. Software? Versions of Unix, MySQL, etc, are free or nearly so. Microsoft has their BizSpark program where they will provide their software for free for a while to startups. More generally, think 'exponentially': If your usage keeps growing, then ballpark you will have enough revenue in month n to double your server farm capacity in month n + 1. Right, Virginia, that's exponential growth, that is, the good kind, actually, very rapid exponential growth. Maybe in a few months of exponential growth you will be like Plenty of Fish: One guy, two old Dell computers, ads just via Google, and $10 million a year in revenue. So, at that point, do you want raise equity funding, say, spend some months getting insulted by venture partners, finally get one or a few 'term sheets', get some 'founder vesting' (where suddenly you go from owning 100% of your company to owning 0% and have some chance of getting back to maybe 50% in four years), an 'option pool', 'liquidity preferences' (where the company can be sold for a lot of money but where you get $0.00), and a Board that understands the term sheet much better than you do and otherwise hasn't written much code in the last 10 years, doesn't understand your business, may never have started a business, is arrogant and nasty, and can fire you and put in one of their buddies who will do a 'pay to play down round' that leaves you with nearly 0% of your company and the venture partners and their buddy with all the rest. However, maybe you do want some venture funding. Actually, the uniques at 100,000 and growing quickly will get you some serious attention at a major fraction of 'early stage IT' firms anywhere in the country. Right: As in a Bogie movie, "We didn't pay attention to your story. We paid attention to your $100." So the venture firms will pay attention to your uniques. Remember 'The Little Red Hen' in Mother Goose? You should. We're talking, what, no more than second grade here, right? So, in NYC there are only Union Square, RRE, and a few more? Okay, but there's no law that says that the venture firms on Winter Street, elsewhere in MA, in Philadelphia, Maryland, or Virginia can't invest. And some Silicon Valley firms can also invest, even if you are in NYC. Net, the NYC 'startup scene', "backwater" or not, is nearly irrelevant. Instead, for an entrepreneur, what matters is YOUR business. Can you write your best code in NYC? Of COURSE you can: You can write good code nearly anywhere with a good Internet connection and room for coffee, pizza, and a good table, chair, and desktop. What matters for YOU is the work YOU do. A necessary and sufficient condition to correct the 'backwater' is for you and other entrepreneurs just to GET YOUR DARNED WORK DONE. There are lots of excuses not to do work, e.g., the dog ate my homework, my landlord wouldn't fix the faucet, I couldn't buy wine at 2 AM, I can't find a fantasy Samuel Johnson style 'coffee shop', NYC is a "backwater", and due to Wall Street I can't hire a programmer. Uh, we are learning one of the larger lessons in business: One reason there are so few rich people is that there are so many ways for people to get off the track. Another excuse is explaining kindergarten level stuff to idiots on Hacker News, an excuse I will now discard and get back to writing the rest of my software.