Related
I'm interested in learning about Boo's more powerful features such as syntactic macros, parser support (Ometa?), compiler pipeline, etc. My impression is that these areas have been in flux and somewhat under-documented. Are there any good resources for learning about these things other than studying the source code?
ask code gardener / boo author #rodgrigobamboo!
"boo metaprogramming facilities I - the ast".
There's Building Domain Specific Languages in Boo. I got an early early access edition and found it frustrating for the "flux" reason you mentioned; I finally gave up. Hopefully things have stabilized since then.
Feel free to ask questions on the mailing list:
http://groups-beta.google.com/group/boolang?pli=1
By far the best reference to see what Boo can do is to spend a bunch of time going through the tests. It takes a while to puzzle out what's going on, but the tests really do flex all of the muscles that are available and are quite well written.
https://github.com/bamboo/boo/blob/master/tests/testcases/macros/macro-1.boo
Also, note that boo's interpretter- booish- is really excellent and if you're not sure how a test works, you should probably spend time in booish prodding at it.
http://boo.codehaus.org/Interactive+Interpreter
I haven't looked through this site extensively, but it appears it may have the best references for Boo:
http://boo.codehaus.org/Tutorials
This section is still not well documented but if you look at https://github.com/bamboo/boo/wiki/Syntactic-Macros you can see how to make syntactic macros. Basically you have to implement Boo.Lang.Compiler.IAstMacro.
The correct section is in https://github.com/bamboo/boo/wiki/Abstract-Syntax-Tree but it largely seems incomplete.
I am a PHP and PERL coder and lately I have started feeling that things would have been little easier had I chosen Python or Ruby as the language for implementation, more so when I think of scalability.
I know about 60% of all web application are still written in PHP and includes biggies like Yahoo and Facebook. But still I would like to know whats the general perception now.
Should I learn one of the newer languages or continue using PHP as a language of choice for web applications.
Q1: Should I learn another language?
A1: Definitely. no if's, why's or but's. Always learn.
Q2: Should I move working applications to another language?
A2: Don't break what's working; but if they're not working well, then rewriting might be a good idea.
Q3: Are Python/Ruby/Scala more 'scalable' than PHP?
A3: Not really; but there seem to be fewer bad frameworks, so it might be easier to find the good ones.
Until you start having problems with the current technology you are using, I see no reason to switch to a new one.
I would however advocate changing languages every once in a while for educational purposes.
A good rule of thumb is to use the technology that suits the application. i.e.: don't use Python just for the sake of using Python...use it when you have a reason to use it. If you need better OOP support, more libraries, then Python is just fine. The trade-off in your case is the learning curve.
I haven't heard scalability as one of the reasons for choosing Ruby/Rails. More often people say that development (including modifying an existing app) and debugging are faster.
Specifically for scalability, I don't see what Python or Ruby do that can't be done (relatively) easily in PHP.
The scalability issues in web applications are most of the time language-independant, so the solution to these problems will be available in any language. Of course the ease and efficiency of the implementation will vary, but PHP isn't the worse in both ease and efficiency.
I'd stick with PHP, as long as the reason to switch to a new language is to gain more scalability. But if the reason becomes something like "I feel I have nothing left to learn in PHP and I would like to learn a new language", then go ahead ! :)
If you are looking for scalable then switching to Python will really be a good choice. I was once a PHP developer and developed around 150 applications for a telecom company. Slowly slowly i realized that i need a something which can glue with other programming language for scalability and my answer was Python. I really had great success with Python. The best thing about Python is that it is not just a scripting language its more than that. You will find out once you start working in Python.
Just Curious. I'm currently foraying into the world of Java coding, and, was wondering weather Geometry can come useful in the kind of programming a Beginner to Intermediate Skill level Java coder has.
Depends on what you will code. Java is just a language laden with tons of useful apis. But knowing a bit of geometry can never hurt. If you are gonna code a lot of layouts you might find knowledge of shapes and forms can come pretty handy.
Even without real application needs, some exercises on geometry or other forms of maths can only help you design/code better.
It can be useful if the problems you need to solve require an application of geometry to do so. Other than that, I think that the only benefit geometry would provide would be the added benefit of thinking critically.
Depends what you mean by "basic". In these days of graphical user interfaces, nearly everyone needs Pythagoras sooner or later...
You can learn Java without knowing a single point of geometry.
That being said, I can't think of many situations where knowing geometry would be a bad thing.
The title may seem slightly self-contradictory, and I accept that you can't really learn a language quickly. However, an experienced programmer that already has knowledge of a few languagues and different styles (functional, OO, imperative etc.) often wants to get started quickly. I've seen a few websites doing effective "translations" in the form of "just show me syntax equivalence". I can't remember the sites now, but for related languages (e.g. Perl/PHP) it's quite common.
Is there a better resource that covers more languages? Is there a resource that covers idioms as well as syntax? I think this would be incredibly useful for doing small amounts of work on existing code bases where you are not familiar with the language. Looking at the existing code, as we know, is not always a good indicator of quality. Likewise, for "learn by doing" weekend project I always have the urge to write reasonably idiomatic, clean code from the start. Such a resource could also link to known good example projects of varying sizes for those that prefer to learn by reading. Reading a well-written medium sized code base can also be much more practical when access to development environments might be limited.
I think it's possible to find tutorials and summaries for individual languages that provide some of this functionality in disparate web locations but I'm hoping there is a good, centralised, comparative place that the busy programmer can turn to.
You generally have two main things to overcome:
Syntax
Reference
Syntax you can pick up fairly quickly with a language tutorial and a stack of samplecode.
Reference (library/API calls) you need to find a proper guide to; perhaps the language reference, or perhaps google...
With those two in place, following a walkthrough (to get you used to using the development environment) will have you pretty much ready - you'll be able to look up what you want to say (reference), and know how to say it (syntax).
This, of course, applies principally to procedural/oop languages; languages that require a paradigm switch (ML/Haskell) you should go to lectures for ;)
(and for the weirder moments, there's SO!)
In the past my favour was "learning by doing". So e.g. I know a little bit of C++ and a lot of C#.Net but I must write a FTP Tool in Python.
So I sit for an hour and so the syntax differences by a tutorial, than I develop the form itself and look at the generated code. Then I search a open source Python FTP Client and get pieces of code (Not copy and paste, write it self to see, feel and remember the code!)
After a few hours I get it.
So: The mix is the best. A book, a piece of good code, the willing to learn and a free night with much coffee.
At the risk of sounding cheesy, I would start with the language's website tutorial and/or FAQ, followed by asking more specific questions here. SO is my centralized location for programming knowledge.
I remember when I learned Perl. I was asked to modify some Perl code at work and I'd never seen the language before. I had experience with several other languages, however, so it wasn't hard to figure out the syntax with the online Perl docs in one window and the code in another, side-by-side. I don't know that solely reading existing code is necessarily the best way to learn. In my case, I didn't know Perl but I could tell that the person who originally wrote the code didn't know Perl either. I'm not sure I could've distinguished between good Perl and really confusing Perl. It would've been nice to be able to ask questions here at the time.
Language isn't important. What is important is learning your ways around designing algorithms and the proper application of design patterns. Focus on the technique, not the language that implements a certain technique. Once you understand the proper development techniques, any programming language will just become real easy, no matter how obscure they are...
When you put a focus on a language, you're restricting your own knowledge.
http://devcheatsheet.com/ seems to be a step in the right direction: it aggregates cheat sheets/quick references and they are (somewhat) manually reviewed. It's also wide-ranging. It still comes up short a bit in terms of "idiomatic" quick reference: for example, the page on Ruby doesn't mention yield.
Rosetta Code appears to be an excellent resource that includes hints on coding idiomatically and moves from simple (like for-loops) to things like drawing. I haven't checked out how comprehensive it is, but there are a large number of languages and tasks listed. The drawbacks re: original question are:
Some of the linking is not accurate
(navigating Python->ForLoop will
take you to the top of the ForLoop
page, not the Python section). It's a
wiki, this can be improved.
Ideally you could "slice" the wiki
however you chose to see e.g. the top
20 tasks for two languages
side-by-side.
http://hyperpolyglot.org/ seems to be an almost perfect match for what I was looking for. The quality is not always there, or idiom can be lacking, but it has the same intention and is pretty comprehensive.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I've been programming for several years now and since then I have learned several concepts and techniques that have made me a better programmer (i.e. OOP, MVC, regex, hashing, etc). I feel too that by been able to learn several languages (basic, pascal, C/C++, lisp, prolog, python) I have widen my horizons in a very possitive way. But since some time ago I feel like I'm not learning any new good "trick". Can you suggest some interesting concept/technique/trick that could make me retake the learning flow?
A good paradigm shift always allows you to see things differently and become a better developer. I would suggest you read up on functional programming and maybe learn a functional language like Haskell or Scheme.
YAGNI (You Ain't Gonna Need It) and DTSTTCPW (Do The Simplest Thing That Could Possibly Work)
It's easy to spend a lot of time thinking about edge cases, and find that you've implemented something that's completely useless. I believe that a far better approach is to knock out a simple prototype, and then poke and prod it until you understand the domain well enough to create production code.
Recognize, however, that your prototype is going to evolve into production code whether you like it or not. So write it with that in mind.
Learning how to use your IDE and tools. This to me resulted in a far greater productivity increase.
For examples:
learning how to use a source level debugger
using tools like purify/boundschecker
fxcop
etc. I realize I am dating myself, but those were big steps. There are many more.
Any time you can change the way you think about a problem or solve a problem without having to undo previous work is HUGE gain. Process, tools, etc all can help with that. Don't limit yourself to finding silver bullet techniques for productivity gains.
Watching productive people work and getting them to tell you what they are doing and why is also invaluable.
If I'm honest, using, and learning a great framework like .NET has really increased my productivity.
I'm often amazed what people are willing to reinvent due to their ignorance that the very same function already exists in the framework.
AGILE and especially Test Driven Development. Best thing to happen to software development since the invention of Object Oriented Design.
Concerning coding, I'd say design patterns and architecture patterns are always nice to look at and can help you write cleaner/better code.
For methodology I would advice Agile development that is great. There are a numerous number of techniques and methods (I'm personally fan of extreme programming) and reading that can keep you busy and improve your general approach.
Finally I'd say learn new languages like Ruby
Design patterns
SCRUM process
DiSC assessment (and understanding of how it applies to collaborative s/w development)
StackOverflow.com (of course!)
Google
... other stuff too, I'm sure
Design Patterns. Learning how to break dependence upon implementation and inheritance, and depending on interfaces (contracts) instead changed the way I think about programming.
Debugging. Once I figured out how to actually step through the code and go line-by-line, examining the underlying state, it revolutionized how I troubleshoot code.
Practice, practice practice: I didn't realize how important it is to keep working on my skills apart from work until a relatively short time ago. Mistakes and solutions I make at home make me a better programmer at work, and vice a versa. Learning should never stop if you want to be good at something, and programming isn't an exception.
If I had to pick just one, I'd say Test-Driven Design, aka TDD: write unit tests (and check that they fail) before you incrementally add features.
Try to learn to see things from the user's standpoint.
For example:
learn how to write meaningful error messages
learn how to produce usable applications
learn some basic speed-optimization techniques
Remember that the user sees your application, not your code.
VIM Quick Reference Card. After I started using advanced vim (macros, plugins) I have stopped doing any repetitive actions during coding manually.
Apart from that, Scrum and working at night, when noone interrupts You gave me the highest benefit.
If you want to expand your experience into web programming, you should try and get a good handle on the HTTP Request/Response paradigm. This will make creating web apps much easier on you because you understand the underlying framework.
(http)://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol
I would look at some of the newer languages that combine OO and functional elements, like C# or Scala.
Learning Smalltalk has helped me become more productive. It is an easy language to learn and things can be built extremely quickly. For a stunning productivity aid check out Seaside, it's a framework for building web applications. Moreover, if you have only been used to curly brace languages Smalltalk will also make you smile!
I was helped by the following paradigms in this order:
1) bottom-up programming
2) top-down programming (C, Pascal)
3) object-oriented programming (Smalltalk, Java)
4) functional programming (lisp, Mathematica)
with some logic programming thrown in (prolog).
nHibernate hands down. The fact that I dont need to write database functionality for my business objects is very useful and time saving.
High level understanding, creating good abstractions with proper dependencies, is what pays off in long term. For example, Law of Demeter is an important guideline. I recommend also reading Eric Evan's Domain Driven Design
Code generators. They're the best thing in software engineering.
Would you like to write all your projects in asm? Nope, let's generate it from C++. Or from something sat above the JVM which diligently generates the necessary machine code.
Duplicating the same source code all over the place, but stuck with a language that insists on the line noise? Use macros.
Want to use lambdas in a language that doesn't have them? Work out how to fake the anonymous name and variable scoping required then generate the boilerplate.
None of the readily available languages quite fit your pattern of thought, desired syntax or even semantics? Write a compiler for a new one.
Better languages are nice. Better design patterns are nice. Emacs is awesome. But compilers are where all the power lies in our field. I suspect the only reason they aren't mentioned in any of the other answers is that we can't imagine programming without any.
Copy/paste technique