The Way to Programming
The Way to Programming
This are the words of your future Code Master but seriously guys i need some advice.
I’m taking now the first steps into programming and i would need recommendations to what books to start reading.
I’m highly motivated to become The Code Master I know it takes a lot more than just said but i’m a tough guy to wrestle and i have a lot of abilities which can bring me into that position but enough said i don’t wont to waist time here talking about me…
So please write me you recommendations and if you can suggest schools to go i prefer internet learning or e-learning by distance.
This 3 books is what I have so far see:
1. The Art of Computer Programming – D.Knuth
2. Concrete Mathematics – D.Knuth
3. C Programming A Modern Approach 2nd Ed –
Your advice i highly appreciated
There is no point reading any of these as your first books. You will just think that its too hard and lose interest. Start slow, maybe by learning a high level interpreted language like Python or PHP. Then, work your way from there to C#, Java and the likes. Once you’re comfortable, move down to C++ and C (the third book). And then, if you feel that you can handle anything, try assembly. But, let me warn you, you won’t be getting there anytime soon. And as you’ll go deeper, you will start realizing that you have done blunders in your past programs and then won’t repeat it again. The key is to get results as soon as you can so that the motivation to code remains.
The first two books come in handy when you want to work with more than your trivial algorithms. But I’d say forget them for now, you’ll only end up confusing yourself. Believe me, when you actually need the knowledge they contain, you will end up reading them but not any time sooner. You simply won’t be motivated enough to slog through hundreds of pages of complex mathematics and higher-order thinking.
Well, as a future Code Master (whatever that means…), among many other “best practices”, you’ll come across the DRY principle.
DRY, in this context, stands for “don’t repeat yourself” – as in, don’t ever write the same code more than once. You’ll eventually understand the *many* reasons for this, but suffice to say that it is both inefficient and dangerous.
When you come here asking “how to learn to program” without doing a simple search first, you’re asking us to break that very DRY principle!
If you don’t want to search WBB, then use Google: the first 10 replies to “learn to program” bring very useful resources (online, as you prefer): from online free schools (Coursera, CodeAcademy) to well-thought out and respected counter-opinions (Jeff Atwood’s “programming is not for everyone” article).
A master programmer must always be, foremost, a master searcher
I think this would be the best course for you. You need to sign up for it. You can still access the lectures and programs for a few months afterwards. The speaker is a good teacher as well. They start right from the basics.
https://www.edx.org/courses/HarvardX/CS50x/2012/info
I wouldn’t recommend to read any books at all, what I’d do is pick one language that interests you and start looking at existing scripts.
Of course you could read a book to learn basic syntax if you’ve never been in touch with any kind of programming at all.
However, there’s plenty of decent tutorials and guides out there so no need to spend money – especially since programming literature is usually not exactly cheap.
My approach would be to look at code samples and existing scripts to understand what exactly they do and then implement what you’ve learned into your own work.
You will quickly grow tired of programming when you just read dry literature rather than actually trying to code something yourself and books won’t teach you that.
It doesn’t matter if your code doesn’t work in the beginning, the feeling once you manage to fix all those bugs and start to figure out why things didn’t work will be even more rewarding.
The languages I’d recommend to beginners would be C# for Windows applications and PHP for web applications.
They utilize a considerably readable and organised syntax, which resembles many other languages, and after a while you’ll read and understand the code easily.
Of course which language you choose in the end will depend on what kind of applications you want to develop, but if you just want to get started on anything I’d recommend those.
Well, I recommend, learning programming technics, desing patterns, object oriented programming. Socket programming, Concurrency, Data Persistence. Those are the concepts, if you know context programming language is not a big deal. It is like knowing how to write. If you know how to write, the instrument that you use while writing in this case are programming languages.
Pick a language, and start learning those concepts by practicing with that language, and expand your knowledge. As you progress you will see some programming languages provides alternative methods to most commonly faced problems during development phase.
I strongly suggest you to switch Linux environment. Don’t ask why ask google.
The languages I’d recommend to beginners would be C# for Windows applications and PHP for web applications.
PHP was a good recommendation, but C# was not. C# is completely object oriented and it can be overwhelming for a beginner. So I say you stick to PHP and learn its object oriented side too (which is a fairly advanced PHP concept), so you’ll have a better understanding when moving to complete object oriented programming languages such as C#, Java, C++ etc.
I strongly suggest you to switch linux environment. Dont ask why ask google.
I don’t see this being relevant to this topic, but Linux wont make you a better programmer. It depends on the platform in some cases, like if you want to make Mac/iPhone applications, you have to use a Mac. But in general programming, all operating systems are equal, all having advantages and disadvantages.
So why i am telling to switch linux environment is, when you deal an issue about operating system, you are involving software topics, maybe some coding etc. Ofc linux doesnt make you “code master” but it forces you to learn topics in software engineering. What i mean is:
There are a lot of advantages of choosing Linux as a development platform that why i said “ask google”
Well, I strongly against this idea:
The reason I suggested that is that it can be very satisfactory for a complete beginner once they see the final product - an actual Windows application and *.exe file.
C# is very user-friendly, in my opinion, especially since Visual Studio let's you just drag all the GUI elements you want into your application and the auto-complete features can be very useful too.
If you don’t have full control on your source code, and you dont have any knowledge about delivering a software to final product and choosing a crappy IDE to do this delivering job for you, well forget about being code master. First you have to learn basics like build your GUI from scratch and learn how GUI logic works, how layout managers handles components etc, how software is delivered to target platform? After you learn those stuffs then you can use “wizards”, “gui designers” to increase your productivity.
If you dont have full control on your source code, and you dont have any knowledge about delivering a software to final product and choosing a crappy IDE to do this delivering job for you, well forget about being code master. First you have to learn basics like build your GUI from scratch and learn how GUI logic works, how layout managers handles components etc, how software is delievered to target platform? After you learn those stuffs then you can use "wizards", "gui designers" to increase your productivity.
Suggesting people to switch their whole working environment to Linux and telling them to begin with coding GUIs from scratch and learning programming theory is a great and very motivating way to get started on the subject – you should write a book mate. Laughing
On a serious note, do not listen to this guy – stay on Windows and take small steps. C# and PHP are good languages to get started with, plus it’s perfectly okay to use an IDE like Visual Studio to help you with GUI creation until you feel confident to build your own.
If you learn the most dry of things first it will scare you off from programming in no time, there’s a reason why people start with easier programming languages and don’t learn C or Assembly first – although I’m sure our “codemaster” would recommend doing that.
I would recommend starting with
www.codeacademy.com.
It’s a free hands-on way to learn programming in several languages (including all the important web programming ones). Next, I would get the book “Programming for Mac OSX” by Aaron Hillegaas and Adam Preble which teaches you Objective C in a very nice and intuitive way.
To be honest, I wouldn’t start learning C, it’s a lot steeper learning curve than learning one of the more simpler and user-friendly languages (like python or even Java) and then learning C.
Another good book (this one deals with python), is Learning Python by Mark Lutz. Any book out of O’Reilly publishing is good IMHO. Good Luck!
I’d highly suggest course at
http://www.udacity.com/
As for books, I’d highly recommend the head first series, they really ease you into the flow, when I first started programming it was the, “C Programming Language” book, but I’d highly suggest starting with the Head First series. I’d suggest starting with Python, it isn’t just for babies, I promise.
#1 problem/requirement to becoming a programming: follow-through, even if something seems, “stupid” or you already know it, do it anyway, plop the code in your IDE or text file, and compile/run it. Just do it.
Many people will say to you need to follow this path or this other path; use this language or some fancy DRY Principle formulated by Andy Hunt and Dave Thomas or OOP or some other meaningless constructs.
The truth is, there is no one single (one size fits all) paradigm that will work for all programming situations other than the constructs put forth by Edsger W. Dijkstra in the early 80’s that liberated us programmers from the nefarious GOTO statements and spaghetti code of the late 70’s and early to mid 80’s.
Sequence, Decision and Looping statements, assembled correctly, will work for one line program or for 16,000,000 lines of code spanning several different computer architectures.
People involved with programming become almost ‘Religious” in their zeal to promote a certain way of doing things. I remember the ‘wars’ at Stanford between DEC VAX/VMS and UNIX in the early 80’s. DEC had a stellar OS that beat the pants off of UNIX in Real Time processing back then.
But your question is about programming.
Programming is a discipline, and like any other profession, there are many facets that you have to learn. It is part art-form and part science; art-form in the sense that each program, like a painting, is a creative work. Some are elegant, eloquent solutions to problems. Other’s, like Microsoft’s OS offerings, are tedious bloated piles of (you can put in your own imaginative word here).
So what does a programmer do?
Anyone doing this regardless of title is doing Data Processing. We have a task to accomplish, we take input, do some processing (store a few things) and spit out the results with text, pictures, video, music or a combination of all of those things.
We provide solutions. It is critical that you be able to a) Understand the problem you are hoping to solve; be able to take that problem and dissect it into smaller components. c) Create a solution or algorithm and d) Code and Implement the solution. At this point in time of our discussion, the Languages used, the hardware, Source Code generators, or any of the other tools used are, for the moment, irrelevant.
(A decent .pdf file is located here with some good insight to the big picture http://www.uclouvain.be/cps/ucl/doc/ingi/documents/Kellens.pdf)
When we program computers we are, in a sense, giving directions from a map we have created. Directions / steps that the computer must follow to complete the task. Another analogy is following a recipe for making Beef Wellington.
The classical definition of a program is “A set of finite steps necessary to complete a task”
Are all programs alike on the inside? Is there more than one way to “skin a cat”?
When I first started programming more than 36 years ago I really didn’t have a style, I didn’t have that “Signature Dish” that chefs do. Eventually after hundreds of thousands of lines of code hundreds of projects you will settle into comfortable design methodology that works for you. There is really no right or wrong way to write a program.
If the program works and produces the end result then it is correct, by the definition of a program which is a set of finite steps that performs a task.
However, that being said, when I was teaching a College C class in the mid 80’s I thought hmmm, how do I illustrate this concept? One evening, at around 8:00 PM, I had my computer (a UNIX System at the time) some coffee and beer and proceeded to write more than 125 unique and different ways to write a program that displayed the text “Are we having fun yet?”
The printout, on the old continuous impact printer with perforated paper was about 250 pages long. I pulled out all the stops! I mixed Assembler code in with the C; used Inter process communication; Structures; arrays of structures; pointers with 5 levels of de referencing / indirection. One code example was 225 lines long. I named it “Job Security” because only the person who wrote such a mangled mess could understand it.
When I asked the students how many ways they could think of to write this program hands stopped going up after 5 different ways (we were in week five of the semester) I said follow me. I took my “fashionable” black attach case set it on one end of the long hallway and proceeded to walk almost to the other end of the building. I said look at all of these unique and different ways to accomplish this task.
I pointed out the straight forward, easy to understand, easy to modify and easy to maintain examples along with the Job Security examples. Things you should avoid doing.
Programs, they all do the same thing.
What sets them apart is elegance. A good program, one that is elegant, is the almost “perfect” solution. It is easy to understand, it is easy to maintain or modify, it lends itself to being adapted for other uses (unless it is just a weird project) and it can be expanded fairly easily; meaning it is designed with the possibility that more will be expected of it in the future. Programming is a synergy of Science and Art. With Science you have logic and structure and with Art you have Passion and Creativity.
In the mid 90’s when I was looking back at some of the 80’s code I had written and I was very proud, at the time, I wanted to gag! It wasn’t horrible, but it wasn’t pretty either.
Just like playing drums; you practice you get better. Don’t worry about saving the code and macros so much… grow; learn; explore; and gain experience. You will find that stuff will automatically start flowing out of you where you won’t need the old code anymore.
One gift I have always had which helped with drums as well as programming is that I’ve been able to recognize the patterns in software code and I can remember where they are located.
If I’m writing a new program and I need some date handling routines or i need something that will calculate compound interest rates I know where to look for it. I try to write code that is fairly generic in nature so that I can have some re-usability down the road. OOP Object Oriented Programming teaches you to create things that can be used again
Not all people are cut out to be programmers. It requires logic, tenacity, the ability to dissect a problem into small discrete pieces to arrive at a solution.
I have written more than a million and a half lines of programming code (combined) in the last 38 years in RPG, COBOL, ADA, Fortran 77, Basic, BASICA, GW BASIC, Pascal, C, C++, Objective C, Smalltalk, VAX ASSEMBLER, PC ASSEMBLER, Motorola ASSEMBLER, Visual C, Visual BASIC, PHP, Java, .NET, Lisp and a wee bit of Python. Not to forget Unix Shell, DEC DCL, and crappy old DOS Shell Command language.
Each language has strengths and weaknesses. Each language has aspects that make it better for some applications over others. For example, you would not use COBOL for video processing.
I have written some very complex programs (database applications) where the local database is an MS ACCESS database. This database then uploads information to an online MySQL database using a server I wrote in PHP and then I used PHP to construct the website allow users to log in and view the data. All of the data synchronization is automatic and is two way.
I suggest, that in order to learn how to program, that you read a few books on the procedures for programming and then I would use Visual Basic in the MS ACCESS environment. Why? It is a development environment is more forgiving and easer to use while being a little more intuitive than Visual Studio and certainly much simpler than the hideous .NET environment. (Don’t flame me that’s just my opinion!)
Access has a good debugger and allows for a quick and easy environment to learn HOW to program.
If you then decide that programming is what you want to do and you have an aptitude for it, then you can specialize in whatever field interests you and migrate to the language that best suits that field.
For example, if you want to join the project and help develop Linux then C, C++ will and perhaps some ASSEMBLER would be necessary. If you want to program for the iPod then Objective C (my favorite language of ALL TIME) will be necessary.
Programming is telling a computer what to do. The syntax (language specific instructions) varies from language to language, but you’re doing essentially the same things; getting input, doing calculations, storing data etc.
Search out and look at some simple examples in four or five languages. Google the classic “Hello World” program.
Many people look at some languages and also various OS’s as well, with an almost religious context, that some are very superior over others. They get offended easily when someone (like me) says that their favorite OS belongs in the trash bucket. As I mentioned earlier, the battle lines were drawn between the Unix Camps vs the DEC Camps at Stanford and many other places. Not to mention the very caustic arguments that between C and C++ or C++ and Objective C.
It’s a waste of energy to get worked up about these things!
I have no loyalty to anything! To be honest, I’m really partial to the NeXT Operating System. It was the best OS I have ever used to this day.
This picture says it all;
The year is 1993! Two competing OS’s from the same period. The inferior OS (Windows 3.1) is running INSIDE the Superior OS (NeXTSTEP) as a sub process on the left side of the screen; yet, the INFERIOR OS got the most market share and became the dominant OS. This is a case where brute force business tactics wins over Elegance.
Those lucky enough to use this on a daily basis are sad at the turn of events. And we wonder what would the OS of today look like if NeXTSTEP had had 20 years of improvements?
Bill’s crap (Windoze) is just now catching up to where this was 20 years ago!
The NeXT Computer was based on the new 25 MHz Motorola 68030 central processing unit (CPU).
The Motorola 88000 RISC chip was originally considered, but was not available in sufficient quantities.
It included between 8 and 64 MB of random access memory (RAM), a 256 MB magneto-optical (MO) drive, a 40 MB (swap-only), 330 MB, or 660 MB hard drive, 10Base-2 Ethernet, NuBus and a
17-inch MegaPixel grayscale display measuring 1120 by 832 pixels.
In 1989, a typical PC included 640 KB to 4 MB of RAM, the 8086, 8088, 286 or 386 CPU,
a 640×350 16-color or 720×348 monochrome display, a 10 to 20 megabyte hard drive and few networking capabilities.
To this day it remains a mystery how Bill Gates was able to brute force all of the Lemmings to believe the ‘hype’ that he was creating great OS software. Cleary, in this case, Elegance lost out to inconsistent poorly designed software.
Take a look at Object Oriented Programming and study data representation and data abstraction. These concepts are invaluable for real world problem solving.
To review, there is more than one way to code a solution. You can have an elegant solution that works and has many safe guards for catching errors and features that make the application easy to use for the intended user or a program (like many Microsoft Programs) that are prone to errors, makes the user click endlessly on superfluous non essential things and crashes frequently.
I am a person that develops using the RAD (Rapid Application Development) approach for most of my projects.
I did away with the traditional Systems Analysis approach taught in College (and I might add, that I, myself taught for 9 semesters many years ago) in favor of the quick and responsive. I used to make mock up screens, and charts and reports and other “aids” to demonstrate what the proposed new functionality was going to look like. Now, my ‘mock ups’ are functional.
If I have already created a working concept of a form that captures 6 pieces of information, it’s easy to go in and add the 7th piece that we find is necessary a month later. On the project I am working on now one database form started with 5 pieces of information, it now captures more than 20 and while it is evolving with other development going on it is a fully functional entity that is constantly being tested at the same time.
Only the largest of companies and products being developed have the money for the traditional approach.
In today’s fast paced “We need this two weeks ago” world, RAD gives people a visual, hands on, almost immediate feedback to the current project. Clients can then say “We like – we don’t like” right off from the get go. By the time the system is done they are already familiar with it and already “trained” because as part of the on going development process they are already “experts” in using it.
So, my long and drawn out point is that fast coding / learning is great for real world applications but it must be tempered with good coding practices help the “student” develop their own sense of coding style for creating well designed, sturdy programs.
And coding style is something a person develops over many years after millions of lines of code have been written.
The hardest thing in the development world is to modify someone else’s code; especially if the code was not designed eloquently.
Some times you can look at someone else’s code and it is like walking outside on a lovely Spring day. The code is brilliant, clear, easy to understand and modify; you say to yourself: this is exactly how I would have done it.
Then, there are times when you look at code and your brain starts to hemorrhage or melt. You’d rather be anywhere on the planet (including prison) than where you are sitting.
Be thankful that you don’t ever have to wade through the gobbledygook from Microsoft’s old BASICA with all of the completely horrid GOTO’s that most people used back then.
That being said, if you do eventually get into this business and you improve, you can’t be promoted into management or into team lead positions if you write obtuse code that no one but you can understand. You have to be able to train the people under you to take your spot.
All programs written in high level languages, no matter how grandiose, will ultimately revert to the smallest common denominator and that is the Assembler Language of the computer architecture of the machine you are running on.
I used to love to program in Assembler. The only language that has the same level of power to go skip, dancing naked in the computer forest is C with its inline Assembler capabilities.
To learn, you need something simple and visual basic, in my opinion will allow you to at least get a feel for what’s going on.
Write as many practice programs as you can. After you have coded a solution see if you can write the program in a different way; perhaps more efficiently or using a different approach.
Soon, you will get the hang of it and start to develop your own sense of style.
Practice, Practice, Practice!
AND HAVE FUN!
Right now, you need not concern yourself with trying to write Production Code or the Newest Sensational Game. What you need to focus on is problem solving.
Here is an EXCELLENT COURSE (which uses Python as the teaching language) that is offered by MIT. This series of lectures teaches you HOW TO SOLVE PROBLEMS and then match those solutions to code.
http://www.youtube.com/watch?v=bX3jvD7XFPs
Once you learn one language very well it becomes easier to migrate to other Computer Languages. After your 6th language, it become a matter of “how do I say “Salary equals HourlyRate times Time Worked” in this new language I am learning?
Sign in to your account