Show HN: A simple GUI Notepad using C++ natively made in my high school in 2015
github.com
github.com
I didn't write my first line of code until I was 20 years old in college, and 8 years later I am now a lead developer at one of my country's largest telecommunications companies.
I can't imagine how amazing this guy is going to become being able to build this at such a young age. Keep it up!
Granted, it is amateurish code for amateurish projects, but the users don't care and gladly eat it up.
I remember building one back in the day (2002) with Visual Basic 6.
Unfortunately I lost the source code but I still have the website's code. Feature wise it had syntax highlighting, column selection, project wide find / replace, file edit history (timeline), multiple clipboards, splits and more.
Does anyone remember what that really good text editor control was in VB6? It did most of the heavy lifting. It wasn't a built-in control.
It was something you could drop into your app and it had an API for all sorts of nice features. It was one of the best controls at the time for creating a text editor.
CodeMax was originally a product by Barry Allyn (WinMain software) and it was pretty good.
Unfortunately though for him the market was pretty small and it was difficult to survive as a commercial product. It was open source for a short while and that was when CodeSense came about.
I think I would immediately know the name if it were mentioned. It was much faster and better than anything at the time when it came out.
>> I would now love to opensource the project for everyone.
Where is the license?
Learn more about licensing here: https://help.github.com/en/articles/licensing-a-repository
I've interacted with several HS graduates from India, and those who opt for CS in HS (11th and 12th grade; usually ages 16-17) are usually taught C++ in Turbo C++ 3.0. This release of Turbo C++ was released in 1990.
That's... not great. For reference, the C++ programming language was first standardized in 1998.
Thus, most graduates never learn proper C++ in the sense that a lot of what they're taught doesn't even compile on modern compilers and they aren't aware of many new* features.
That said, this project is still pretty impressive for an HS student, even if it's written in ancient C++ and requires DOS to run :)
*new = anything introduced to C++ in the last three decades (after 1991).
However, apparently they've introduced Python3 last year, so hopefully the situation will improve :)
It was taught in Turbo C++, Syllabus was very basic ones which has basic i/o, file stream, loops, etc.
So at that time, wanted to explore something out of box, and for the 12th Grade Project, School did restrict to only Turbo C++ at that time, so the thing which was most possible solution was to hack around with that and having a mouse pointer and a GUI was a pinnacle moment at that time when the resources was limited.
But now School's Board of Examination (CBSE) did change syllabus to Python did move to Python scraping C++.
C++ is not the language I'd use to get many people attracted, but if that is the only language the teacher is able to teach, it's better than nothing.
The downsides are that it doesn't run on modern machines, is difficult to maintain, and you need to implement dozens of workarounds to do basic things that can be done in modern languages with just a couple lines of code.
I agree it's unfortunate that schools are/were slow in catching up to a modern programming environment. This highschooler's project was made in 2015, so the students were learning a language standard/platform that was a couple decades behind.
It makes the project even more impressive, given the technical constraints that the student had to work with, in addition to their young age.
It's a good example of the "hacker" spirit that we encourage on HN. Software (and hardware I imagine) engineers deal with similar situations often, having to work around the limitations of legacy codebases or platforms, challenging what it can be made to do.
Another comment mentioned that some schools moved to teach PHP instead of C++. Granted that's an improvement in some aspects to Turbo C++ 3.0, I think the latter might have been better in terms of learning the real fundamentals.
10 years later when I worked as a substitute teacher it was PHP instead which felt more odd as a starting general programming language ...
It was very very basic stuff though.
Still, I was able to basically walk through my first year at Uni (which was exclusively C programming) with almost zero effort.
https://github.com/Giancarlos/qNotePad
I wanted to make a cross platform text editor that was simple and consistent throughout different platforms. I found it easier to do it in Delphi cause I wasn't sure how to hook up a syntax highlighter for it. I'm proud of the small bits I did code though. C++ isn't really my strongest language.
Solid project, but I suggest you run the file through something like clang-format.
So at that time Syllabus is something like this[2], it is not exactly same, almost same and I think this was overall pattern of that[2], now it is again revamped[3].
At our time it was more like 4 hours theory/week and 1.5/2 hours lab sessions(which sometimes becomes theory).
[1]: https://en.wikipedia.org/wiki/Kendriya_Vidyalaya
[2]: https://www.kv1bhuj.org/admin/downloads/1997118251study_mate...
[3]: http://cbseacademic.nic.in/web_material/Curriculum19/Main-Se...
#include<conio.h>
#include<dos.h>
This appears to be for DOS, and I'm betting this was written in Turbo C++. From what I've heard from my friends, almost all schools in India still use Turbo C++ (in DosBox) to teach C++. Ew.Each student had their own area on a file server which would be mounted locally and the exercises and respective support material for integration into VS as per exercise were available on the server as per lab session.
Of course, the counter argument is, that it is kind of boring (except for some kids). Alternative is a language, where you easily can get things done. So maybe Python, but thats about it. I am still sad, that LOGO is not used anymore (there is much more to logo than turtle graphics).
When i studied CS at the uni ~2007 we also did it like that for our intro programming courses. I enjoyed it :)
[0] this is my hypothesis around this in general tbh.
The problem is that the teachers (and the students by extension) don't know that they are learning helpessly outdated things. Nothing would be lost if they were instead learning today's coding styles & paradigms and they could be actually much more creative by using modern practices where the compiler can infer a lot instead of trying to fight with older compilers and doing that: https://github.com/vibhoothiiaanand/CNotepad/blob/dlevel/CNo...
How many security issues will be caused because that student hasn't been taught about global variable issues, std::string, etc... ? I'm not hopeful.
If you want to be "creative", you can do the same thing than this: https://github.com/vibhoothiiaanand/CNotepad/blob/dlevel/CNo... but in much prettier, portable, useful and much less lines of code with e.g. OpenFrameworks: https://openframeworks.cc/ofBook/chapters/lines.html - and at least the tutorial gives you an idea of non-one-letter variable names.
Dear student: please send that to your teachers please : https://github.com/jcelerier/cpp-teaching-manifesto
Open framework surely looks promising, so do the manifesto,
At that point, I think I was mostly self-driven with the goal of making "it works" with little to no knowledge of security aspects of things. If I am doing the same thing now I would be knowing how to do, how to "Google", and also the right place to ask, but at that time I think I wasn't aware, I do also think this or even worse is the situation of school students at least here because there is no exposure to things and the bright side of the Internet.
Also, for this to solve, one thing we can do is start FOSS and cybersecurity Clubs and build a culture among them through various ways like competitions, workshops, code-sprints, hackathons, CTFs and lot more which can be solved. Keeping that in mind, from our uni we have Started CTF competitions and bootstrapping them through workshops,
So last year(2019), we did try to have workshops and courses, classes online and offline for school students which did help them.
So the primary problem here I faced was lack of understanding of how really things work and how to explore in a better way.
exactly, and that's not your fault at all, this is what teachers ought to teach you if they had any ethics and any level of pride in their work
> Also, for this to solve, one thing we can do is start FOSS and cybersecurity Clubs and build a culture among them through various ways like competitions, workshops, code-sprints, hackathons, CTFs and lot more which can be solved. Keeping that in mind, from our uni we have Started CTF competitions and bootstrapping them through workshops,
super nice, but also super sad that things are so bad that students have to take the place of their teachers :) as it's the teachers who get paid
Even in Engineering courses, some teachers don't even properly indent code and can't even write themselves a recursive algorithm for eg: printing a number in binary. This is not an issue limited to CS/programming, but manifests more because it is a practical subject and a fast growing fields.
But some students get interested in programming earlier rather than rote learning other choices of subjects (eg: biology). That's the benefit of having CompSci/Programming in curriculum.
Source: learned programming in turbo C++ in India during my HS (called +2 or Pre-university here).
Not sure what to think really, should we get angry how younger generations get taught so outdated information, or be happy that at least they learn something that will allow them to jumpstart into something better years later.
(I'm an Indian that learned C++ in school using Turbo C++ 10 years ago.)
Outdated? The point of learning programming at that age is to understand the basics - functions / if / for / while, structs / classes, and pointers. All of those work the same in Turbo C++ or in the latest MSVC.
Sure learning C++ via Turbo C++ doesn't prepare the student for modern code that uses `<algorithm>` or `std::shared_ptr` (or `std` at all), but those can always be learned later. The basics are more important.
If anything, the fact that Turbo C++ came with graphics.h meant I could make screensavers like starfield and a visual sudoku solver by myself without any hassle. It made programming fun and was certainly part of the reason I'm a programmer today. I'm not even sure how I would do those with MSVC or gcc today, let alone 10 years ago. WinForms + GDI? SDL? Both are much more complicated than what I remember of graphics.h's API.
Edit: graphics.h was the header with the graphics API, not conio.h
On top of that, regular old Qt is still one of the most fully featured GUI frameworks, QtQuick is mostly used for mobile and embedded, even though it also works on desktop. Lazarus or Tkinter aren't better choices for starters, I say as someone who used both.
But, even if you don't like Qt, QtCreator is still a great IDE. No need to keep using a Dosbox with Turbo C++.
All Turbo C++ versions for MS-DOS or the later Windows 3.x versions are older than ISO C++ and have semantics that eventually changed across versions.
Then there is the whole point of them being MS-DOS/Windows 3.x products that run in modern computers with various degrees of success.
There are open source clones of graphics.h and conio.h, and any good teacher could prepare the class material so that the students wouldn't have attrition.
And it isn't just talk, I spent one year doing TA activities so I know how much it costs to prepare such student materials.
I believe it is in every programmer's interest to have a deep understanding of the system for which they are working on, even if they don't need to use the low level tools from day to day. Teaching C++ in DOS can still provide an excellent CS foundation IMO.
You also have l-value references, r-value references, smart pointers (unique, weak, shared, etc), and many of those have a use-case that overlaps with raw pointers.
gcc and clang are distributed free of cost, and so is Linux. They should switch to those compilers and teach a modern dialect of C++.
conclusion, in first year in schools you might have different level of students, they do not learn a language so they start a career with that language, they start with the basic stuff and hopefully a large number of students are attracted. Probably the teacher is lucky if majority of the students could handle homework on their-own so attempting to add more information that is not relevant is not useful.
I am attempting to teach my son programming, he likes to play Gary's mod and there he can script stuff, I observe very interesting things(he is 14) like I need to explain and force him to ident the code to make it readable (imagine how extra messy would be with python) or I explain a few times that you can have local variables or function parameters reuse same names but for some reason he gets confused when 2 different things have same name. 1
Emacs has tried to add a bit of the same featureset lately, like it will show a primitive TUI menubar if you launch it from a terminal but it's quite half-baked; the look and feel is sub-standard, and mouse interaction (via gpm or xterm) doesn't actually work by default. (Of course I realize that capturing mouse events is not always desired but it should be reasonably easy to allow this, maybe even as a default.) And it still lacks other basic UX elements like floating windows for dialog boxes, or resizing/rearranging windows with the mouse.
FreePascal still ships a proper TUI IDE, and there's a FreeDOS text-mode IDE for C/C++ known as RHIDE.