My last hit on SO was a search for “.gitignore wildcard”. What’s GTP-4 going to do with a two word prompt?
A wildcard in .gitignore file is a special character used to match multiple file names or patterns. The most commonly used wildcards are:
1. `*`: This wildcard matches any number of characters in a single path component. For example, `*.txt` would ignore all files with a .txt extension.
2. `?`: This wildcard matches any one character in a single path component. For example, `file?.txt` would ignore files like "file1.txt" and "file2.txt" but not "file12.txt".
3. `**`: This wildcard is used to match any number of characters across multiple path components. For example, `**/build/` would ignore all files and folders named "build" at any level in the project structure.
Examples:
- `*.log`: Will ignore all files with a .log extension
- `**/.DS_Store`: Will ignore all .DS_Store files in every folder
- `build/`: Will ignore the "build" folder on top level directory
- `/*/temp/`: Will ignore any "temp" folder at the second level of the directory structure (ignores sibling/temp, parent/child/temp but not sibling/child/temp)
For more information, you can refer to the official git documentation on gitignore: https://git-scm.com/docs/gitignoreI also have no idea what it’s trying to communicate with its /*/temp/ examples
A perfect representation of my git usage then!
I wonder how it does if you tell it it’s wrong. I’ve tried a few times and it seems to get confused pretty easily.
This is a great example where many people providing different answers and comments based on their different knowledge and experience provide value, opposed to just ChatGPT telling you stuff. Simply "correct" is nice, but "correct, complete, and with experience and context" is better.
I don’t really accept that SO is just answering questions for you. There are usually multiple answers. There were several comments on SO that went into more depth than the official docs. There are second opinions, and answers pointing out what the wrong answer is. There are links to related questions.
It wasn’t what I was looking looking for initially, but sometimes answers to questions you didn’t ask are better than ones you did.
It's time to update my search reflexes.
The problem is that, when I have "how do I do X using Y API"-type questions, I usually consult the API's official documentation (or sometimes the source code), since it's generally more complete and up-to-date. The questions that take me to Google are usually either obscure errors or other hard questions. Even Stack Overflow answers are often irrelevant or outright wrong. ChatGPT is considerably less trustworthy.
As a random example, today I Googled 'topological sort cyclic graph'. By definition a topological sort can only be done on an acyclic graph, because otherwise it's impossible to avoid violating some ordering constraints, but I wanted to find algorithms for minimizing the number of ordering violations. Among the Google results, there were a few true-but-unhelpful answers ('you can't'), a few wrong answers ('here's some code to do it', author doesn't seem to really understand the problem)… and finally a few answers, all on Stack Overflow, referencing the "feedback arc set problem" and "minimum feedback vertex set problem". Those were the magic keywords that allowed me to learn more, including the fact that minimizing the number of violations is NP-hard.
I just tried asking GPT-4, and it gave an answer that had some correct parts but also had significant errors, and did not include the aforementioned magic keywords.
Ask it about something you know is a frequently repeated mistake.
Where do you think ChatGPT finds these answers?
Those of you who anticipate continuing to use SO: why?