Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,143,274 members, 7,780,617 topics. Date: Thursday, 28 March 2024 at 05:40 PM

You Would Better Start Programming With Java Or C# - Programming (4) - Nairaland

Nairaland Forum / Science/Technology / Programming / You Would Better Start Programming With Java Or C# (12498 Views)

Can I Learn Programming With My Smartphone / Can I Learn Programming With A 32-bit Operating System? / Programmers: At What Age Did You Start Programming? (2) (3) (4)

(1) (2) (3) (4) (5) (Reply) (Go Down)

Re: You Would Better Start Programming With Java Or C# by Bahat: 6:02pm On Sep 07, 2020
Javierleon:

Working with django helped me with the concept of errors, and then looking at the logs I began to wonder how the cookies operated, I had an issue with this HTTP, whenever I fetched a POST request, I get this Get HTTP .1 / POST ... Error
Then internal server error page displays
As long as I know, everything seems Right, the POST data is received. What can be the cause, Google isn't helping

I said earlier, as written in most documentation, cookies give web document state. You know if you're working with ftp there's no session data included or telnet. Cookie is used to track user activity on site and to sometimes verify if it's a new user or returning user.

Meself never grab the concept of cookies while getting from client system. You know cookie data are stored locally on users PC. Once it's included in the server code.

There's a lwpcookiejar() used to retrieve cookie data from clients PC I'm looking at some time ago.


You should try to validate the method type as it is in the django tutorial page like. If the request you made Is right there's no need for error to be returned but it might be something else. Django returns so much error grin

If request.method == POST:
if request.status_code != 200:
print('error code {}\n'.format(e.code))
elif request.status_code == 200:
Continue post data operation
else:
die() #php die code
for your post data methods.

Server error code will give you what type of error

Try to paste some of your code, that's where we figure out what's happening.

You won't fetch data with POST request. You only fetch data with GET request. Post is sending data to server to verify
Re: You Would Better Start Programming With Java Or C# by vheckthor1: 8:09pm On Sep 07, 2020
Bahat:


I said earlier, as written in most documentation, cookies give web document state. You know if you're working with ftp there's no session data included or telnet. Cookie is used to track user activity on site and to sometimes verify if it's a new user or returning user.

Meself never grab the concept of cookies while getting from client system. You know cookie data are stored locally on users PC. Once it's included in the server code.

There's a lwpcookiejar() used to retrieve cookie data from clients PC I'm looking at some time ago.


You should try to validate the method type as it is in the django tutorial page like. If the request you made Is right there's no need for error to be returned but it might be something else. Django returns so much error grin

If request.method == POST:
if request.status_code != 200:
print('error code {}\n'.format(e.code))
elif request.status_code == 200:
Continue post data operation
else:
die() #php die code
for your post data methods.

Server error code will give you what type of error

Try to paste some of your code, that's where we figure out what's happening.

You won't fetch data with POST request. You only fetch data with GET request. Post is sending data to server to verify

not entirely, you can use a post method to get and vice versa, depending on your work place policy
Re: You Would Better Start Programming With Java Or C# by Bahat: 8:39pm On Sep 07, 2020
vheckthor1:

not entirely, you can use a post method to get and vice versa, depending on your work place policy

Oh okay, I work as a freelancer not for a company. So I do my things my way. You can as well enlighten us on techniques
Re: You Would Better Start Programming With Java Or C# by vheckthor1: 11:27pm On Sep 07, 2020
Bahat:


Oh okay, I work as a freelancer not for a company. So I do my things my way. You can as well enlighten us on techniques
here at my work place, all request are made with post request, my work place is a financial institution.
Re: You Would Better Start Programming With Java Or C# by vheckthor1: 11:28pm On Sep 07, 2020
I was surprised when I resumed also, but I have to adapt
Re: You Would Better Start Programming With Java Or C# by vheckthor1: 11:28pm On Sep 07, 2020
Bahat:


Oh okay, I work as a freelancer not for a company. So I do my things my way. You can as well enlighten us on techniques
how is freelancing? and how are you getting your gigs
Re: You Would Better Start Programming With Java Or C# by cixak95211: 1:36am On Sep 08, 2020
vheckthor1:

here at my work place, all request are made with post request, my work place is a financial institution.

They need to overhaul their engineers.
It violates HTTP principles on all levels, and will cause some special APIs consumers to act funny or even break;
A POST request is expected to add a new entity and should return a 201 on success
while a GET request is expected to fetch an existing entity return a 200 on success
Sending a POST request and modifying your API to return a 200 is just plain ridiculous . . .
and like I said earlier will create confusion when publishing to specialized APIs, because the request and response headers will fail
an integrity check.

3 Likes

Re: You Would Better Start Programming With Java Or C# by Bahat: 9:36am On Sep 08, 2020
vheckthor1:

how is freelancing? and how are you getting your gigs

I get from my contacts to make them custom apps, it's not really easy but we scaling through.
Re: You Would Better Start Programming With Java Or C# by Bahat: 9:39am On Sep 08, 2020
vheckthor1:

here at my work place, all request are made with post request, my work place is a financial institution.

Most workplace have their policy so you adapt when problem arise they want you to solve and not fix the main issue. God is great
Re: You Would Better Start Programming With Java Or C# by Javierleon(m): 10:54am On Sep 08, 2020
Bahat:


You should try to validate the method type as it is in the django tutorial page like. If the request you made Is right there's no need for error to be returned but it might be something else. Django returns so much error grin

If request.method == POST:
if request.status_code != 200:
print('error code {}\n'.format(e.code))
elif request.status_code == 200:
Continue post data operation
else:
die() #php die code
for your post data methods.

Try to paste some of your code, that's where we figure out what's happening.

My code works this way
If request.method==POST:
Name = request.POST['...']
... do something with name
Return Something
Return something

am using the post request to perform some operations based on what the user entered
The operations go successfully but the first return statement does not execute
Re: You Would Better Start Programming With Java Or C# by Javierleon(m): 11:00am On Sep 08, 2020
cixak95211:


They need to overhaul their engineers.
It violates HTTP principles on all levels, and will cause some special APIs consumers to act funny or even break;
A POST request is expected to add a new entity and should return a 201 on success
while a GET request is expected to fetch an existing entity return a 200 on success
Sending a POST request and modifying your API to return a 200 is just plain ridiculous . . .
and like I said earlier will create confusion when publishing to specialized APIs, because the request and response headers will fail
an integrity check.
Does this mean intercepting a POST request and not actually putting in the data somewhere will not work
what will happen if return 201 is not explicitly written
Re: You Would Better Start Programming With Java Or C# by cixak95211: 11:40am On Sep 08, 2020
Javierleon:

Does this mean intercepting a POST request and not actually putting in the data somewhere will not work
what will happen if return 201 is not explicitly written

Simply put is bad practice. And take for example . . I have a public API that sends payment to user bank accounts
The API is on Zapier and a user is trying to connect their existing with mine and they have something like this which is pretty standard . .

#1 return status === 'success' && code === 201
? TransactionPostWorker()
: TransactionFailedWorker()

Now yu see the problem, your POST requests returns a 200 and not a 201, and even tho status says success.
The only way out is for the user to go modify their API, and what if its legacy code?
They modify it, it works for me, but now it breaks for others , both internal and external. That's why there is a standard which must be adhered to.

#2 All webhooks send a POST request to servers and expect a 200 response. If you decide to go against http standards and send a 201 response for whatever reasons best to you, webhook fails. Then you modify the webhook endpoint to work with http standards and yet, other parts of the api violates the same http standards . . =>>> spaghetti code
Re: You Would Better Start Programming With Java Or C# by vheckthor1: 12:16pm On Sep 08, 2020
cixak95211:


They need to overhaul their engineers.
It violates HTTP principles on all levels, and will cause some special APIs consumers to act funny or even break;
A POST request is expected to add a new entity and should return a 201 on success
while a GET request is expected to fetch an existing entity return a 200 on success
Sending a POST request and modifying your API to return a 200 is just plain ridiculous . . .
and like I said earlier will create confusion when publishing to specialized APIs, because the request and response headers will fail
an integrity check.
I don't think so, the financial institution is a multinational and they clearly understand why they chose post for all request and more so a post request can be used to return other type of response, we have a custom generic response of our APIs.

1 Like

Re: You Would Better Start Programming With Java Or C# by Bahat: 12:48pm On Sep 08, 2020
Javierleon:

My code works this way
If request.method==POST:
Name = request.POST['...']
... do something with name
Return Something
Return something

am using the post request to perform some operations based on what the user entered
The operations go successfully but the first return statement does not execute

It's alright.
Re: You Would Better Start Programming With Java Or C# by Xperienx(m): 1:30pm On Sep 08, 2020
vheckthor1:

here at my work place, all request are made with post request, my work place is a financial institution.

This is a very bad practice and can cause some security flaws, meanwhile I won't talk much about this here

As for the POST, I think C#, PHP and JAVASCRIPT are the best tools to learn in Nigeria in terms of job opportunities unlike the US where GOlang and related dominates.

My 2cent
Re: You Would Better Start Programming With Java Or C# by vheckthor1: 2:17pm On Sep 08, 2020
Xperienx:


This is a very bad practice and can cause some security flaws, meanwhile I won't talk much about this here

As for the POST, I think C#, PHP and JAVASCRIPT are the best tools to learn in Nigeria in terms of job opportunities unlike the US where GOlang and related dominates.

My 2cent
Java also sells in Nigeria
Re: You Would Better Start Programming With Java Or C# by vheckthor1: 2:18pm On Sep 08, 2020
Xperienx:


This is a very bad practice and can cause some security flaws, meanwhile I won't talk much about this here

As for the POST, I think C#, PHP and JAVASCRIPT are the best tools to learn in Nigeria in terms of job opportunities unlike the US where GOlang and related dominates.

My 2cent

I thing Paga APIs also has no get request all is post and put
Re: You Would Better Start Programming With Java Or C# by Javierleon(m): 10:16pm On Sep 09, 2020
Javierleon:

My code works this way
If request.method==POST:
Name = request.POST['...']
... do something with name
Return Something
Return something

am using the post request to perform some operations based on what the user entered
The operations go successfully but the first return statement does not execute
I found my error, the html page the first return statement returned, I. Forgot to load a tag
Re: You Would Better Start Programming With Java Or C# by progeek37(m): 1:10pm On Sep 16, 2020
Subscribe to my Zoom tutorial today and experience a leap in your coding skill. Send me a WhatsApp message for details.
Re: You Would Better Start Programming With Java Or C# by Starry321: 6:16pm On Sep 16, 2020
josh2297:

contact me on Whatsapp 09035535062.. let me help you with some books(free).. I used to find my bearing in datascience
I just did
Re: You Would Better Start Programming With Java Or C# by progeek37(m): 4:54pm On Oct 06, 2020
Learn to code and algorithms and data structures. Subcribe to my tutorial today by sending me a WhatsApp message
Re: You Would Better Start Programming With Java Or C# by Xtralot: 8:21am On Oct 07, 2020
josh2297:

contact me on Whatsapp 09035535062.. let me help you with some books(free).. I used to find my bearing in datascience

Good day bro, I will appreciate it if you could share some of the books with me. Thanks
Re: You Would Better Start Programming With Java Or C# by josh2297(m): 3:05pm On Oct 07, 2020
Xtralot:


Good day bro, I will appreciate it if you could share some of the books with me. Thanks
contact me on Whatsapp
Re: You Would Better Start Programming With Java Or C# by progeek37(m): 7:45am On Oct 17, 2020
You can subscribe to my tutorial by sending me a WhatsApp message.
Re: You Would Better Start Programming With Java Or C# by progeek37(m): 9:17pm On Oct 26, 2020
First thing first learn to program. Join my Java class today. Send me WhatsApp message.
Re: You Would Better Start Programming With Java Or C# by progeek37(m): 4:51pm On Oct 30, 2020
The class is still open to the general public. You can subscribe today by sending me a WhatsApp message. Check my Nairaland signature
Re: You Would Better Start Programming With Java Or C# by logicDcoder(m): 4:16pm On Oct 31, 2020
progeek37:
With all these questions...which programming language should a beginner start with. Many people people have given wonderful advise. I would like to add my view as well. What I will say here may be debatable but I will advise you to consider giving my thought a little chance. I will start by saying that no programming language is actually bad to start with if you are determined to face the challenges that your chosen language may pose.
However don't start with C or C++. You will learn them later.

I would strongly advise beginners to start programming with Java or C#. Python would be another option, but its off-rule syntax can be troublesome...the use of indentation to define scope and block instead of usual curly brace. Also its object oriented programming has some flaws(not technically but syntatically)...especially the encapsulation of data with underscores. Python may be highly human readable and easy to write as well...you may write codes faster in Python than in Java or C# but in large scales applications such fastness is not actually needed because software developers usually are willing to sacrifice immense time working and collaborating with teams to build projects...I mean they are willing to sacrifice any amount of time to build the projects.
Also Python is not strongly typed as Java and C# because of its dynamically typed unlike Java's statically typed, this can lead to problems in code maintenance by other developers. Consider these lines of code in Python:

Assuming there is an array(list) already defined as book_list(for Python) or bookList (for Java)

def exist(book, index):
if index < 0 or index >= len(book_list):
#report an error
else:
if book_list[index] == book:
return True
return False

The code snippet is actually good, I tried to use variables that correctly portrait their functions in the program to maintain a self-documenting code. But there lies some problems in the code. First when other developers are working on such code, the questions that may arise are:

1 What does this function return?(we actually need to work through the function to understand) but what if we actually want to reference the function? Therefore we will be forced to study the whole function to understand it.

2 What does the type "book" belong to? Is it an integer, a string or programmers defined type(object).

Let me rewrite the function(method) code in Java:

public boolean exist(Book book, int index)
{
if(index < 0 || index >= bookList.length)
{
//report an error;
}else
{
if(bookList[index].equals(book)
{
return true;
}

}
return false;
}

Obviously Java is better! So is C#!

Here in Java snippet, from the very beginning of the method declaration we understand that the method is available to be used in other classes because it was declared with the keyword "public", also we learn that it will return a "boolean" type and that it accepts a user defined "book object" and an "integer index".

So despite all the noise from Python communities, Java is undoubtedly better. Python is a great language but I would not encourage beginners to start with it as against Java or C#, because Python does not follow the usual sytnax rule which almost all programming languages adopt. That does not mean it is bad anyway. But as a beginner you need to understand what majority of languages have in common because you will be working with many other languages not just few like Python later in your career.

There are many more things to talk about. Think about OOP in Java or C# or the likes, if we want to encapsulate data so that other classes may not modify it. You simply encapsulate it with the keyword "private" you only have to provide a public method or property to allow other classes to access the data the way you want it to be accessed. In Python you use underscores instead something that can be mistakenly ignored. Also internally Python changes the name of a class member with a name that begins with double underscores by prefixing it with a single underscore followed by the class name. Hence Python does not provide a way to truly protect members from the outside world.

Another language is JavaScript, it is an absolutely bad language to start with. It gives beginners bad programming habit. It is not well structured and its oop is not natural. Many of its features were provided as add-ons , as much as possible avoid starting programming with JavaScript. Many people who started with JavaScript are apt to focus their entire life on front-end development. Many of them (I'm talking from my own experience with them in Nigeria) have vague understanding of Object Oriented principles. I have not met a JavaScript programmer who has accurate understanding of objects.

So in my view, I prioritize the following in that order:

1 Java
2 C#
3 Python


Leave your suggestions and views; I will try to reply as much as I can.

But I started with C. Initially it was tough but with time I pickt it up. The main reason why I learnt C is just to understand the fundamentals and the working process of DATA STRUCTURES and it opened my eye unlike python that has predefined methods for handling some operations on some data structures. C also unlocked my ability in getting solutions to solve problems in steps�. I learnt alot from C such as how memory is allocated for variable and other data structures, how to manipulate bits (packing multiple characters in an integer), how to handle files and I get to know more about program processes (how the child interacts with the parent processes). In summary C has a lot of packages but we all want to build things without understanding how it interacts with our machine. My advice to noobs out there, start with C++ not C, it has all the packages you need (Systems programming + OOP),it you really need to know it for competitive programming.
Re: You Would Better Start Programming With Java Or C# by progeek37(m): 11:55pm On Nov 05, 2020
logicDcoder:


But I started with C. Initially it was tough but with time I pickt it up. The main reason why I learnt C is just to understand the fundamentals and the working process of DATA STRUCTURES and it opened my eye unlike python that has predefined methods for handling some operations on some data structures. C also unlocked my ability in getting solutions to solve problems in steps�. I learnt alot from C such as how memory is allocated for variable and other data structures, how to manipulate bits (packing multiple characters in an integer), how to handle files and I get to know more about program processes (how the child interacts with the parent processes). In summary C has a lot of packages but we all want to build things without understanding how it interacts with our machine. My advice to noobs out there, start with C++ not C, it has all the packages you need (Systems programming + OOP),it you really need to know it for competitive programming.
Yes C is a great language, many beginners get lost and discouraged at Pointers. So I will advise them to start with Java or C#.
Re: You Would Better Start Programming With Java Or C# by Alexandre7: 3:23am On Dec 31, 2020
progeek37:
You can join my coding group if have already learned the fundamentals of programming or subscribe to tutorial if you are a beginner. Kindly send me a message on WhatsApp or text me.

I need more information.

I’m interested in learning C#, Java & Python.
Re: You Would Better Start Programming With Java Or C# by progeek37(m): 10:58pm On Jan 03, 2021
Alexandre7:


I need more information.

I’m interested in learning C#, Java & Python.
Send me a message on WhatsApp 08135683431
Re: You Would Better Start Programming With Java Or C# by progeek37(m): 3:04pm On Mar 23, 2021
Subscribe to my live Zoom tutorial to learn how to program a computer in just 3 months. Send me a message on WhatsApp 08135683431
Re: You Would Better Start Programming With Java Or C# by progeek37(m): 9:12pm On Mar 26, 2021
My Zoom tutorial is still available, to subscribe, just send me a WhatsApp message via 08135683431.

(1) (2) (3) (4) (5) (Reply)

Common good python programming practices you should know / Trying To Run Php Project After Installing Wamp Server / Nigerian, Kehinde Adeyemi, Among Best Global IT Developers

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 63
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.