I would suggest using "learn x in y minutes" [1] if you need to lookup syntax for something. It doesn't feature the "for loop in java" search function, but it has more languages than this tool, as well as tools like vim, git, tmux, with many files having multiple natural language translations. It is also community driven, so if there is something missing it is only a pull-request away.
Right now, this isn't really any better than looking at an individual language's site for syntax, this just offers a common user interface. For example, the site has no idea what a list comprehension is, yet that's a fundamental component of python.
I think a transpiler would be absolutely awesome -- even if it only works on curated code samples on the site. Something that shows how a piece of code can be expressed in many different languages. This would be extremely useful for things like Regular Expressions (also, no results found for regular expressions on the site), which are in just about every language, but are treated very differently.
Personally, I think that's your killer idea. It will be damn hard to do, but if you can make it work, I think you'll end up with a lot of visitors. Knowing the language idioms is key to understanding a language.
Hey HN, I'm the developer behind SyntaxDB. This feedback is good and I encourage people to keep it coming!
A lot of responses will be about "there's no result for x". You're right, there isn't nearly as much content on the site as I'd like there to be!
The content is actually hand written, and as of right now focuses on the very basic programming fundamentals common across all of the languages. The plan is to triple the amount of content in the database (adding DS, special classes, parsing, etc.), and eventually open up the database to outside contributions.
How do you plan to compare and compete with other projects such as Stack Overflow documentation (currently in closed beta iirc) which, as far as I can see, offers the same functionality, but a larger user base?
It would be very awesome to have this backend data user-contributed, makes the burden of adding and improving a lot less on you. I'm looking through the sections and see lots of little tiny things that would be a quick PR on github, and I'm sure there are tons of people who'd help out.
Good to know, I was coming to say something about smart pointers in C++ and a few other things I tried with no results.
Not sure how you're doing the querying but when I dropped the "smart" from "C++ smart pointers" it did return a result. Does every word in the search have to match then? I'd have thought, similar to Google, that it would return results where at least some of the search keywords matched even if they all don't.
Anyway, it looks like a good start. Even for people who already know a lot about programming it should be really useful for those times when you know what you need but just can't quite remember the full syntax of something.
Don't try to explain basic concepts in all languages. Better make sure that the languages you have are covered for as much as possible. Then add other languages.
Idea is good, but search does not take into account language specifics. I mean same keywords do not mean same things in different languages. For instance, for and foreach are one and the same in Python (actually there is no for, just foreach named for), so if look for Python version of C#'s foreach I find nothing.
I actually have something in place which handles some cases of differences in keywords across languages. For example, searching for "dictionary in java" would return a HashMap.
I guess I didn't account the specific "foreach" keyword with C# (I have it as "for each"), good catch!
A while back, there was a service on the front page that was a combination of search engine for code, static analysis, and git repository browser. The initial implementation was for Golang only.
Does anybody remember what that project was? Does it still exist?
Slightly OT, sorry. This project just reminded me of it.
This is a very good idea. As others have said, and the creator acknowledged, there isn't a lot of content yet. Community contribution would be very cool.
I'm not sure if I have a good idea here or not, but focusing on older and/or more esoteric languages is a potential niche. For instance, and these are real examples, maybe I've inherited some SAS code with a nasty DATA step and I don't really know how a MERGE works. Or COBOL. I always have ridiculous COBOL things to google.
As someone else pointed out, though, I think you need some cross-search between idioms. I might not know what a SAS DATA MERGE is, but if I look for a SAS join, tell me how to do it in PROC SQL or the DATA step.
I think this would be great to open up to the community to maintain. Maybe you approve it initially, and eventually come up with a system for community approval.
I like this site, but i'm uncomfortable with it for the same reason w3schools is such a steaming pile. It can be more dangerous to project authority but not actually be accurate.
I don't have to look for long to find inaccurate statements, e.g. the page that describes "for of" in ecma states that order is not guaranteed, when the order of an `of` is however the iterator is defined for that collection. e.g. `for (const a of (function*() { yield 1; yield 2; })())` is certainly going to have an order. I think they were just confusing it with for in.
Good start but -- some C++ stuff is wrong, e.g. in the bit on friend functions, a member function prototype is written with an empty block instead of a terminal ";". Subtle, but you know. Also, more subjectively, std::string is described as immutable, but with no further discussion about what that means or how that might work.
Just sayin. Frankly I like how it's not Wikipedianishly drowning in citations and/or demands for same -- but how does it get updated? I immediately tried to expand on those two issues I mentioned but there was no sort of UX recourse for my pedantic urges (FWIW)
Thanks for pointing that out! As of right now, it all gets updated manually (there's an internal CMS I built and use). As of right now, when people point out corrections they do so via feedback form, and I update accordingly (if I can verify it). Not the greatest but it's what's in place for the time being.
It'll later be open for others to provide new concepts and corrections.
Ideally to me this is part of the editor. I use Visual Code + Go.
I think there is still a lot of improvement possible for the help that the editor (plus tools) can offer. Much more (and more intelligent !) help and info to be shown while I type or move around in code. At the very least instantly show parameter types plus full docs on every function my cursor is on. Visual Code does a good job with the Go plugin but it could be faster. And there is only so much a plugin can do.
If AI is really the future of coding then it least at some point it should be more helpful before it takes over...
The site doesn't actually support Haskell or Obj-C atm (will in the future).
I also need to improve the search engine to handle queries with additional words that might give a null result, as well as words like "foreach" (that has to do with the database). This will be fixed very soon.
It is bad that there are missing concepts, and I'm fully aware that this isn't even close to complete. The goal in the future is to have as few null result queries as possible. I actually make note of queries that don't provide results so I'm glad everyone's making these known, it'll only make the database better in the future!
Is there any way to suggest improvements, or heck, raise PRs, instead of using the feedback button?
For example, the for in Python should include an example using enumerate too which I'd be happy to add and contain some additional docs on xrange vs range in Python 2 vs Python 3.
It's not a bad idea but it seems a bit sparse at the moment even in the languages it does support. Search for lambda does give anything about Java 8's lambda syntax, and search for annotation returns nothing at all.
- include the code-highlighted syntax block in the typeahead suggestions.
- When i hit 'enter' on a typeahead suggestion, send the user to the page instead of just filling the input.
[+] [-] stepvhen|9 years ago|reply
[1] https://learnxinyminutes.com/
[+] [-] pc2g4d|9 years ago|reply
[+] [-] mywittyname|9 years ago|reply
I think a transpiler would be absolutely awesome -- even if it only works on curated code samples on the site. Something that shows how a piece of code can be expressed in many different languages. This would be extremely useful for things like Regular Expressions (also, no results found for regular expressions on the site), which are in just about every language, but are treated very differently.
Personally, I think that's your killer idea. It will be damn hard to do, but if you can make it work, I think you'll end up with a lot of visitors. Knowing the language idioms is key to understanding a language.
[+] [-] thenipper|9 years ago|reply
[+] [-] anthnguyen94|9 years ago|reply
A lot of responses will be about "there's no result for x". You're right, there isn't nearly as much content on the site as I'd like there to be!
The content is actually hand written, and as of right now focuses on the very basic programming fundamentals common across all of the languages. The plan is to triple the amount of content in the database (adding DS, special classes, parsing, etc.), and eventually open up the database to outside contributions.
Additional languages are coming too!
[+] [-] Etheryte|9 years ago|reply
[+] [-] joelg236|9 years ago|reply
Love the idea!
[+] [-] holmb|9 years ago|reply
``` In [1]: s = {}; type(s) Out[1]: dict ```
[+] [-] smhenderson|9 years ago|reply
Not sure how you're doing the querying but when I dropped the "smart" from "C++ smart pointers" it did return a result. Does every word in the search have to match then? I'd have thought, similar to Google, that it would return results where at least some of the search keywords matched even if they all don't.
Anyway, it looks like a good start. Even for people who already know a lot about programming it should be really useful for those times when you know what you need but just can't quite remember the full syntax of something.
[+] [-] arviewer|9 years ago|reply
[+] [-] bijection|9 years ago|reply
[+] [-] adontz|9 years ago|reply
[+] [-] anthnguyen94|9 years ago|reply
I guess I didn't account the specific "foreach" keyword with C# (I have it as "for each"), good catch!
[+] [-] robbles|9 years ago|reply
Does anybody remember what that project was? Does it still exist?
Slightly OT, sorry. This project just reminded me of it.
[+] [-] nepalisaathi|9 years ago|reply
[+] [-] wasd|9 years ago|reply
[+] [-] m3mohsen|9 years ago|reply
[+] [-] SmellTheGlove|9 years ago|reply
I'm not sure if I have a good idea here or not, but focusing on older and/or more esoteric languages is a potential niche. For instance, and these are real examples, maybe I've inherited some SAS code with a nasty DATA step and I don't really know how a MERGE works. Or COBOL. I always have ridiculous COBOL things to google.
As someone else pointed out, though, I think you need some cross-search between idioms. I might not know what a SAS DATA MERGE is, but if I look for a SAS join, tell me how to do it in PROC SQL or the DATA step.
Keep going, I think this is very cool.
[+] [-] quaffapint|9 years ago|reply
[+] [-] alexkavon|9 years ago|reply
[+] [-] bbeausej|9 years ago|reply
I wish it was more complete though!
"No results found for bash if" https://syntaxdb.com/reference/search?utf8=%E2%9C%93&search=...
[+] [-] jkoudys|9 years ago|reply
I don't have to look for long to find inaccurate statements, e.g. the page that describes "for of" in ecma states that order is not guaranteed, when the order of an `of` is however the iterator is defined for that collection. e.g. `for (const a of (function*() { yield 1; yield 2; })())` is certainly going to have an order. I think they were just confusing it with for in.
[+] [-] fish2000|9 years ago|reply
Just sayin. Frankly I like how it's not Wikipedianishly drowning in citations and/or demands for same -- but how does it get updated? I immediately tried to expand on those two issues I mentioned but there was no sort of UX recourse for my pedantic urges (FWIW)
[+] [-] anthnguyen94|9 years ago|reply
It'll later be open for others to provide new concepts and corrections.
[+] [-] Gys|9 years ago|reply
I think there is still a lot of improvement possible for the help that the editor (plus tools) can offer. Much more (and more intelligent !) help and info to be shown while I type or move around in code. At the very least instantly show parameter types plus full docs on every function my cursor is on. Visual Code does a good job with the Go plugin but it could be faster. And there is only so much a plugin can do.
If AI is really the future of coding then it least at some point it should be more helpful before it takes over...
[+] [-] smhenderson|9 years ago|reply
https://syntaxdb.com/about
[+] [-] theseoafs|9 years ago|reply
[+] [-] anthnguyen94|9 years ago|reply
I also need to improve the search engine to handle queries with additional words that might give a null result, as well as words like "foreach" (that has to do with the database). This will be fixed very soon.
It is bad that there are missing concepts, and I'm fully aware that this isn't even close to complete. The goal in the future is to have as few null result queries as possible. I actually make note of queries that don't provide results so I'm glad everyone's making these known, it'll only make the database better in the future!
[+] [-] gresrun|9 years ago|reply
[+] [-] raimue|9 years ago|reply
[+] [-] unknown|9 years ago|reply
[deleted]
[+] [-] kevlar1818|9 years ago|reply
https://syntaxdb.com/reference/search?utf8=%E2%9C%93&search=...
[+] [-] daenney|9 years ago|reply
For example, the for in Python should include an example using enumerate too which I'd be happy to add and contain some additional docs on xrange vs range in Python 2 vs Python 3.
[+] [-] aneil|9 years ago|reply
* "channels in go" (no result)
* "mutex"(no result)
* "generator in python" (returned a page describing the Python programming language)
[+] [-] aardvark179|9 years ago|reply
[+] [-] taf2|9 years ago|reply
no results?
[+] [-] marxidad|9 years ago|reply
[+] [-] blairanderson|9 years ago|reply
Feature suggestions:
- include the code-highlighted syntax block in the typeahead suggestions. - When i hit 'enter' on a typeahead suggestion, send the user to the page instead of just filling the input.
[+] [-] dendory|9 years ago|reply