I have just recently started to learn some clojure and in order to make something like types (more like contracts) for validations etc, the go-to solution is a library named schema.
Recently I learned that clojure 1.9 however will have something similar named clojure.spec
Can anyone please tell me the differences between them?
When should I use one or the other, pros and cons, etc?
Eric Normand did this comparison, but as already pointed out you should definitely check the rationale, and there is also the guide and a podcast where Rich Hickey talks abouts clojure.spec.
The spec rationale is quite in-depth, I would suggest reading it: https://clojure.org/about/spec after that feel free to compare it with any other library you may be considering.
I want to use Clojure's Core.logic. However, I want to also understand how it works. Is there a concise explanation of it somewhere? (Like implementing a metacircular evaluator?)
Thanks!
core.logic is an implementation of miniKanren - originally written and designed in Scheme by Dan Friedman, William Byrd, Oleg Kiselyov and others. It is an attempt to embed Prolog-style relational programming within Lisp.
If you want to understand how it works you'll need to read the first three chapters of William Byrd's dissertation: https://scholarworks.iu.edu/dspace/bitstream/handle/2022/8777/Byrd_indiana_0093A_10344.pdf?sequence=1
The Reasoned Schemer also covers the unifier in detail. However the much more subtle goal portion of miniKanren isn't given a comprehensive treatment - you'll need to look at Byrd's dissertation for that.
Even then, as with meta-circular interpreters - many insights cannot be gained without trying to implement the system yourself in a variety of programming languages.
You can also see David's talk on core.logic from the Strange Loop 2012.
And for very light introduction to the topic see also: sokuza-kanren
I would like to know "anti-design". Please suggest an e-book for anti design pattern.
You may like to check out:
The daily wtf & Anti patterns
Not an e-book, but the only book I know: “AntiPatterns: Refactoring Software, Architectures, and Projects in Crisis” (the link is to Wikipedia's book review).
For some reason I always thought that book was by Martin Fowler, but it wasn’t.
Wikipedia also has an incomplete list of common antipatterns.
Cheers & hth.,
I have seen books on refactoring.
But I don't think I have ever seen a book on presenting bad code.
The closest thing you can find that shows examples of bad code is in Code Complete by Steven McConnel. The author puts in these little snippets called "Coding Horror" that are examples of bad code. He then explains how to write good code instead, in those situations.
This book is simply the best book on good coding practices I have ever seen.
You may find the articles from SourceMaking interesting.
Where do you guys generally look for developments in C++, most importantly, developments in new standard and its approx/scheduled release data? also boost (well, boost.com)
Is there a centralized place?
thx
You go to the C++ Standard Committee website:
Home: http://www.open-std.org/JTC1/SC22/WG21/
And for a quick access to any published papers:
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/
In the past I've used the C++0x wiki entry, and to a lesser extent, the Informit C++ Reference. Recently, I came across a new blog that people may want to check out. It appears to have been started by a couple of committee members:
We started this site because the community at large seems especially hungry—right now—to know more about, and to be more involved in, what's happening on the cutting edge of C++. We're going to be writing articles on C++0x and advanced C++03.
...
Thanks for visiting C++Next,
Dave Abrahams and Doug Gregor
http://cpp-next.com
A lot of insiders to the standards working group discuss and post at comp.std.c++ so I guess that would qualify.
Another good place is Herb Sutter homepage and blog.
Trawling through my own answers, I just found this old question and realised that, while all other answers (including my own) are still valid, there is now one more important site that has been added to the list:
http://isocpp.org/
This is run by the committee themselves and has regular updates on the status of C++. And, recursively, also points to the occasional StackOverflow post.
They also usually tweet from #isocpp, when an article is posted or updated, or about other C++ issues, such as videos from recent C++ conferences.
Since I lurk on the Boost Developers' mailing list, I tend to become informed of interesting new developments in the Standard that way. There is usually an announcement of some kind by the folks who are both in Boost and on the committee, and this usually prompts me to look at the committee papers, and also provides for some very interesting informed discussion.
C++ has been updated much here lately. I would recommend wikipedia's article on C++ though. It usually is kept up to date (not that a lot's changed). I guess the closest thing to a specification that I've found is Bjarne Stroustrup's book (the creator of the C++ language) on, what else, the C++ language.
I think the best places to start would be e.g.:
C++17 - Wikipedia
c++ - What are the new features in C++17? - Stack Overflow
C++20 - Wikipedia
C++20 - cppreference.com
etc.
I have been learning C++ for three months now and in that time created a number of applications for my company. I consider myself fairly comfortable with C++ / MFC and STL, however I don't just want to be an OK programmer, I want to be a good programmer. I have a few books on best practices but I was wondering if anyone could suggest reading materials that helped them and any disciplines which should be encouraged?
Thanks!
I would start with the Pragmatic Programmer, Code Complete, Refactoring and Design Patterns.
For C++, Scott Meyers books are very good, and will help take you to the next level.
If you don't already have it C++ by Bjarne Stroustrup, 3rd Edition
Uhm... Teach Yourself Programming in Ten Years (Peter Norvig)
3 months into c++ and you're already comfortable with it? Sheesh, I've been learning c# for over a year and have taken numerous Microsoft courses and I'm nowhere near comfortable with it.
That being said, you'll hear Code Complete tossed about as a very good book. I'm in the process of reading it now.
Marshall Cline's C++ FAQ Lite.
Herb Sutter's Exceptional C++.
Large Scale C++ Software Design by John Lakos gives guidance on design methods that will make your C++ more maintainable. It is pretty hefty but you can dip in and still get some benefits.
Somewhat off-topic: rather than suggesting books to learn, I'd like to mention some broad topics to consider.
Threading. This one is not much in demand if you use MFC, but in many other areas it's indispensable. The mechanics of threading APIs are easy to pick up, but learning all the corner cases takes a lot of time and practice.
Closures, Map-Reduce and other lisp-like techniques. Find out what they are, why they are not supported in C++, and how they are imitated in C++ (functors, and many other cases of stateful callback objects). For this I actually have a book: "Structure and Interpretation of Computer Programs".
Command Line. This gives you an idea on when not to code your own programs. Command line would be Unix command line - I don't know about MS's latest experimentation in this are, but cmd.exe is awful. Get Cygwin and start experimenting.
Scripting languages. This gives you an idea on when not program in C++. My favorite is Perl, but many people say Python, Ruby and whatnot. Hey, learn XSLT if you're so inclined!
I am sure I left out other areas. I'll mark this as Community Wiki - feel free to add.
Good blogs:
Guru of the Week, and all the books by Herb Sutter. Those will give you quite a lot to chew already.
Modern C++ Design by Alexandrescu if you want to get a good feel for what you don't yet know, and probably don't want to know.
Code Kata's for practice!
I have read several (not complete but some parts) of oreilly books on VB.net they are quite good, but if you want to be pro and have the time...
You can try out MSDN forums, help other people and discuss with them hard and complex problems, I think it's the best way..
learn another language. even if you won't use it, it's great for mind-opening.
I'd advice Lua, Scheme and Python. but almost anything else would do. (the most different from C, the best)
Josuttis and Vandevoorde - Templates: The Complete Guide
As I see, nobody mentioned Bruce Eckel brilliant books "Thinking in C++". IMHO, it`s one of the best books to start your C++ development from. From my point of view, first volume is more helpful that the second, but both of them worth reading.
http://www.amazon.com/Thinking-C-Introduction-Standard-One/dp/0139798099/ref=pd_bbs_sr_1?ie=UTF8&s=books&qid=1227890306&sr=8-1
I lot of folks can suggest more modern, up-to-date books. But I still recommend The Annotated C++ Reference Manual by Margaret A. Ellis & Bjarne Stroustrup.
The ARM was published back in '90. It's become somewhat outdated with respect to templates. STL is (obviously) absent. (Though the website at sgi.com does a good job of covering STL!)
However, the ARM is dirt cheap (used). (Shipping will exceed the cost of the book.) Its signal-to-noise ratio remains off the scale. It's very good at digging into C++'s dirty areas, explaining what was done & why.
I still use it as a reference. I rank it up there with K&R.
Dietel/Dietel "How to program C++"... I still have this book on my desk (10 years in).. Every once and a while I re-read a chapter. I'd definatly get the Code Complete, as other have suggested. Infact read that first.
To get a better understanding of object orientation, spend some time in a Smalltalk. Squeak is a free download. Then read Richard P. Gabriel's Patterns of Software and thereafter his Objects have Failed.
Thinking in C++ - Bruce Eckel
Symfonia C++ Standard - Jerzy Grębosz
If you do nothing else, program.
When you are not doing that read about programming and when something strikes you as interesting, go implement something with that knowledge. I've found that this is the only way to really set the principals.
Staying up to date on blogs can be fun, but it is scattered knowledge. It seems to distract more than help. But combined with google and a desire to research something specific can really cough up tons of information. But dont' just subscribe to alot of rss feeds and expect to get better.
I think really studying specific topics helps expand your ability. Research topics that intrigue you, meet people doing things like you (conferences, user groups, irc, facebook, stackoverflow, etc) and above all practice your art.
You can check out the Boost library and a number of the books written about it. While this may not have been what you had in mind, IMO, the Boost libraries are examples of well-designed modern C++ libraries that use the features of the language in pretty much the way they should be used to create among the most effective solutions for their problem domain. Granted of course, there are bizarre libraries like preprocessor and MPL which make you wonder if you'll ever have any use for them, but they're all round quite good. From my own experience, exploring the library and its literature has given me insight into how C++ can be used effectively.
Boost
Beyond the C++ Standard Library: An Introduction to Boost