As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 13 years ago.
Duplicate:
Learning implementing design patterns for newbies
I have been a developer for years and have my way of developing and have always kept up with the latest techologies. I want to start using a design pattern in the hope it will improve my development speed but I need to find one to apply and I need to find a full open source sample that demonstrates it.
I use and have an application that uses LINQ to SQL and .net 3.5 I tried to apply the repository pattern but found the structure complex and having to hack my way through it.
Any advice for someone who wants to better their programming style?
Read blogs (RSS Feeds are prime). Read magazines. Read random MSDN entries. Write little trial applications. The only way to keep up is to discover it and practice it.
Patterns aren't really "tech" in the traditional sense. Using patterns means applying your specific knowledge of a domain to a problem keeping in mind the patterns which apply to that domain. They are useful to exactly the extent that you have a base of experience to put them in context.
The repository pattern, for example, is maybe not the best starting place for constructing a database architecture based on a pattern. Have you got a simpler pattern implemented such as Table Module or (in the specific case of data access) Active Record? If not then perhaps you should start there. These patterns focus on a fairly limited, basic way of organizing data and operations. Repository is more like a meta-pattern that then builds on top of these patterns, organizing a complex domain-data boundary into a simpler collection-like interface.
Two books that I would suggest reading are:
Refactoring: Improving the Design of Existing Code (ISBN: 0-201-48567-2)
and
Refactoring To Patterns (ISBN: 0-321-21335-1)
Both are great books that will help you, at a high level, understand the when's and why's to applying patterns to your code. In addition, they are great reference material for some of the most commonly used patterns out there.
To be clear, these books are by no means the "complete library" of design patterns.
My simple advice for bettering your programming style:
Pick a technology that you find productive and "fun" and keep with it to learn how to fully explore it's potential.
Don't try to learn all the new technologies all the time - just keep yourself oriented.
Seek advice and solutions where and when you actually need them - don't waste time learning solutions to problems you don't (yet) have.
Regarding design patterns... Well... I'll probably get shot for this, but I don't really like the idea of cramming them all into my head "just in case". They are really a cooking book of "good solutions" for common problems. My advice here is: Whenever you run into problems that you can't come up with an obvious/immediate solution for - use them as reference.
Learn from your mistakes (you'll make them).
Don't marry your code. Throw away and rewrite is an excellent way of bettering the style.
I would sincerely recommend dofactory.com
which also offers code examples in vb.net + c# for all the design patterns
Related
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 9 years ago.
Before you condemn this as subjective, consider that there are differences between different frameworks. Writing something with PHP, I assume, is probably a lot less verbose and thus time consuming and expensive than writing it in binary. While the differences may not be as pronounced between the title options, I think there probably are significant differences which can result in, for example, a DoodleJump-type app taking more or less time to code in each.
Although there are other factors involved in choosing a framework, I'm just asking which one requires the least amount of coding and thus time and expense for equally skilled developers to accomplish the same thing (conjuring DoodleJump physics, a basic TicTacToe game, creating a UI, whatever). I'd appreciate links to sources if you have them, as well as direct experience comparing the verbosity of one or more in accomplishing the same task.
I'd most like to get an idea of how Flash and HTML5 compare to Corona (in terms of development time), but I'm also curious about the others.
Well you should seriously rephrase the question. It looks like subjective.
I'll just give my experience with all these tools.
Disclaimer:- The following review is my own personal opinion and involves my personal experience. You might have different opinion.
Marmalade
While I've used marmalade for most of my deployed projects, I've never used their RAD tool quick for any serious development. I was asked to try it out by remaking one of our deployed game. I was really impressed with it's quickness and less-verbosity. Although it was only for 2D and I recommended it's use over normal marmalade for all our 2D games. Unfortunately, we never made any 2D games after that. The benefit was that it comes preloaded with box2D and Cocos-2Dx and still supports C++ libraries. Didn't try EDK with it yet, but it should support that too. The con (for me) was I had to learn luascript for that.
Flash
Well I am not a flash expert here, but I tried it on two of our deployed game and it was a good one. Although it was too limited in what it seemed to have. We had to Re-code one of these games in marmlade, just to support some 3D elements, which were not possible to do in flash(at least for me). Flash was too verbose and too confusing for me, since we don't know where the actual script is attached. I guess it must have happened with all programmers who tried flash after trying any other tool, like marmalade. It just confuse you.
Unity
Well it was much much better than Flash, and is actually a well written game engine. Although it might cost a fortune for Indie developers, but still it's worth it. I've been using it for almost 4-5 months and I already started liking it over any other engine. It's easy to learn and too less verbose. You just need to drag and drop and attach the script to the gameobjects.(Not really that simple actually). No need to worry about Physics engine, no worries about plugins(since most of the plugins are already avaialable). And you can do 3D in that too.
Never tried Corona and HTML5 for any development project, so can't have a say in that.
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I've recently become very interested in learning how to implement various audio filters in AS3. By intuitive guessing (and inspired by capacitors), I've managed to create what seems to be a 1st order high-pass filter, but I have no idea how to set its frequency (or Q) in a controlled way.
So I'd like to learn how to write parametric 2nd/4th order low-pass, hi-pass, bandpass filters from scratch. And I'm not very mathsy. Any practical, straightforward tutorials or textbooks out there which could help with this?
Partial credit for readable source code (in as3/c,etc), in lieu of a tutorial... (!)
Edit:
Found a great site, www.musicdsp.org, with heaps of awesome code snippets, mostly in c/c++.
The link you really want from MusicDSP is http://www.musicdsp.org/files/Audio-EQ-Cookbook.txt
I also recommend getting Lyon's Understanding Digital Signal Processing. I am a bit biased, though, since I was a reviewer for the second edition (but I think a third edition came out recently).
Also check out Digital Audio Signal Processing and DAFX:Digital Audio Effects, both by Udo Zölzer.
This is a great book to start with, especially considering that the entire text is online for free:
Introduction To Digital Filters With Audio Applications
Here are a couple links from the book that will probably help the most with understanding/applying the Audio EQ Cookbook that MPD posted: The BiQuad Section,
Biquad Software Implementations
In addition to the great books and resources that others have mentioned, I also recommend some experimentation.
DSP is really a form of applied math. But if you are not the "mathsy" type, one thing you can do is write lots of unit tests for your filters. Feed your filters impulses, step functions, long sine waves at various frequencies, frequency sweeps, etc., and see what comes out the other end, what the filter actually does to these different types of signals. You can experimentally test formulas that might seem fairly opaque (at first) to you.
I've just started reading MIT's The Audio Programming Book. I can't vouch for it yet, but it may be of interest.
There is no substitute for good text books on the subject of DSP. A classic is Hal Chamberlin's "Musical Applications of Microprocessors". See my answer to Where can I find low level Sound Programming Theory Tutorials for links to this and a couple of other useful books which are oriented more towards practical applications of DSP rather than the usual undergraduate DSP books which lean more towards theory.
Also, an excellent course of university lectures here, which take you from the basics of dsp. https://ccrma.stanford.edu/~jos/filters/
Another really great book that also is available online for free is the DSP Guide. It goes all the way from sampling theory to designing filters with arbitrary frequency response (and tons of other stuff). It's also written in a very clear way with good examples including example code to understand the concepts.
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 9 years ago.
Currently I have started on very large Legacy Project and am in a situation which I always feared Reading and Understanding Other People's code, I have known that this is an essential skill which is required but haven't developed it as till date it was not required and now its like necessity to develop this skill rather than hobby and so I would like to know from SO Readers about:
How you have overcome the hurdle of reading other people's code ?
What techniques or skill have you developed to polish your art of reading and understanding other people code ?
Are there any books or articles which you have referred to or in general how did you developed the skill of reading and understanding other people's code ?
I would highly appreciate useful answers to this questions as now I can understand how one would feel while trying to understand my code.
Practice. Practice. Practice.
I overcame the hurdle by interacting with people on open-source projects. Discussing my contributions with others, and seeing their suggestions and ways of looking at things really opened my eyes.
I suggest you find a project that fits you, check out the source and contribute what you can (no matter how small to begin with). Over time the skill of reading code should just come naturally. Some projects even offer mentors specifically for helping out new contributors.
Michael Feathers' Working Effectively with Legacy Code is a great resource that contains a large number of techniques for working with older code.
Practice, Practice, Practice.
If you can, talk to whoever wrote the code or has an idea about it. Draw lots of pictures and have them explain big things to you while YOU write comments.
The quickest way to find your way around is to get lost. Dive into the code and break stuff. See if you can change an int into to a string or something.
Patience: Understand that reading code is more difficult than writing new code. Then you need to respect the code, even if it is not very readable, for it does its job and in many cases pretty efficiently. You need to give the code time and effort to understand it.
Understand the Architecture: It is best if there is any documentation on this. Try talking to people who know more about it if they are available.
Test it: You need to spend some time testing and debugging the code so you know what it does.
For those parts you understand, write some unit tests if possible so you can use them later.
Be Unassuming: Many times the names of the patterns are misused. The classes have names which do not indicate their purpose. So don't assume anything about them.
Learn Refactoring: The best book I found on this topic is Refactoring: Improving the Design of Existing Code - By Martin Fowler. Working Effectively with Legacy Code is another awesome one.
I don't know of any way to do it, i have participated in several proyects, where i have to undertand by my own, how do they think in and achieve that solution, so i can undertand it too.
That's why every time i can, i recommend, if you are a developer, try comment the code, all you can, because, you don't know if someone will find it useful (i think i make my point)
If you're not a developer, you should find someone to support you.
How do you learn to read what other people have written? You get really good at writing yourself and try to make sure the person is as good a writer as possible (suggest things they could do better, like adding some darn comments) Sadly, code is almost always read by someone else other than the author. Practice, and familiarity with some of the person's other code can help. But whenever you spend over 5 minutes figuring out what a particular line means, note how they could have done it better, and make sure you never make the same mistake.
good luck. :D
When I'm approaching an unfamiliar code base, I like to start at the beginning. Find main(), and write out a summary of what main() does. Create a list of the functions/methods called in main(). If you're visual, create a flowchart of main().
Once you have a list of the methods called directly from main(), look up those methods and repeat the process. As you figure out what each of those methods is doing, write it up in JavaDoc format and paste it into its corresponding box in the flowchart. If it's an API call, document which API it is using and put a link to the relevant API documentation.
Working recursively, you will create a map of the application and figure out what the program actually does. Once you know what it actually does, you will be able to find inconsistencies between what it does and what it's supposed to do.
The answer varies depending on the tools and documentation available.
If any documentation is available, I try to understand the high level overview of the system - the different modules, interfaces and subsystem interaction. This helps to divide and conquer the code into sizable pieces as you go along reading the code. If any design patterns are commonly used across the code try to build up your knowledge on that.
Also depending on the tools available I may use any of the popular source code browsers (Source Navigator/Source Insight) to quickly view the dependencies (class hierarchy etc). This speeds up code understanding. Also if I have some handy unit testing framework try playing with the code- different inputs and expected output. I also recommend using debugger to step through selected complex functions to get a hang of the code flow.
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 9 years ago.
which open source business intelligence solution would you recommend?
All I need is to build some cubes and let the end user play with dimensions, filter data, sort, etc, and once it's done being able to export it to excel...
I'd like the solution to be as simple and easy on resources as possible, and also I'd like it to be as much open source as possible, by the way. I've heard that many solutions available do have many restrictions when it comes to there community version.
I'd like to ear your advices and the pros/cons of each alternative, to help me choose the right tool, and if you could point me to some basic demo and tutorial to get started.
thanks a lot
ps: I'm using sql server databases, they aren't huge databases (in general less than a million records) and I doesn't necessarily have to work on "live" data...
ps: some useful links:
http://en.wikipedia.org/wiki/Business_intelligence_tools#Open_source_free_products
http://www.manageability.org/blog/stuff/open-source-java-business-intelligence
http://www.jaspersoft.com/jasperanalysis
http://community.pentaho.com/projects/bi_platform/
http://community.pentaho.com/faq/platform_licensing.php
http://www.eclipse.org/birt/phoenix/
http://www.spagoworld.org/xwiki/bin/view/SpagoWorld/
spago demo
http://spagobi.eng.it/SpagoBI/servlet/AdapterHTTP?PAGE=LoginPage&NEW_SESSION=TRUE
http://ostatic.com/blog/open-source-business-intelligence-software-on-the-rise
jpalo demo
http://www.jpalo.com/en/products/start_products.html
jpalo (user:viewer/viewer)
http://www.ten-sw.com:8080/Palo-Pivot/com.tensegrity.wpalo.WPalo/WPalo.html?locale=en_US&theme=blue
http://docs.google.com/viewer?a=v&q=cache:vhsqMQXwCUkJ:www.ow2.org/xwiki/bin/download/Activities/EuropeLocalChapterWebinars/ELCWebinarOSBI.pdf+open+source+business+intelligence&hl=en&pid=bl&srcid=ADGEESgpJJ2MqaKprJQOF2jX2UXCZQjg_asv8d7EVYtq0Vma-e-tR1tFxS-I0SOW0IhJC5acYc94rkDOrgP1WckCp_vk4qhKqR9y2Klp_u9cL8hlXoKoUpMkpAd5wabu61A4W0y15E5P&sig=AHIEtbRJ5FAI-3YK-qtayPjKkF_CwOgZag
As far as I remember from playing with Pentaho and BIRT, these tools are quite difficult to install and learn. But if you don't mind invest your time into learning cumbersome user interfaces you get quite powerful tools at the end of the day.
May I suppose you are interested in open-source BI because of budget rather than 'religion'? If so I'd consider a low-cost/trial SaaS alternative at least to deliver a quick prototype to your users at first.
In the meantime use your time to evaluate and learn an open-source tool of your choice.
Finally, in a couple of weeks, you get happy users who can play with dimensions, create reports and give you valuable feedback and a good knowledge of a BI tool of your choice so you can do a qualified decision about which way to go.
Disclaimer: I work as a consultant for www.gooddata.com - a company that offers that kind of SaaS BI software I'm proposing to use at least to deliver an early prototype to your users. Feel free to ask for any help if you try to do it in the way outlined above.
Unlike the others, I would suggest using Jasper. The quality is far more superb and user friendly than Pentaho. You have to hack many different opensource library configs. I feel like I am using Crystal when I use Jasper, but I don't get that impression when using Pentaho.
Have a look at Pentaho Community Edition Here I have used their ETL tool a bit and it works a charm.
Pentaho FTW. I'm really happy with it. Mondrian works great over mysql.
For reporting I'm using BIRT
SpagoBI is a global solution which contains all the tools, from Birt reports to Jasper reports, and geolocalization analysis ...
SpagoBI is free and easy to setup, have a look and make your own idea.
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
Has using an acknowledged anti-pattern ever been proven to actually work in a certain specific case? Did you ever solve a problem or gain any kind of benefit in one of your projects by using an anti-pattern?
My understanding of the "anti-pattern" concept is that it encompasses solutions that have drawbacks that only reveal themselves over the long term. Indeed, the primary danger associated with a lot of them---like writing spaghetti code with loads of global variables and gotos every which way, or tossing exceptions into the black hole of an empty catch block---is that they're seductive because they provide an expedient solution to an immediate problem.
EDIT to add: Because of that, sometimes you do derive benefit from these anti-patterns. Sometimes your calculation that you're writing throwaway code that no one will touch again is dead wrong and you wind up with maintenance programmers slandering your heritage and sexual hygiene, but other times you're right and that crummy shell script that's held together with baling wire and spit does the job you intended it to do and is then blessedly forgotten, saving you the considerable time and effort of putting together something decent.
Anti-Patterns are still so widely around just because they solve a particular problem (while creating 10 new ones). Also known as workaround. But how do they say? Nothing lasts longer than a makeshift.
In fact I believe we'd all be jobless if things had been done right from the beginning.
The biggest problem that it has solved in my experience is launching a new application.
When the dev team has scoped the new application thouroughly, the timeline to implement the correct solution is usually too much for management to bear. Therefore, oftentimes, you code to meet the timeline, rather than "correctness" of the solution to get to the launch date, (but have others coding the "correct" solution for the next rev), making it essentially "throw-away" code.
One software anti-pattern is Softcoding, also defined at the daily WTF. Softcoding happens when programmers put material that "should be" inside code into external resources.
I'm working with software that some might say is suffering from softcoding. External files drive the software. Those external files are a micro-language: they must be compiled to XML before the software can use them. This micro-language has its own tools.
But softcoding is always in the mind of the beholder.
Having the material in a micro-language with its own parser has made my life easier. One data source can generate many different outputs: In addition to the version that the main program uses, I am able to extract information into HTML, .csv, and other formats that our customers want. Other programs can generate code in the micro-language, making automation easier.
In our case, softcoding has been a useful pattern, not an anti-pattern.
There is a reason for calling it a pattern rather than a law.
I would surmise that almost everyone has at least one example of a place in code where exactly the wrong thing was done, and it turned out better in the long term than the "right" thing would have.
And a far longer list of examples of anti-patterns causing trouble.
I have used magic pushbuttons a number of times, out of ignorance or laziness, and sometimes it actually worked out just fine, and it turned out that I did not need the extra abstraction of proper MVC.
Duff's Device utilizes the Loop-Switch Sequence (AKA For-Case Paradigm) anti-pattern.