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.
Why do we need to organize code? What are the objectives of organizing code. Organizing code is a time consuming process until it becomes habit. I am trying estimate the cost and benefits of organizing any programming code
Imagine you are at the library; none of the books at the library are organized. If your work depends on finding references in books, you will waste a lot of time searching for the books. This may be a quick process if you have only a few hundred books, but when you have thousands or tens of thousands of books, you will need to ensure the books stay organized in order to efficiently locate them. You could also say "Organizing books is a time consuming process", but the end result is that it saves you time when/if they are kept organized.
The same thing happens as software becomes more complex. People won't want to add programs which are not well organized to well organized programs/codebases. It's hard to use/maintain programs which are complex and organized poorly (or not at all).
One of the biggest problems if you are faced with organizing a codebase is that it's very monotonous and time consuming -- it's easy to (unknowingly) introduce changes which result in bugs; these changes should receive significant testing (but it's not likely that a disorganized codebase has high test coverage). Disorganized programs which are reused and/or have long lifetimes usually require significantly more maintenance time over the life of the program.
If you're just banging out a proof of concept that is 100 lines and will remain independent of all other programs, you don't have to obsess over the organization of that program.
Organized code becomes much easier to maintain and extend over time than code that is placed wildly about. That's why programmers take so much care to name variables/methods/etc. well, keep methods short and specific, and so on. I would recommend reading Clean Code by Robert Martin.
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 9 years ago.
When talking about execution time between high- and low-level programming languages I often hear that low-level languages performs a bit better than high-level.
Of course a low level can perform worse than a high-level depending on the programmer and algorithms. But if we use the very minimal code needed to do different tasks. Will there most often be differences in execution time due to the abstraction level of different languages?
And also, does anyone know any good books about these kind of topic?
First off, low-level vs. high-level is not a well-defined language attribute. It tends to be used to refer to the accessibility of primitive machine capabilites, to the abstraction facilities the language provides, and again to describe the specific abstraction level of available libraries. And while these aspects are arguably correlated, they are not dependably so -- none of them is required for another.
Lack of access to machine primitives naturally removes flexibility for general-purpose performance programming, but languages without such access can achieve high performance for particular domains by using libraries and/or runtimes that are specialized for that domain (e.g., NumPy and Matlab performance with linear algebra).
Poor abstraction facilities make design, development, use, reuse, and maintenance harder. This doesn't necessarily impact potential performance directly -- but practically speaking, efforts put into mechanics aren't being used to improve performance. Likewise, lack of high-level libraries doesn't necessarily impact performance directly, but poorly-built re-implementations of essential facilities can have the same effect.
So, to answer your question: in no aspect does language "level" generally determine performance. But, there is always a "but"...
Additionally, there are costs to "wide-spectrum" languages such as C++, which combine access to primitive capabilities with good abstraction facilities and extensive libraries: complexity and cognitive load, which (IMHO) are the drivers of the aforementioned correlation between the different aspects of language "level".
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.
How does reading the book Introduction to algorithms(CLRS) help me? How's learning this course connected with the other areas of theoretical computer science?(I mean intutions and insights if any that I could get).
I'm new to this concepts.I am getting bored of the sorting algorithms that I was learning in the course right now.I wanted to have a broader view while learning the course.It would be very helpful to me, if you could provide me with a structure on how things go.Thanks in advance! :)
Algorithms are the practical application of theoretical knowledge in computer science; they're the most theoretical part of the engineering side of computer science, so to speak. Without the study of algorithms, anyone in software would either be an amateur - because computation is useless without efficiency - or wouldn't produce much of anything since he would have to focus on solving problems all the time instead of actually writing implementations that are known to solve problems.
From a didactic point of view, algorithms are a distillation of theoretical knowledge into a precise expression. You may understand what graph traversal is and how strongly connected components should be contracted; if you try to give a succinct form to those thoughts, the best way to do it is writing down an algorithm that does what you want.
On a formal level, they help us understand the concepts we grapple with; when we claim some problem can be solved in this or that complexity, we need an algorithm to prove it. For example, if you read that sorting is in O(n log n) in the general case, you can just go ahead and believe your professor; maybe you even have an intuition why that might be true. But to actually prove it, you need an algorithm that solves sorting for which you then prove that it runs in O(n log n) in the general case. So on the theoretical level, algorithms help us classify problems according to their complexity (read: "difficulty").
I'm not really sure that this question has a specific answer and that this is the right place to ask it, but it is still a useful one. Aside from trusting the people that have spent much of their lives guiding people to learn a skill set they will use for the rest of their lives (your professors), I have always looked at algorithm design as a way to learn how to think more clearly. This is something I believe everyone can learn from.
Also, when I was a student there were many times I was frustrated with what I was being asked to learn (believing that it is a waste). Virtually all of which I have found to be very useful and use frequently. Thinking back, I wish I had given some of my professors much more credit then I did when I was in school.
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'm interested in designing a scheme flavor for doing audio synthesis, but I'm quite concerned with doing proper garbage collection when catering to the low latencies required for audio. I was wondering if someone in the field might be able to point me towards a garbage collection algorithm that might be suitable for this sort of environment. I was looking at realtime garbage collection, which would seem to make sense, as I'd like to bound the amount of time that the garbage collector takes so I don't get pauses in the audio... though perhaps a collector that's just "fast enough" and distributes its work well would be good enough? I'm not at all worried about multithreading/multiprocessing, and I'm definitely not worried about wasting tons of space in search of these goals. I'm after predictable, simple, and fast.
Thanks!
In a single-process setting on Unix-like OSes, I heard of an amusing approach. (It was experimentally implemented for Nickle, but I don't know if it got merged to master.)
It uses a simple mark-sweep collector, but here's the trick: When you want to run a mark phase, fork(). The child process runs the marker, and sends a list of objects to free over a pipe back to the parent, which can incrementally free them at leisure.
This works because the child is operating in a copy-on-write snapshot of the parent's memory state, maintained with reasonable efficiency by the operating system's memory manager with help from a hardware MMU. Once an object becomes unreachable, it won't become referenced again, so marking from an old snapshot always gives a conservative estimate of objects that can be freed.
edit: Best reference I can find for this work is the Summer of Code proposal for it: http://web.cecs.pdx.edu/~juenglin/revamping.html
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.
Is it performance, scalabilty, maintainability, usability or what ? What is it that you always strive to achieve while creating a good software or application and why ?
I always prefer maintainability above anything. It's ok if its not otimized or has great user interface - it has to be maintainable. I'm sure each one of us would have something very important to say here. Whole idea is to gather as many as perspectives for improvement in software development.
There's a false premise here: that you want to optimize only one single aspect.
You need to strike a balance, even if that means none of the aspects is perfectly optimised.
For example, your suggestion of striving for maintainability is futile if the usability suffers so much that no-one wants to use your product.
(It could even be interpreted as a little bit selfish, putting your priorities for an easier life over those of the customer.)
Similarly, when I see people striving to get the fastest possible performance out of a component, when there is little customer-need for that... frustrating when they are impacting maintainability, or missing the opportunity to improve security.
It has to do what the customer wants it to do
It doesn't matter how fast, how efficient, how maintainable or how testable a piece of software is if it doesn't do what the customer wants then it's no use to them
A good usability for the end user and some elegance in the code for the fellow developers that might have to work on the same project.
Readability.
If code is readable it's easier to understand! Things like performance optimizations can come later if required after profiling your code.
I think all the other 'goals' you mention can be built on providing you have a readable -and therefore understandable - codebase
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.
As I get more and more into my job I've had a lot of opportunity to code new projects from scratch. Almost every programmer I know really appreciates that opportunity.
But the further I go into it, the more I enjoy bug fixing. In fact, if I can spend a whole day looking over code, whether it be mine or someone else's code, and find some obscure bug, I feel much more accomplished than when I create code. Does anyone else feel this way, and are there any job advantages to this?
Maybe you should be a tester?
I can certainly relate. I think with me it is because I am never quite satisfied with my own code or design choices. Also because I started out in QA I never ever trust any code to work, certainly not mine.
I think TDD works very well with me when designing software, because once a test method has been created it shows that there is a "bug" and I'll need to fix it.
At my last job, we had a candidate apply for a position that was exactly the same way. We hired her and she worked out famously doing exactly that. I think an effective development team needs to have a nice mix of people who prefer doing different things: Back Office dev, UI, Database, Bug Fixing, etc...
You're a sick individual. Seek help immediately. :-) Seriously, you might want to look at a job in QA/maintenance, though, I don't know if that would be consider advantageous to your career.
That's interesting. I am the opposite way -- love to design and make things from scratch, working with other people.
I think it's great that some people like some things, and others like other things. The trick for a company is to hire people for the jobs that they really enjoy doing. So the job advantages to you is that other people don't enjoy those kinds of tasks as much as you do. You have less competition.
It's said that a plenty of developers spend around 50% of their time debugging instead of coding new stuff, that's why debugging skills are actually so important and you should code thinking that eventually you'll have to debug your own code, it's nice to see you enjoy it... but that's something I personally don't share with you =)
Personally the longest and more frustrating hours I have spent in front of a computer have been debugging, it MAY be fun when you're are working with your own code or somebody's else code that has been nicely created (well documented, properly formatted, etc.). Just as Bryan mentioned, in a certain way, you have a tester's spirit =)