Allegro.cc - Online Community

Allegro.cc Forums » Programming Questions » sqlite's shell is a code soupe.

This thread is locked; no one can reply to it. rss feed Print
sqlite's shell is a code soupe.
Doctor Cop
Member #16,833
April 2018
avatar

I was set to learn how to create a language in C and so I thought to start with learning how Data Bases are made. I choose SQLite because it's minimal and simple enough to get the hang of but when I got to the sqlite's shell part then what I found was disastrous, It's very unpleasant to even look at it's code.

I'm attaching it so that you guys can see how bad it is and if I should move onto some other repository or It's just normal and I should try to understand it.

jmasterx
Member #11,410
October 2009

/* DO NOT EDIT!
** This file is automatically generated by the script in the canonical
** SQLite source tree at tool/mkshellc.tcl.  That script combines source
** code from various constituent source files of SQLite into this single
** "shell.c" file used to implement the SQLite command-line shell.

It seems every week you're taking on some massive project. Last week it was multi threaded pong with deep learning ai. Before it was compression. Before it was an entire paint program...

You really should take on simple manageable projects. Make a first iteration that's simple and keep expanding to add new features. Refactor as you go etc.

You don't really need to focus on learning to make your own language at this point...

If you're interested in how this works I made a recursive descent parser a few years ago.

https://github.com/jmasterx/Computer-Science-Assignments/blob/master/Principals_of_Prog_Languages_CPP/recursive_descent_parser/src/parser.cpp

But focus on finishing manageable projects.

Dizzy Egg
Member #10,824
March 2009
avatar

jmasterx is right - you're trying to do too much without finishing and presenting a project....what happened to pong?

----------------------------------------------------
Please check out my songs:
https://soundcloud.com/dont-rob-the-machina

Doctor Cop
Member #16,833
April 2018
avatar

Dizzy Egg said:

Dizzy Egg:

jmasterx is right - you're trying to do too much without finishing and presenting a project....what happened to pong?

I have already completed the Pong game and I posted the multiplayer version before but forgot to upload the player vs COM version.

The file compression program I have completed with the help of zip library.
I wasn't trying to make a full fledged file compressor like WinRAR but just a small in game compression and zip file manager for resources.

The Paint program is still pending, it seemed difficult to understand but I'm still on it.

I have to get employed next month and I haven't done any special project that I can present and which can shine in my GitHub repository, so I thought on taking a small language parser.

If I fail to complete a good project then I'll have to settle in Web-Dev suit, which is massive and pay is low and because of great competition chances of growth are low too.

jmasterx
Member #11,410
October 2009

You're putting a lot of pressure on yourself.

My first internship sucked. I was paid 2$ an hour.

But now I have a great high paying dev job.

Go to the interview, if you don't get the one you want then go through the trenches, keep working hard and eventually you'll get where you want.

But your health is most important do not stress too much over it. I would hire the person that wrote a clean, bug-free, well tested pong over 4 unfinished over ambitious projects with messy code any day.

Doctor Cop
Member #16,833
April 2018
avatar

Thanks, jmasterx for the advice, I will make my current project better and upload
it.

Which technologies do you use at work?
Again thanks, I appreciate it.

jmasterx
Member #11,410
October 2009

C#, WPF, MVVM, sometimes C++, SQL Sever, Entity Framework, Internal SDK, Visual Studio...

I work on plugins for a large distributed platform written in C#.

I am full stack so I work on both the frontend and backend.

The focus is on code quality, testability, tested code, clean code, maintainable code.

Doctor Cop
Member #16,833
April 2018
avatar

I am learning ASP.NET with C#, is it worth it and what should I do to get a job?
I have almost completed the basics and I'm at exception handling in C#.
I have been doing C++ and PHP for an year now.

What should be my road map?

jmasterx
Member #11,410
October 2009

You're in India, I don't know how things work there... I'm in Quebec, Canada

Finish schooling, get a Bachelor's degree.
But most important, do internships and get real world experience. I'm not talking just about coding, I'm talking about working with people. Developing communication skills. Using source control in a team, collaborating, etc.

You'll learn a lot of soft skills this way.

Once you have experience, look for local job postings and submit your CV.

Go to interviews, and get hired. It might take 10 interviews at 10+ places or more to get hired.

I did 6 years of post secondary schooling and got a degree, but during that time I did 4 internships, and made connections. I also was coding a large multiplayer game and gui api about 20 hours a week. Network with people. Getting well paid is not overly important at this point. You should be making connections and getting better at coding. But your portfolio should have finished projects that more or less feel polished.

Then I worked a job that was good but I did not like it, for a year. I then did a local hackathon and won 1st. It got in the news paper and I got offered an interview where I work now.

Learn C# and asp if there are tons of jobs for it in your area. Learn whatever is in demand in your area. Look at local postings and what they ask for. Select the things that come up most and learn that.

I personally hate PHP but that's just me.
C++ is incredibly complex to actually learn properly.

C# and Java are nice to learn and work with.

Audric
Member #907
January 2001

I'm not in India either, but work in a IT firm that employs 100000 people in India. There is quite a lof of dotnet activity, and I expect will continue in the 5 years to come at least. On the one hand it means a lot of more experienced people are already doing it, on the other hand it means knowing the technology lets you step in a team easily.
Unless you're working for a small firm or are given very small-scoped projects, you will probably not do everything from scratch, from database to UI. A lot of code (and in-house standards) will already be there, you will expand it or fix specific issues, and when you leave for an other project, the parts that you touched should look the same as the rest. Code often stays in use for 3-15 years (more than the average coder's commitment to a single project/client), so being able to adapt to existing code is important.
It's still important to know how everything works together, but you don't need to be a multi-specialist.
I think web work requires many more technologies, because you often end up responsible for the entire browser<->server communication, juggling between the page's DOM, javascript code, the aspnet model, and the C# code hooked on the aspnet events. I find it more challenging because of this, and it has the extra challenge that technology changes more often (browser versions, new standards, deprecated libraries).

An interviewer will appreciate that someone has worked in 5 technolgies, not because you will practice those 5 at your job, but because it shows your first experience in learning (adapting to) different standards and paradigms, and it means you should be quick to learn the 6th immediately (say: a commercial GUI lib that you can't learn online) and 7th in one year.

Doctor Cop
Member #16,833
April 2018
avatar

jmasterx said:

You're in India, I don't know how things work there... I'm in Quebec, Canada

It's the same as in west, Indian companies are following Big Tech companies and Node.js is becoming more popular but the number of jobs in JavaScript are still less.
PHP and .NET are more dominant followed by Java and MVC.

I gave interview in two companies and they were impressed by the amount of knowledge I have now, one of them stated "Usually freshers have very less experience in programming that they get confused in simple if-else statement", but they refused to hire me and said that they will be happy to hire me when I will have a degree in my hand.

Thanks Both of you for your advice but I asked it because some You-Tubers said in their video that You should have an internship in your hand as soon as you are in second year of your college otherwise you will be left behind and I thought that if people are getting internships in their second year of college then I'm in my final year, I should get it too before it's too late.

Polybios
Member #12,293
October 2010

Audric said:

able to adapt to existing code is important.

Ah, last month, there was one of these "code soupe" moments... Somebody had started on XY and someone was to take it over and expand it... You clone the repo. You open some source files. You skim some code, a bit curious... Your eyes widen... Without really knowing what's going on yet, the urge to just close this to forget it forever suddenly seems the only thing in your mind. Not one method shorter than a screen full, printing and logging all intermixed, all over the place... This is clearly a mess. You try to decipher it. To no avail. But, wait, all of this code here is not used, is it? No, it's not. Why is all of this checked in then? Nevermind, you can just delete this... The sooner it's gone the bet... Oh, no, this static public member is used elsewhere, the only thing of these 2000 lines... Oh, wasn't this an absolute path there, right in the middle of the code? Aaand there is another, different path. Ah, they are both used for... You close your eyes. You get some coffee. You contemplate quitting the job. You force yourself to continue. Why does every bit of code append to files that are opened and closed again all the time? Ah, another absolute path... Oh, it contains a user name. Not mine though. Now, why are these classes numbered and not named? There are some configuration files. Why are these paths different from the ones in the code? Ah, no, one half seems to be the same. Let's just fix this... Why is "working directory" a setting? Why is it unused? Oh, a password in plaintext, right there. Oh, wow, isn't this for... Cool! But, how on earth did they get this? Well, whatever. Now, does this even run? No, it does not even build... Let's see... The build process is somehow completely broken. Ok, fixed it, only took an hour. Now run it... Crash. Ok, this path needs a slash at the end but the other one does not. Easy. Btw, why are half of these classes called "...Base" even if there are no subclasses? Ok, all of these unused members will have to go first thing the next morning. Wait, it ran! Oh, it says it deleted something. Interesting, let's see... Oops...! ::)

You should have an internship in your hand as soon as you are in second year of your college otherwise you will be left behind

I don't know about the situation in India, but this seems to be a bit dogmatic. IMHO, internships are definitively the way to go, though, but choose wisely if you can, i.e. rather learn new tools with people focused on clean code instead of badly managed, stressed-out teams hacking something together with outdated technology and bad coding habits.

Go to: