Or maybe even a “hacker”. :eek: I just started reading The Art of Unix Programming, and I’m inspired to crank out some code. Specifically, I’d like to get involved with open source one day, and learn to program my wife’s new Android phone in the shorter term. I’d also like to become a bash expert, if that counts as programming. In general, I’d like to be a lot more acquainted with what’s under the hood in Linux/Unix, and software in general.
I programmed microcontrollers in C and ran control system simulations on MATLAB in college, and I’m a experienced Ubuntu user. I am also pretty familiar with computer hardware, both in terms of hands-on repair and basic theory. So, how do I get from here to there? Any information, advice, resources, experience or stories you guys would like to share would be appreciated.
Dunno. I learned Unix in the 1980s. I know. The dark ages. There are so many commands that were so useful, but you had to do a lot of RTFM (reading the fucking manual) even to find out about them. Practically everyday someone would pop up and say, “Hey, did you know about…?” We also did a lot of explaining to other people what we were trying to do and seeing if they had any suggestions. Programming has probably changed a lot since then. I am a dinosaur.
I don’t want to say books aren’t useful or good, but I personally think that books shouldn’t be used to teach, but rather elaborate. The best way to go about it is to give yourself a problem to solve using, say, a bash shell script or the Android framework and solve that problem. Then come up with a problem that uses a different skill set. If you want to dive right in, then just do what you want to do and realize that your first attempt is going to be a mess (I’ve learned more about game programming one for a semester course project than I ever would have programming small chunks with no inherent relation, or reading a game programming book).
It’s a bit of a dirty approach, but with programming it’s just the best approach to solve problems. Syntax, language idiosyncrasies, and frameworks will come as a function of using your resources to solve the problem. Now, if you can’t even manage a print statement or a for loop then definitely look up a few basic tutorials. But you’ve done C, so it shouldn’t be a problem (other than the initial "what’s the syntax for this in <x> language you’ll inevitably do). Since you come from procedural-land, I’d say the best use of your book time would be to look up Object Oriented concepts and Java for Android, just to get a feel for classes and inheritance since that will probably be your biggest point of confusion (along with “But… but, I don’t need to allocate memory?” and “You mean it always passes by value?”).
Either way, I’d say jump in and give yourself a problem to solve, and remember that Google, the Dope, and in Android’s case, the API is your friend! I’d reserve the buying of expensive showy books to “Wow, I really don’t understand game physics too well and I need it for this Android game, Google isn’t cutting it” and extensions of more advanced concepts. In my experience, beginning programming books are rather useless and following skeleton examples doesn’t allow the information to really “stick,” even in the rare cases where they have phenomenal explanations. In addition, when given a problem you don’t care about, you learn less solving it. If you set your own goals you’ll learn better. The higher level books are more conceptual, and they really help further understanding of a concept you only understand a little about, which is a lot more useful since it’s usually more oriented towards “I never thought of it that way” than “now I know how it works.”
Edit: THAT SAID, it would definitely be in your best interest to learn language conventions/etiquette, design patterns, and concepts like “contracting” because they make things easier to write and maintain. The earlier you learn them, the less likely it is you’ll fall into bad habits. These fall more into the “conceptual” side of things though, it’s closer to adding a tool to your toolbox than reading a book on how to use a screwdriver properly.
Sure, there are lots of learn when it comes to software development. If you wish to read it up, I suggest you check out Java first, as Android programming is primarily Java and most books on Android programming assume you have the prerequisite knowledge. Then there are architectural issues, which you may want to check out Code Complete. Then maybe design patterns and etc.
However, I find out that I learnt a lot just by doing. Sad to say, I am not a great self-starter. I need something to be part of my work or school before I commit time to it. When I do, I find that I learn quickly.
So get a project that motivates you. A small one will do, and just work on it.
Along similar lines, check out the websites of good CS departments. I’m not even thinking of schools that participate in Open Courseware (which would be better than what I’m proposing), but just classes that post assignments online (almost all do, just make sure they also post solutions).
There are a couple problems, of course. One is that assignments usually supplement lectures, to which you’ll not have access. Also, the material may not have the focus you’d like; that is, it may be of a more theoretical bent, where the actual programming is meant to be picked up almost as a side-effect. Furthermore, things like bash programming are lucky if they get even a single mention in a single lecture.
If you do become a programmer, please don’t use “code” as a verb. I fucking hate that.
But Crowbar is right. Books and stuff are great, but the only way to learn is to write code. Don’t worry if you don’t know what you’re doing; come up with some (very simple, achievable) goals and start cranking stuff out. It won’t be terribly good or competent code at first, but that’s how you learn. Then start reading books and websites and API manuals to learn more, then repeat the process until you’re at the point where you can make something useful.
If you can write C code, you’re already a good few steps on the way. On UNIX systems especially, C is still the core of most systems (including most higher-level languages).
Really, the best way to advance as a programmer is to write more programs. It shouldn’t be too hard to write UNIX command line programs in C. Most of the time though, languages like Perl / Ruby / Python make it a lot easier to accomplish the common tasks, so I’d recommend getting some familiarity with one or more of those too. Bash scripting is even simpler, especially if you’re just hooking a bunch of programs together, but it isn’t really suited for complex problems. Still, bash + grep + awk etc are useful to know.
Depending on your knowledge of C, you might also find “Advanced Programming in the UNIX environment” interesting - it doesn’t really tell you much about how to write programs, but it explains a LOT of what’s going on under the hood of the system; how programs and the kernel talk to each other, how the file system API is designed, stuff like that. I found it fascinating and useful, and I only rarely write C code.
ETA: if you like Emacs, check out its info pages on elisp - it may be a bit of an archaic Lisp these days, but I usually find hacking in it pleasant and it’s definitely rewarding to be able to rewrite and extend your own programming/editing system.
DrCube, I suggest you sit down at the computer and start programming. You have plenty of background. You can find sample programs for just about anything, so if you want to program a Droid, get the development kit, implement the example code, and start modifying. If you are a programmer at heart, you’ll soon need to find excuses for not getting your day job done.
Okay, so there aren’t there a million different ways I can go with this? What tools should I use? What type of problems should I solve? Point me in the right direction, please; or else just tell what directions there are.
I want to do something useful and nontrivial. Part of my problem is that almost any problem that I have on a computer can be solved with a few minutes worth of googling. I don’t want to implement some lesson plan, I want to write a program. Something useful I can use at least occasionally and maybe improve and build onto later. Can anybody think of any program that fits these criteria? If nothing seems to fit, tell me what was your first “real” program? At least I’d be more interested in lessons and tutorials if I had a bigger goal in the back of my mind.
Again, I guess I just need some direction. I know I need to get the ball rolling, I’m just unsure where to start.
if you want to do open source, then find a project that is interesting, and contact the leaders and offer to help chase down some bugs or whatever they think is appropriate for your skill level. Then do it, and do more after…that’s all it takes.
Ok, want to know what my first real program as a professional programmer was?
You have an arbitrary polygon on the plane given as a set of (x,y) coordinates. Find all the diagonals of this polygon and classify each of them as to whether they are internal or external diagonals. (The polygon obviously can be convex or concave.)
Solve this using any computer language, and you’ll definitely know a lot about how to program in that language.
There are many platforms, but most of them follows the same concepts or logic when it comes to problem solving.
For example, my first web programming language was ASP. I found the same concepts used in PHP. Now I am back to using ASP.NET, which is a different methodology all together, but concepts from general web-programming applies and helps to clarify understanding.
Generally, first determine your platform. Android, IOS, PC, server-side web or client-side web?
For IOS, it’s Objective-C, C or C++
For PC, you have lots of choices, but in general you can choose C#, C++, Java
If you wish to do web, there’s PHP, JSP, Ruby, Python, ASP.NET
(Of course, there are as many, many more options. I guess I’ve just listed the ones which are mainstream and floating in my consciousness)
Second, determine what ‘level’ you want to work at. Do you want to work at the ‘low’ level, playing with memory buffers, writing SQL, read directly from fies and stuff bytes into TCP/IP streams? Or do you prefer a higher, abstracted ‘level’ where you deal only with black-boxes and put different black-boxes together to form a system?
Do you want to build an application from black-boxes, or do you want to build the black-boxes and put them together yourself?
Even though the logic and concept are the same when it comes to problem solving, each language/platform has a philosophy and preferred method of solving things, and works at different level.
For example, PHP feels more like raw C programming. You have to work hard to impose structure on it, but you can whip up something simple quickly. Maintaining it become a nightmare. (You can use PHP frameworks to impose some structure). PHP also tends to be more low-level; as you are working directly with SQL statements and request data.
Meanwhile if you use the MVC framework provided by ASP.NET, you will need to do lots of OOP and there’s a lot of deliberate decisions made as you code. You won’t get to touch the low-level database stuff. They are all abstracted away. ASP.NET itself also hides many low-level details into wrapper and classes.
C++ allows you to play with memory; C# in .NET has lots of automation and manages the memory. I don’t know what Java is good for (sorry, just joking!) Ruby tries to keep everything as concise as possible. Python insists on strict formatting of code. Those are just some of the ways those languages try to impose their own philosophy on the programmer.
So go forth, and [del]code[/del] program something!
Learn Object Oriented Programming. If you learned C, you got a good foundation in procedural programming. OOP, which is used by C++, C#, Java, and other modern languages, is used heavily nowadays and helps with division of responsibility.
Do not use Visual Basic.
See if you can take a course or two.
Do not use Visual Basic.
Take your time - try something small at first. Don’t jump into a major project that you have little hope of finishing - it will discourage you and make it more difficult to accomplish something significant.