It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 9 years ago.
I recently came across John Levine's book "Linkers and Loaders." This book was written in the year 2000. If anyone has read his book, is everything the author says still relevant for Objective-C in the year 2013? I am asking, because it looks like a good book to have on my shelf, but if the info is out of date I probably don't want to really study the book.
Thanks!
Yes & no...
I don't know that specific book, but if it was up-to-date in 2000 then the material in it should still be valid to learn about how things work under the hood.
However, you do not really need to know anything about linking and loading to understand variables and pointers.
Nor do you need to understand symbol tables as such. A symbol table is a data structure used by compilers to track variables during compilation as part of translating the program code your write into the instructions the CPU understands.
The concepts of variables and pointers in programming languages are abstractions of the concepts of memory locations and memory addresses at the CPU level (which themselves are in some sense abstractions of lower-level stuff, ending up with circuits and, if you dig deep enough, electrons! ;-))
What you should be looking for is a book on programming language concepts rather then compiling, linking and loading. A good book will introduce variables and types, then composites such as arrays and records, and end up with objects (which are essentially just variables you'll discover). Types and variables go together, one says how to interpret a collection of bits the other provides somewhere to keep collections of bits. A pointer is a value (collection of bits) of some pointer type, just as an integer is a value of some integer type.
Variables and pointers are not difficult concepts, but they are often misunderstood - plenty of questions on SO stem from misunderstandings of these concepts - so your quest is good, go and read! Apologies, but I've no reference to hand.
Given that ObjC has been in active use as a natively compiled language since the late '80s (prior, it was largely a precompiler generated language + runtime) and has supported linking/loading since then, too, it'll be as applicable as the book can be to any language derived from C. With that said, it is likely largely a waste of your time to dive too deep in that linking/loading are details that are taken care of by the system with little [OS X, OpenStep] to no [iOS] configurability to the developer.
Certainly, an interesting divergence, though, and a deep understanding of linking/loading is relevant to any work related to compilation and execution tool chains.
Related
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
I want to design an easily extensible item system for my game where I don't need to modify existing code much. I want to add items with new effects on the fly.
Traits my items have in common:
A name,
a description,
an npc sell price,
if it can be equipped,
required level,
if it is usable in battle,
if it is usable outside of battle,
a cooldown
So I can encapsulate this already into a class. But now there are item effects.
Example:
heals x health points,
heals x mana points,
removes debuff x,
adds buff x,
gives x stat points on equipping,
has x% chance to create some other effect when equipped,
etc.
And those can be combined like: heals x health and mana points. The first four are examples for effects a usable item can have while the last two are examples for effects equipable items can have.
The idea behind it is that I have this structure in a database as well and I can add a new item with a new effect combination in my database, my code reads this then and builds it together into a new fancy item, without me having to modify much. The only time I need to modify my code is when I add new effects obviously.
How would you put this together in design pattern(s)?
I thought of decorator. Is there a different, better design pattern for this or maybe even a combination of multiple design patterns?
It seems a decorator pattern is good for your needs. Think of a pizza with different tops. You can warp the basic pizza with many tops and at the end you call a function to sum the prize or whatever. It's a kind of wrapper and you pass the object to the next class. Hence you need only a basic class and can add new (top)-class when you need it.
You can use Decorator Pattern to decorate your objects with additional functionality without modifying them.
This isn't a direct answer to your question, though I believe it needs more words than can fit into a comment:
Picking a design pattern for a chunk of code is not something which you would typically do up-front (If you do it this way, be prepared to change it after you've seen it working); it's something which you're more likely to do after you already have some working code in-place and are looking to refactor it. - Chances are that whatever decisions you make now will be affected by many (currently) unknown factors once you've started writing code.
I'd suggest thinking more about the features, behaviour and functionality which you'd like to create, and then just begin writing code to see what works and further develop your ideas. Trying to solve a problem by designing it up-front around buzzwords like "factory", "decorator", "visitor" etc most likely won't lead you to a solution - design is very much an iterative process of continual improvement, change and refinement.
As an aside, and specifically on OO design, have a careful think about the SOLID principles while you're writing code; they should help you make decisions when you come to refactoring
http://www.blackwasp.co.uk/SOLIDPrinciples.aspx
http://butunclebob.com/ArticleS.UncleBob.PrinciplesOfOod
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
I have studied VB 6.0 but have hardly any knowledge of .NET. Can someone please tell me the difference between the three versions namely VB6.0, VB 2010 express and VB.NET?
Now this is a somewhat wide question, but in short, VB.NET is the language and VB 2010 is a VB.NET version released with Visual Studio 2010 and .NET 4.
So the main comparison should really be between VB6 and VB.NET because that's where you'll find the big differences.
VB.NET includes a lot of functionality that has been around in other languages like C++ for ages, and is by some considered way to different from VB6 even to be called VB anymore. But let's set aside the arguing for a moment, what are those new shining thingies? Well, among other you have this:
True object oriented inheritance
Overloading
Free Threading
Strict type checking
and alot more. Then there are some changes that might be a bit harder to adjust to since they're to close to the old one, like zero-based arrays, returning values from functions using a
return statement instead of using the function name, passing of parameters by value instead of by reference, new error handling (using try, catch, finally etc), usage of namespaces etc. The list goes on and on.
The shear breadth of the .NET Framework which VB.NET makes use of makes it a more versatile platform (IMO). It also runs in the CLR (Common Language Runtime) which is more or less a virtual machine with a just-in-time compilation engine.
When it comes to compiling, VB6 compiled to native code while VB.NET compiles to CIL (Common Intermediate Language) which makes it a lot easier to reverse engineer, however you can obfuscate the code in order to make it less readable.
As you can see from what I just wrote it's quite a wide subject, but if you have a more precise question, feel free to ask, otherwise I hope you have a bit clearer image of the differences now. :)
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
I always think that life in general is really very complex and we don't even know all about it. But it works, right? that lead me to think if it was possible to think of a program as thinking of a group of differentiated cells. or maybe totipotent (the ones that can differentiate in any other cell) cells that differentiated.
I don't know if this is the right place to ask because involves biology and reprogramming.
thanks for interest
If your question is as stated in the title the you ought to look into Artificial Life and Digital Life. The prime example of Digital Life is Avida, where you have a bunch of computer programs thought of as organisms who compete for computer resources (such as CPU time and memory). Another example is the research by Schlessinger et. al. (paper here). They created digital single-celled organisms that could aggregate into a multi-cellular organism. Furthermore, the cells in their research are differentiated in that not all of them can perform all actions.
Moreover, there is a fair amount of research on computer simulations of morphogenesis, embryogenesis, cell differentiation, cell division etc.
The established field of Genetic Algorithms might be worth exploring:
http://www.catonmat.net/blog/genetic-algorithms-101/
http://delicious.com/tag/geneticalgorithm
Your question is very vague. But you should consider to look in the field of Systems Biology. If you are interested I provide you an article by H. Kitano Systems biology: A brief overview
During my internship I have been simulating/modeling a very simple cell of a microorganisms to study its behavior. But from my understanding to simulate a cell of human body is extremely difficult to do not to speak of modeling an eukarotic cell...
Programs basically already work this way.
The linux fork() command - duplicate the current process, and starts running it from the the same point in both processes. The program "knows" if this program is the original or the forked one, and invokes a code with respect to it [if the programmer designed it to do it, of course]
Also note, that like cells - all linux processes have the same origin - there is one process which is responsible for creating all others.
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 11 years ago.
Why do IDEs structure code as "Projects" or "Solutions"? And no, I'm not trying to troll, I really want to know what people use them for.
It always seems to me like "Project" is just a redundant alias for "executable", and I find the "Project" structure tends to get in my way when I want to share code across several executable processes. This is especially true in languages like Java, where there's already a rigorous packaging system for organizing code with, but it applies to pretty much every IDE I've seen. So why do they always adopt this structure? Is there some trick to using it?
It always seems to me like "Project" is just a redundant alias for "executable",
I actually tend to think of "project" more as a "compilation unit" or a "deployment item" - at least for most compiled languages. Projects typically map to a single executable or library (or other compilation unit in languages where that's supported).
As such, a "project" is a very valuable method of organization.
Not all IDEs use these names, but in general, they are a way to organize code.
This is needed in any code base of a certain size - some sort of hierarchy that helps and logically separate code components from each other.
A solution can contain multiple projects. This concept is very much useful when you have a tiered software achitecture.
e.g. A solution can have following projects:
Data Access Layer Project
Business Layer Project
Presentation Layer Project
Every Project (tier) has a specific purpose in the same website.
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 12 years ago.
I would like to start building apps starting off with a small one. Is this even possible or d I have to learn code from going to school or get training?
Programming an iPhone App has nothing to do with rocket science at all, but there are some drawbacks to it:
You will have to use Objective-C as a programming language, which has quite a steep learning curve.
Albeit a lot of books being around on the topic of iPhone/iOS programming, I still have to see one written particularly for people new to programming in general. Same goes for the tutorials. Once you've written your first classic "Hello, world" programme, things will start to become difficult.
XCode (the development environment most people use) has a lot of stuff going on, which might seem to be a bit obscure at first sight (things like plist and their usage, the whole Interface Builder thing etc. come to mind).
As ChristopheD mentioned: Objective-C isn't one of the most forgiving programming languages at all (pure C isn't either, so why should its superset be?) and I can entirely second cdhowies advice to learn a more beginner friendly programming language (Java, for instance) first.
Whatever your decision will be: welcome to a really fascinating world!
It's absolutely possible, as others have noted, It will indeed take a lot of determination and effort.
Programming is a learnable skill like most others, but like any skill that pays well, it's not something you pick up over a weekend, or a week, or month. To create your first iPhone app of any real complexity if you've not programmed before -- and even simple apps are usually much more complex behind the scenes than they seem -- it's going to take months at least.
I encourage you to go for it, though, if you're willing to put in the effort. Start by learning to program in general; if you start with Objective-C and Cocoa Touch and the Xcode IDE (integrated development environment), it's likely to be overwhelming. Head First Programming is quite good, my girlfriend learned the basics of programming with it in just a few months of spare time, and it was clear from her questions that she really was learning the essential concepts. You'll be learning Python, which isn't like C or Objective-C in syntax or structure, but 95%+ of what you learn will transfer.
Next I suggest plowing into Objective-C. There are several good books out there; the one that I particularly liked escapes my mind at the moment, but some Amazon reviews will be able to guide you to a good choice. While learning the language there will likely be a few concepts you're missing that will require further investigation on your part, some object-oriented programming basics for instance, but you can likely fill the gap with some online resources.
After that go for iPhone programming with a book like Head First iPhone Programming (I have nothing o do with either book, btw); I've seen two people learn from it quite successfully. With most of that book under your belt you'll be able to write a variety of basic apps.
Importantly, with the experience of three books along those lines you'll be at a point where you'll be able to ask questions here at Stack Overflow in a clear enough manner that you'll get useful answers. If you start asking iPhone programming questions right away, odds are you won't be asking something that can really be answered, and even if so, the answers won't necessarily make sense to you.
Like I said at the start, it will likely be months before you're able to build something you're satisfied with, and it could be many months if you can only do it in your spare time, but it's definitely doable.
Lastly, understand that a crash course like this won't make you a good programmer, and won't give you the skills to write complex apps: only experience can do that. Keep programming, read online tutorials and blogs, and answer questions here on SO that you're qualified for (something that teaches you a lot, btw). Within a few years you may well qualify as good, and be on your way to great.
Yes it is possible, and you do not have to go to school.
Programming is not for genius people.
http://developer.apple.com/devcenter/ios/index.action
Go for it.