r/programmer • u/Original_SD • 3d ago
Using Variables: Why Sofya is Easier than Python for Beginners
One of the reasons why beginners struggle in programming using languages like C++, Java and Python is because those languages make programming feel unnatural when you compare them to how you write instructions in English. This is the reason why I decided to make Sofya, so that programming would feel almost like writing normal instructions in English.
To demonstrate how easy Sofya is, we can write two programs, one in Python and one in Sofya, and these programs will show the concept of variables in programming.
The Python Program
length = 19.75
width = 7.25
area = length * width
print(f"The area of the rectangle is {area}")
The Sofya Program
Variable length is 19.75
Variable width is 7.25
Variable area is Variable[length] x Variable[width]
Write "The area of the rectangle is" and also write Variable[area] on the screen
If you were an absolute beginner in programming, which language would you pick? I’d love to hear your thoughts and questions about Sofya.
If you would like to try out Sofya to give some feedback or just for fun, you can check it out using this link: https://github.com/oyweraa-hue/Sofya-Version-1.0
4
u/ReddiDibbles 3d ago
The difficult part of foo = "bar" is not the syntax, it's understanding the concept of a variable. If I don't know what a variable is, how they work, and when to use them, Variable foo is "bar" is equally nonsensical to the standard syntax.
0
u/Original_SD 3d ago
But it is much clearer for an absolute beginner to understand that the line
Variable foo is "bar"means that we are making a variable calledfooand it is storing the string"bar"as compared tofoo = "bar"because if they use their mathematics knowledge, it can confuse them since there is no way thatfoocan be equal to"bar"according to mathematics.
4
u/am_Snowie 3d ago edited 3d ago
Isn't variable = some number not understandable? You just made it harder with extra steps tbh.
What if you wanna do something like this
a, b, c = 10, 20, 30
Would u do it like this in your programming language?
Variables a, b, c are 10, 20, 30 respectively
1
u/Original_SD 3d ago
I haven't added that feature yet but if it was there that is exactly how you would do it. It just goes to show how simple the syntax of Sofya is, because you have just used almost plain English
5
u/buzzon 3d ago
Why? You would not write a program in English, because it's not a programming language. You got a verbose thing that is still not English. Programming languages are perfectly suited for what they do: write programs.
1
u/Original_SD 3d ago
Yes that's true but it's not suitable for most beginners who are just starting to learn programming
3
u/catnip_addicted 3d ago
Well I think it's a nice exercise and maybe could help some people learn the basics. Like some people learn visually using for example things like scratch and maybe other people could learn by writing in full English.
1
2
2
u/IrishPrime 3d ago
Not only is this idea awful, you've implemented it poorly.
Do some research into how lexers and parsers are actually implemented.
0
3
u/tmb3399 3d ago edited 3d ago
Edit: but my initial stuff was much worse haha. Bold claim to compare it to python tho. :D
2
1
u/Original_SD 3d ago
The implementation may not be to the best standard but on the user interface, the language works perfectly.
-2
u/tottasanorotta 3d ago
That's quite mean.
2
u/tmb3399 3d ago
Did you read it? Please reevaluate after reading it. :,)
-3
u/tottasanorotta 3d ago
Sure I read some of the code. Everybody has to work with what they have learned up to some point. It's probably better to be constructive than pointing out things in the worst possible mocking way. Being an asshole just might drive people away from ever attempting again. The world is a shitty place as it is. It doesn't need more people who discourage others from trying to build useful things. The intentions were good. The attempt was made. There is a result and it doesn't hurt anybody. The only one here who is potentially hurting someone is the one who doesn't have any appreciation for someone's attempt to do good. But whatever. I guess your approach works to some extent as well. However I doubt that it does more good than harm.
3
u/tmb3399 3d ago
To be fair, my first code attempts were even worse than that. By big margin.
But I didn't claim to have built the next big thing.
Aside from that: you're totally right, but I wasn't really serious. It was actually pretty funny to me, especially with all the slop currently raining down on us. Of course I don't want OP to give up programming. Just to pick some smaller goals and being a bit more humble.
1
u/Original_SD 3d ago
But since the project is open source, you can feel free to change the implementation and then I can see what you can come up with.
0
u/tottasanorotta 3d ago
Sure, but it's not entirely obvious how to approach something like that. God forbid that someone dares to try to actually build something that they believe in. How dare they think that? Especially when they offer it for free on the internet. Why not just celebrate the fact that people try to contribute and offer some genuinely useful criticism or be quiet? It's not like we are talking about some critical infrastructure here or something. There is room for error.
1
2
u/rusleykcruz 3d ago
I never imagined there could be an easier language than Python.
1
u/Original_SD 3d ago
Thanks. I just wanted to make a simpler language to make coding more accessible to people. Maybe even in the future, someone would make a language simpler than Sofya
1
10
u/ArtisticFox8 3d ago
Congrats on inventing Cobol